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.

3
  • yes you can move it to any partitions and it will get work Feb 25, 2014 at 6:11
  • Do you have enough free space on /dev/sda6 to hold all the data from both /home and /usr?
    – Teddy
    Feb 25, 2014 at 6:29
  • @Teddy yes,it does have enough.
    – BufBills
    Feb 25, 2014 at 6:42

1 Answer 1

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

3
  • have you tested this ? Feb 25, 2014 at 7:52
  • I see a way. mount sda6 onto the root namespace, then mount sda5 on top of that. have fun configuring the initrd for that, though.
    – strugee
    Feb 25, 2014 at 7:55
  • @RahulPatil No.
    – Teddy
    Mar 10, 2014 at 3:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .