3

Linux, Debian.

Now I have:

/dev/sda5   on /
/dev/sda6   on /home
/dev/sda7   on /usr

I would like to use sda6 to hold /usr, then free /dev/sda7 for other use.

What is the safest way to do this? I am confused about how to create a /usr on /dev/sda6 and issue copy command without confusing Linux.

BufBills
  • 3,095

1 Answers1

2

I can see no good way for two subdirectories to share a partition, except for using a symbolic link:

  1. Boot in single-user mode so no processes are running.

  2. Copy everything from /usr into /home

    cp --archive --sparse=always --one-file-system /usr /home
    
  3. Unmount /usr, remove the empty mount point and make a symlink

    umount /usr
    
    rmdir /usr
    
    ln --symbolic /home/usr /
    
  4. Edit /etc/fstab and remove (or comment out) the line with the /usr mount.

    sensible-editor /etc/fstab
    
  5. Reboot

terdon
  • 242,166
Teddy
  • 1,555
  • 10
  • 13