> My question is, wheather it is possible to move a directory (/usr
> or /usr/local) "on the fly" to the new partition, or would it
> be better to reinstall? (I'll soon be upgrading to RH 6.1 anyway
> so that would be a natural time to reinstall)
Make a file system on the new partition and mount it somewhere
convenient:
# mke2fs /dev/hdXX
# mount /dev/hdXX /mnt
Drop to single-user mode:
# telinit 1
Copy the directory over:
# (cd /usr && tar cf - . ) | (cd /mnt && tar xvf - )
Add a line to /etc/fstab
/dev/hdXX /usr ext2 defaults
Rename the old /usr and mount the new one in its place:
# mv /usr /usr.old
# umount /mnt
# mount /usr
(The mount command will pick up the partition details from /etc/fstab.)
Go back to run level 3 or 5 as desired:
# telinit 3
# telinit 5
Nice thing is that this doesn't affect your uptime :-)
Later,
Kenn
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!