Written on January 23, 2004
When I set up my hard drive to take Debian, I didn’t take into account the vast range of software that I was going to find immediately indispensible. So,
/usr was on the same partition as
/, and it was taking up 1.1 Gb of a 2 Gb partition. That was unsupportable, of course, so I had to move
/usr to it’s own wee data fiefdom.
/home a few times, and I have a procedure for that, but I wasn’t sure you could do the same thing with
/usr. I asked Arthur, and he pointed out something very important – the editiors are on
/usr, and so I had to edit
/etc/fstab before renaming
/usr. Once I had the order worked out though, it went perfectly. Here is the procedure:
# Set up a partition table on the new hard drive cfdisk /dev/hdb # Get a filesystem on the partition # you're going to use mkfs.ext2 /dev/hdb1 # Mount the soon-to-/usr partition mount /dev/hdb1 /mnt/tmp/ # Edit the filesystem table vi /etc/fstab # Add the new /usr to the table /dev/hdb1 /usr ext2 defaults 1 2 # Get into /usr and prepare to copy cd /usr # Single-user mode # a bare root for low-level maintenance init 1 # Copy everything into the new /usr cp -ax * /mnt/tmp/ # Rename /usr so that you can mount # the new /usr in the right place mv /usr /usr.old # Set up the mount point mkdir /usr # Cross your fingers reboot
Filed in: blog.