linux on 13 Feb 2008 18:33:37 -0800

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Hard drive consolidation

On Wed, 2008-02-13 at 17:53 -0500, TuskenTower wrote:
> In the past, I have always added HDs to my Linux machines and that was
> pretty simple.  This time, I want to remove the HD that hosts my root
> filesystem.
> My setup is this:
> WD             74GB   /dev/sda1 is /boot, /dev/sda2 is / and /dev/sda3 is /var
> Seagate    160GB   /dev/sdb1 something (let's call it pr0n), and
> /dev/sdb2 is /home
> WD           500GB  /dev/sdc1 is /mythtv
> I want to remove my power hungry WD 74GB drive and consolidate its
> contents onto the 160 GB drive.  I know that I could unmount /boot,
> /var and /home and copy all their files onto /dev/sda2 and then DD
> them over to /dev/sdb.  Is there a better way to do this?  And can I
> do this without having to drop into single user mode to turn off
> everything else (I can dream)?
> I do realize that I'm going to mess up my fstab.  Is there anything
> else that might complain about what I am doing?
> thanks,
> Amul

adding some more  ideas

maybe you dont want the layout of sdb2 (maybe /home is not positioned

first of all (of course) back up /home and /pr0n to probably to /mythtv/
(you have some space, right) and prepare for possibiity of losing sdb

what i would do is

1. create parallel partitions on sdb1 (e.g, rememering that /dev/sdb1
would be the new root, /dev/sdb2 the new root, etc, then maybe put /home
on the last, like, /dev/sdb5).   The way you want the new one to be. Do
account for swap space and extended partitions.  

if using a boot cdrom like knoppix:

dd from sda1 to sdb1 #  HAVE to be the same size (or slightly bigger)
dd from sda2 to sdb2 
copy (not dd) /var to sdb3 # with mkfs as needed
copy also for /home and /pron

if not using a boot cdrom

what I am finding myself doing recently is this way.

boot single user,  mount most everything on the old disk as really want to freeze the disks (dont let anything write
to it while copying).
like "mount -o remount -o ro /boot" and "mount -o remount -o ro /" and
so on.
dd if=/dev/sda1 to new partition (sdb1)
dd if=/dev/sda2 to new partition (sdb2)
copy the rest of them (like copy the whole /var tree to /mnt/new/var
where sdb3 would be).   usually between reboots along the way for me.
you'd probably deal with fsck along the way since dd would have copied a
running disk.

The reason i use dd on root but copy for everything else is i dont want
to account for /proc/ and /dev/ filesystems on root.  for the rest of
them usually involves a resize so plain copy is actually ok.

The last step is yanking out your 74g gigs and making sdb boot.  thats
basically installing grub on that other disk (i dont recall exactly).
And fixing /etc/fstab on the new disk to account for the disk/parition
changes.   if anything this is probably the most headache part.


Philadelphia Linux Users Group         --
Announcements -
General Discussion  --