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

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.

  • Does that affect other directories already mounted under /mnt? Can another name be used besides /mnt? – vfclists Oct 2 '15 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. – Ferenc Wágner Oct 2 '15 at 11:42
  • What does the --bind signify? Is there a special command to unmount it? – vfclists Oct 4 '15 at 1:41
  • A bind mount, see man mount. You can simply umount it as any other mount if it's not in use. – Ferenc Wágner Oct 4 '15 at 7:22
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.

  • 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. – vfclists Oct 1 '15 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.