LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mirror onto a new drive & RAID (https://www.linuxquestions.org/questions/linux-newbie-8/mirror-onto-a-new-drive-and-raid-679920/)

benderan 10-29-2008 11:16 PM

Mirror onto a new drive & RAID
 
Hi all,

I'm not sure if this is exactly the right forum, but here goes. My system currently has 146GB hard drive running Scientific Linux 3.0.8 (a free distribution of Redhat Enterprise Linux 3). I would like to replace the current hard drive with a new solid state drive. The problem is that the max capacity I can find of solid state drives is 128 GB. I am not using the full drive capacity, but unfortunately it is fully partitioned (i.e. the partitions take up the full 146GB) despite not using all that space.

My first question is, will I have to re-setup everything to transfer over to the new drive (i.e. base install the OS & then copy all the files over)? Or is there a way I could just mirror the drive? If I were to get a hard drive of equivalent size could I just mirror the drive directly (and how would I go about doing it)? I should add that if possible without too much extra work, the solid state drives are a better solution for my case because the drives run at high altitude (>5000 meters).

Would it be possible to use 3 solid state drives and a RAID 5 configuration to make this setup? Again, if so, how would you suggest going about the initial mirroring over to the new drives & RAID setup?

Thanks!

mostlyharmless 10-30-2008 04:41 PM

There are a lot of different ways to go about this.

There are some issues with solid state drives, from what I've read that make it inadvisable to use them with a journaling filesystem. So ext2 not ext3 for the new disks. There may be other issues in that regard as well.

As far as moving the OS over, if you can, a reinstall is usually a better idea, with moving the files over later. But, if you don't want to do that, then you could use rsync to move the whole filesystem over to the new disk. Since you aren't using 128 MB in your existing setup, it should fit. Just add the new drive, partition it, make your nonjournaled filesystem, mount it and rsync over to it. You'll have to reinstall the boot manager on that drive and test it out before removing your old drive.

I wouldn't recommend making a mirror then breaking it as a migration plan.

benderan 10-30-2008 11:41 PM

A quick question about your second suggestion (using rsync). I've only ever partioned my disk during the install of an OS. How does one do this if they just have empty disks (with just the RAID array setup)? Also a question about rsync. I was unaware that it will work without an OS on the new disks... Is there any special options you would suggest? I'm assuming when you say I can rsync the entire file system you mean just rsync-ing the / directory in my root partition, and a similar procedure for my /boot partition. Will the installation files for GRUB be on my OS install disks (and can suggest a procedure here). Sorry for all the nitty-gritty questions, but I'm still new to Linux admin and need to make these things work (and quickly).

mostlyharmless 11-01-2008 09:27 AM

To partition and rsync without installing the OS, use a boot CD style distro; Knoppix is the archetypal example. Boot the machine with Knoppix, fire up fdisk in an xterm window, e.g.
fdisk /dev/sda, if /dev/sda is the disk you want to partition.
then make the filesystem with mkfs.ext2 on, say, the first partition
mkfs.ext2 -i 128 -c /dev/sda1
then mount the old filesystem somewhere
make mount points
mkdir /mnt
mkdir /mnt/oldroot
mkdir /mnt/newroot
mount /dev/sdb2 /mnt/oldroot, assuming your old / is on /dev/sdb2
mount your new root
mount /dev/sda2 /mnt/newroot, assuming your old / is on /dev/sda2
then rsync -avR -x /mnt/oldroot /mnt/newroot

You can also do this from your existing setup by booting into the old setup; obviously then you don't have to mount / on /mnt/oldroot

Repeat for the /boot partition (if it is a separate partition), then the GRUB files will be installed, though grub itself will not. Tou can install grub to the new disk with either the grub prompt (type "grub" and find to find the files and install.) grub-install /dev/sda usually works too.

check man fdisk, man rsync man mkfs.ext2 to catch any typos I may have made :)


All times are GMT -5. The time now is 10:58 PM.