Here's a old post that i've wound up re-posting a few times, and here i go again. I'm
glad i saved
it!
Date: Thu, 25 Jan 2001 14:07:23 -0800 (PST)
From: John Wolford <[EMAIL PROTECTED]>
Subject: Summary: How to move /usr to another partition
To: [EMAIL PROTECTED]
Greetings again,
Thanks for all the replies re: How to move /usr to another partition?
It's nice to know that what
i was working with SHOULD have worked, on principle. Here is a brief
summary of the "How to move
/usr to another partition?" thread.
1. Resize partition, using Partition Magic or some such thing. [this
will only work if you
actually have the appropriate space on the drive, of course]
All of the following assume that /usr will be duplicated somehow onto
/mnt/usr temporarily, then
/etc/fstab will be updated to reflect the new location, reboot and
presto, you are mounting the
new /usr.
2. copy:
# cp -a /usr /mnt
3. tarball:
# tar cvf /mnt/usr.tar /usr
# cd /mnt
# tar xvfp usr.tar
(Note that this method requires enough free space to hold not just
mnt/usr but also /mnt/usr.tar)
or
# tar cf - /usr | ( cd /mnt ; tar xvfp - )
or
# cd /mnt
# tar cf - -C /usr | tar xvpf
(Note that these last two methods of tarballing only require enough
free space to hold /usr)
Care must be taken to preserve relative links and file permissions if
either 2 or 3 is to work.
Soft links do not support spanning partitions or devices and will cause
failures if this occurs.
An aside: at the time that i was attempting this i was installing and
re-installing on various
drives on the same system. It MAY have been the case that i had a swap
partition on the device
that contained /usr and the device that contained the new /mnt/usr. If
this were true, it could
have caused some problems, i don't know.
Thanks again,
John
--- [EMAIL PROTECTED] wrote:
> My favorite method of copying partitions on systems on Linux is cp -ax
> (the -x switch tells cp to stay on the current filesystem)
>
> Eg.,
>
> with / mounted as /, and the new one mounted as /newroot, you can say:
>
> cd /
> cp -ax . newroot
>
> Make sure to tell lilo and fstab about the change, of course.
>
> Also, you may want to look into GNU parted:
>
> http://www.gnu.org/software/parted/parted.html
>
> It can resize ext2 partitions, as long as the start of the partition stays
> fixed (so in your case, it would work for / , but you would need to
> handle /usr another way (if you want to change the size of /usr to fill
> what / had before, anyway)
>
>
> -pete
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/