[SATLUG] Hard drive partitions, mount points, and motherboards

John Pappas j at jvpappas.net
Tue Jan 22 21:06:02 CST 2008


On Jan 22, 2008 5:54 PM, Henry Pugsley <henry.pugsley at gmail.com> wrote:

> On Jan 22, 2008 3:46 PM, Justin Burdette <justin.burdette at gmail.com>
> wrote:
>
> > I'm thinking about adding a second SATA hard drive to my system when I
> > upgrade next month. I think I remember reading somewhere that different
> > hard
> > drive partitions can share the same mount point. For example, right now
> my
> > /home partition is sda5. If I add the 2nd drive and have the partition
> > sdb5,
> > can they both have /home as a mount point, and will the file system see
> > them
> > as one continuous space? It's time to upgrade from my 200GB (30GB for /,
> > approx. 80 each for /home and /common) to something closer to 1TB.
>

> You can't "share" mount points between devices.  You could setup RAID or
> LVM
> to combine the devices into one device


Ahh the LVM stripe discussion in a different form.  Just do a standard data
migration.  I would recommend that you use LVM for your new device, that way
moves in the future are easier: `pvmove -n LVMVOLUME /dev/olddevice
/dev/newdevice`.  You still need to do a standard data migration to get the
data to a file system on the LVM, so here is how I would recommend it go
down:

`fdisk /dev/new` followed by 'n' 'p' '1' to make your new disk one big
partition.
`pvcreate /dev/new`
`vgcreate data /dev/new1`
`lvcreate -n home -L 150G data` (feel free to make the 150G whatever you
like)
`lvcreate -n common -L 150G data` (again, feel free to make the 150G
whatever you like)
`mkfs.FSofChoice /dev/data/home`
`mkfs.FSofChoice /dev/data/common`
`mkdir /home.new`
`mkdir /common.new`
 rsync /home -> /home.new (refer to man for exact needs)
 rsync /common-> /home.new (refer to man for exact needs)
If any errors, repeat 2 rsyncs.
Reboot into single user mode:
 `mv /home /home.old`
 `mv /common /common.old`
 `mv /home.new /home`
 `mv /common.new /common`
reboot, and you are done.  Now just delete the old common and home
filesystems/partitions and your done.  if you wanted, you could even
demonstrate the fun of a pvmove:
 `pvcreate /dev/OldHomeAndCommonSpaceMadeIntoOnePartition`
 `vgextend data /dev/OldHomeAndCommonSpaceMadeIntoOnePartition`
 `pvmove -vi 60 -n home data
/dev/OldHomeAndCommonSpaceMadeIntoOnePartition`  This will ONLINE migrate
the home LV from /dev/new to /dev/old, no reboots, no nothing.  The -vi 60
lets you watch the progress (verbosely), updated every 60 seconds to stdout.
And to go back:
 `pvmove -vi 60 -n home data /dev/new1`

Fun, Huh?  Course you should backup, just in case ;)

but it is far easier to simply move
> your home directory to the larger drive and mount it on /home.  After you
> are sure the data is copied to the new drive, be sure to delete it off the
> old drive to recover the space on your root partition.


 Yep.  Agree.

HTH,
jp


More information about the SATLUG mailing list