
12th March 2010, 10:00
|
|
Member
|
|
Join Date: Sep 2009
Posts: 35
Thanks: 6
Thanked 2 Times in 2 Posts
|
|
HDDs, Partitions and other stuff
Howdy all,
I've a server running with 2 HDDs.
40GB IDE Hitachi IC35L060AVV207-0 - /dev/hda1
40GB IDE WDC WD400BB-23DEA0 - /dev/hdc1
/dev/hda1 have 2 partitions which is mounted as /boot, swap partition and 34GB of unallocated space.
/dev/hdc1 have 1 partition with all my relevant data and mounted as /.
I suspect /dev/hdc1 is a faulty harddrive and would like to allocate 34GB of /dev/hda1 so I can copy all the data from /dev/hdc1, mount it as / and totally remove /dev/hdc1 from my system.
Now, since Im not a linux expert at all, I'd love to hear what's the best way of doing this, can it be done remotely at all?
Thanks in advance!
|

13th March 2010, 14:17
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,169
Thanks: 1,026
Thanked 1,766 Times in 1,672 Posts
|
|
You'd have to create a new partition on /dev/hda for /, copy over the stuff from the current / partition (e.g. with dd), modify your /etc/fstab and maybe /etc/boot/grub/menu.lst and reboot.
|

13th March 2010, 17:58
|
|
Member
|
|
Join Date: Sep 2009
Posts: 35
Thanks: 6
Thanked 2 Times in 2 Posts
|
|
Thanks falko!
Is it possible creating new partition remotely?
[edit]
Ok, I probably should use fdisk,
Code:
fdisk -l
Disk /dev/hda: 40.0 GB, 40016019456 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 110 779152+ 82 Linux swap / Solaris
Disk /dev/hdc: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 * 1 4865 39078081 83 Linux
Code:
fdisk /dev/hda
The number of cylinders for this disk is set to 4865.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help):
Code:
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e
Partition number (1-4):
What should be the input now?
Last edited by autogun; 13th March 2010 at 19:17.
|

14th March 2010, 12:26
|
|
Member
|
|
Join Date: Sep 2009
Posts: 35
Thanks: 6
Thanked 2 Times in 2 Posts
|
|
I almost did it, really...
I've created /dev/hda3, formatted it using mkfs -t ext3.
Labeled it as / using e2label /dev/hda3
Labeled old / (/dev/hdc1) as /oldroot
Used dd if=/dev/hdc1 of=/dev/hda3 bs=4096 conv=notrunc,noerror to clone the partition.
I've even mounted /dev/hda3 to /mnt and checked - everything was there..
Rebooted the server and it didnt go up
Heheh, I feel silly...
|

14th March 2010, 15:56
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,169
Thanks: 1,026
Thanked 1,766 Times in 1,672 Posts
|
|
What's in /etc/fstab and /boot/grub/menu.lst?
|

15th March 2010, 07:59
|
|
Member
|
|
Join Date: Sep 2009
Posts: 35
Thanks: 6
Thanked 2 Times in 2 Posts
|
|
Hi falko,
This is how it looks now when I set /etc/fstab back to its original settings -
(/oldroot is /dev/hdc1 - the hdd I want to be removed - /dev/hda3 is the new root that didnt work)
Code:
LABEL=/oldroot / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-hda2 swap swap defaults 0 0
And this is /boot/grub/menu.lst - I didnt touch anything here
Code:
#boot=/dev/hda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
title trixbox (2.6.18-128.1.10.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-128.1.10.el5
module /vmlinuz-2.6.18-128.1.10.el5xen ro root=LABEL=/
module /initrd-2.6.18-128.1.10.el5xen.img
title trixbox-base (2.6.18-128.1.10.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-128.1.10.el5 ro root=LABEL=/
initrd /initrd-2.6.18-128.1.10.el5.img
|

15th March 2010, 14:20
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,169
Thanks: 1,026
Thanked 1,766 Times in 1,672 Posts
|
|
Can you try this?
Code:
/dev/hda3 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-hda2 swap swap defaults 0 0
Code:
#boot=/dev/hda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
title trixbox (2.6.18-128.1.10.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-128.1.10.el5
module /vmlinuz-2.6.18-128.1.10.el5xen ro root=/dev/hda3
module /initrd-2.6.18-128.1.10.el5xen.img
title trixbox-base (2.6.18-128.1.10.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-128.1.10.el5 ro root=/dev/hda3
initrd /initrd-2.6.18-128.1.10.el5.img
|
|
The Following 2 Users Say Thank You to falko For This Useful Post:
|
|

15th March 2010, 22:28
|
|
Member
|
|
Join Date: Sep 2009
Posts: 35
Thanks: 6
Thanked 2 Times in 2 Posts
|
|
Thank you so much, falko!
Works like a charm!!
Im so happy!
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 05:15.
|
Recent comments
19 hours 6 min ago
21 hours 57 min ago
1 day 3 hours ago
1 day 3 hours ago
1 day 4 hours ago
1 day 11 hours ago
1 day 12 hours ago
1 day 13 hours ago
1 day 16 hours ago
1 day 17 hours ago