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.

vfclists
  • 7,531
  • 14
  • 53
  • 79

2 Answers2

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.

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.

Archemar
  • 31,554
  • 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 01 '15 at 13:36