TuskenTower on 13 Feb 2008 21:31:37 -0800


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

Re: [PLUG] Hard drive consolidation


On 2/13/08, linux <linux@jondz.net> wrote:
>
> 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
> right)..
>
> 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
> read-only..you 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.
>
> jondz

Thanks for the tips everyone.  GRUB reinstallation is no problem.

I'll definitely try using LVM and use the partition UIDs.  I'm still
going to think about how I want to do this.  One other problem that I
failed to mention is that this machine is plugged into my HDTV and
it's not supposed to move or be offline. Nor can I hog the TV while
"playing" with the linux box.

I just looked at /closet (what I called pr0n earlier) and it's all old
linux ISOs and I really don't care about my home partition (everything
is already on another machine).  So /dev/sdb is fair game for
repartitioning while the machine is on.  For fun I unmounted /home and
found the original home directories underneath.

So, I could setup LVM, repartition the 160 HD and simply DD over the
existing partitions.  I will take the machine down to run level 2 and
stop all unnecessary services before running DD.  Yes I am making this
harder than it needs to be, but it beats trying to use the keyboard
and HDTV.

Holy smokes!!! Ubuntu is running with the GUI in run level 2.

$ ls /etc/rcS.d/*networking
/etc/rcS.d/S40networking

I thought networking is supposed to be OFF in single user mode.
Anyone know what gives with this setup in Ubuntu?

thanks,
Amul
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug