1

I installed an additional Linux installation into a separate partition set the /home directory into that partition as well and afterwards I modified /etc/fstab to point to the old partition.

How can I access the contents of the initial /home directory?

# initial configuration UUID=001 /disks/disk1part1 ext2 auto,users,rw,exec,relatime 0 0 UUID=002 / ext4 defaults,relatime,errors=remount-ro 0 1 UUID=003 /disks/disk26 ext4 auto,users,rw,exec,relatime 0 0 UUID=004 none swap sw 0 0 # changed configuration UUID=001 /disks/disk1part1 ext2 auto,users,rw,exec,relatime 0 0 UUID=002 / ext4 defaults,relatime,errors=remount-ro 0 1 UUID=003 /home ext4 auto,users,rw,exec,relatime 0 0 UUID=004 none swap sw 0 0 

The initial system had no /home in /etc/fstab because it was under the root, and the second configuration added changed /home to /disks/disks26.

2 Answers 2

2

After a mount --bind / /mnt you can access the /home directory of your root partition as /mnt/home, even if /home is already mounted over.

5
  • Does that affect other directories already mounted under /mnt? Can another name be used besides /mnt? Commented Oct 2, 2015 at 9:48
  • If you mount something over /mnt, that will shadow all its previous content. I used /mnt because that's what routinely used for temporary mounts. You can use any other existing directory. Commented Oct 2, 2015 at 11:42
  • What does the --bind signify? Is there a special command to unmount it? Commented Oct 4, 2015 at 1:41
  • A bind mount, see man mount. You can simply umount it as any other mount if it's not in use. Commented Oct 4, 2015 at 7:22
  • @vfclists unix.stackexchange.com/questions/198590/what-is-a-bind-mount Commented Oct 4, 2015 at 22:14
1

A mere two edit (and two reboot).

  1. comment line with /home; like

    ## UUID=003 /home ext4 auto,users,rw,exec,relatime 0 0 
  2. reboot, log

    cd / mv /home /home.old mkdir /home 

    edit /etc/fstab, uncomment.


What happened ?

As you guess new /home was mount over old /home, there is no way, save umounting to see old /home.

If you could umount /home, there is no need to reboot on above commands.

1
  • Isn't it possible to access via another means without changing the fstab and rebooting and renaming it? I am thinking along the lines of perhaps finding the inode and renaming it. Does changing the /home /etc/fstab make the /home inaccessible completely? It has to be there somewhere. Commented Oct 1, 2015 at 13:36

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.