Hope this helps-- if policy on list is mandrake employees only
then kindly ignore :)
For example - Your existing /usr is on /dev/hda5 and your new disk is
/dev/hdd5 . Here is how to do it failsafe. (move /usr to new partition)
assume you'd fdisk and mke2fs on /dev/hdd5. many howtos on that.
# mount -t /dev/hdd5 /mnt/usr
# cd /
There are now two ways to do this - cool or cautious:
cool:
# tar cf - /usr | ( cd /mnt ; tar xvfp - )
[note - only one 'verbose v' cause you don't need it scrolling
at you twice.]
cautious:
# tar cvf /mnt/usr.tar /usr
# cd /mnt
(should see usr.tar with length non 0)
# tar xvfp usr.tar
you probably don't need 'p' with modern tar commands as they usually
default to permissions same p, but just in case use it .
NOTE: the cautious way (2 steps) assumes you need double the space (one
for the .tar and one for the extracted .tar . The cool way throws
everything into memory then back onto the new partition. Much cooler if
you get the filepaths correct. If you DONT get the filepaths correct
you'll wind up with something like
/mnt/usr/usr
Depending on your attention to detail this is common mistake or needless
worry :)
Once this is confirmed edit /etc/fstab, comment out
#/dev/hda5 /usr ext2 defaults 1 2
and make a new /usr right under it in /etc/fstab
/dev/hdd5 /usr ext2 defaults 1 2
so your new /etc/fstab has the lines --
#/dev/hda5 /usr ext2 defaults 1 2
/dev/hdd5 /usr ext2 defaults 1 2
(and the rest of your mounts except swap and / are below
/usr so it will still mount in the same order
ls -alt /mnt/usr and if it looks like /usr did, reboot and rejoice.
IF you run into problems you'll have to rescue boot, edit /etc/fstab
back to the way it was, comment out /dev/hdd5, boot again and
figure out what went wrong -- probably the path of the new /usr was
such that you mounted /usr/usr instead of /usr - i've done that a couple
of times.
Good luck!
-Dave Dennis
-Seattle, WA
On Tue, 23 Jan 2001, John Wolford wrote:
> Date: Tue, 23 Jan 2001 16:22:18 -0800 (PST)
> From: John Wolford <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: [expert] How to move /usr to another partition?
>
> Many a howto have i read.
>
> Here's the situation: My /usr partition has become
> full. I would like to simply create a lager partition
> and then copy over all the files from /usr and make
> the necessary changes in fstab and remount.
>
> I tried 'cp -a' and um...tarballing with permissions
> etc, and ....i'm not sure if i tried anything else.
> (Why? Because i had this problem a while ago and
> finally i gave up and reinstalled with a larger
> partition. This of course seems absurd but i was
> pressed for time and couldn't get any help from my
> local linux gurus)
>
> I would be "successful" but when i would boot up and
> log in, almost any program i ran from /usr would cause
> a segmentation fault and result in a core dump. I
> tried reinstalling the offending packages but that was
> a very limited solution and didn't always work (that
> gcc or make wouldn't work didn't make things any
> easier). I looked through for any symbolic link
> problems and i didn't have a lot (or any, that i can
> remember) dead links. I'm wondering if there is
> somewhere a reference to /dev/hdx (x=a1,b5,c, etc)
> that also needs to be changed.
>
> By the way, i also considered maintaining a /usr2
> directory (like in, oh, say, Windows...) but one of my
> local linux-gurus advised me that doing that would
> result in an administrative nightmare.
>
> Any insight would be appreciated.
>
> Thanks,
> John
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/
>
>