LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Need to replace HDD with a larger drive (https://www.linuxquestions.org/questions/linux-hardware-18/need-to-replace-hdd-with-a-larger-drive-130423/)

gvi 12-31-2003 03:50 PM

Need to replace HDD with a larger drive
 
On a RH9 install a hDD has been filled to capacity. I would like to replace it with a larger one. Add the bigger drive, copy files from small to bigger, remove small, new drive have old drive designation (hdb1 for example).

Caeda 12-31-2003 04:16 PM

ok, so buy new hard drive, put it in, run partition program. Why did you ask about this?

gvi 12-31-2003 04:47 PM

the current device is labeled hdb1. I want to copy all the data on it to the new drive, remove the old drive, restart (if neccessary) and have the new drive have same device label, hdb1. I was told it is not as easy a process as it would be in windows. The machine is used as a real audio & shockwave server, so I'am concerned that years of audio files do not get lost or have a bunch of editing to of conf files or whatever, if the device comes up with a label different than hdb1. I'm just starting to work with Linux and am at present depending on help from people who seem to know more than me. Thanks.

dalek 12-31-2003 09:36 PM

I just did this. So here we go.

Put in new drive and then boot from a bootable Linux CD. I used a Gentoo CD. Make the partitions in the same order as the old one, just bigger maybe. Make your mount directories and then mount the drives. Copy the data over. Shutdown the system. Then take out the old drive and put in the new drive where the old one was.

Goes something like this:

boot, not from the hard drive though.

run fdisk or cfdisk to create your partitions and then create your file system like the old one.

Use mkdir to create the mount points for the drive. mkdir /mnt/old and mkdir /mnt/new should work.

Then copy the stuff over using the command cp -rpv /mnt/old/* /mnt/new/ and then sit back and watch the stuff copy over.

When that is done, shut down and then hook the new drive in where the old drive was. Say a prayer or two, I did. Boot.

Note: you should not copy from a linux system that is running. Some files will not copy over.

I did have a small fstab problem but it did boot just fine. It just didn't mount one of my data drives because I forgot to move that master/slave jumper. :scratch:

That is sort of basic, questions?

Later

:D :D :D :D

kato71 01-19-2004 03:58 PM

Then copy the stuff over using the command cp -rpv /mnt/old/* /mnt/new/ and then sit back and watch the stuff copy over.


I used cp -avR /old-drive/* /new-drive/

But after I copy do I also need to use like lilo.S or something, I tried the above command (using -rpv) but it wouldn't copy over the files saying that the destination did exist, so I tried the other command with "-avR" and it seemed to copy everything but wont boot.

Please advise,
Tim

michaelk 01-19-2004 04:17 PM

RH uses partition labels so in addition to copying all of the files you will need to add labels to the partitions on the new drive. See man pages for tune2fs.

If you keep all of the partiton # the same as the original you shouldn't have any problems.

Do you have a master drive i.e hda?

kato71 01-20-2004 08:58 AM

The master drive is hda and the secondary which is the larger drive is hdc, the hda had partitions 1-7 so I did the same on hdc creating 1-7, whereas #4 being an extended partition that 5-7 resides on. Before running the "cp" command I mounted all of the new partitions to the directory "new-disk" and then copied over from there. Then I took out hda and replaced it with hdc and the system will just hang. Oh also when creating the partitions with fdisk all I could do was create them as ext2 on hdc, but the ones on hda were ext3.

The main reason for this was so that I would have enough room to upgrade this 7.2 to RH9 and it doesn't have enough room to copy the install files. This is just a monitoring system, but I don't want to have to go through setting up mrtg and netsaint again since it was so much fun in the originally and I would like to keep all the history.

Thanks for the help in advance
Tim

michaelk 01-20-2004 10:20 AM

kato71
You should post a new thread. You will get a better response.

Does RH use partitions labels in version 7.2? Did you reinstall the original hda drive so you could have a bootable system? Look at the /etc/ftab file and see if it has anything like label=/

Did you reinstall the bootloader? Just coping the files will not modify the MBR. I would of thought that if the MBR was blank there would of been some type of no operating system error instead of just hanging.

You can convert ext2 to ext3 with the tune2fs command. See man pages for details.

Did you change the jumpers from slave to master when you swapped drives or are you using cable select?

Did you mount the new partitions one at a time to mount point new-disk and then copied? If what you really did was mount all of the new partitions to the same directory i.e. no sub directories then only the last mounted partition will have any data on it.


All times are GMT -5. The time now is 07:38 PM.