1

I installed xfce4-Buster-Debian, and during the install, I selected manual partitioning and chose to mount a drive containing some files to a specific location. For that drive, of course I chose not to format the drive. After Debian was installed on a different partition, and booting to the OS, I see no files in the mounting directory. The directory shows up in the place I expect, but when I cd into it and ls -la, there is nothing in that dir. But according to GParted, the data is occupying the space.

I booted to the LiveCD, and the files do show up there.

What possible causes are there of this behaviour?


EDIT: I provide the following output

$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=ff57c2c0-e962-4578-be1b-0500f82bceb3 /home/go       ext4    defaults,noatime 0 2
UUID=16DB-7490                            /boot/efi      vfat    defaults,noatime 0 2
UUID=6ff37539-9538-40d4-b3bf-094f44e8410f /              ext4    defaults,noatime 0 1
UUID=5fb9e868-f3c7-47a5-96da-7ccf13bfd998 /home          ext4    defaults,noatime 0 2
UUID=25a379fc-3db3-4f58-813b-a914d147e7c2 swap           swap    defaults,noatime 0 2
$ lsblk -f
NAME        FSTYPE  LABEL                     UUID                                 FSAVAIL FSUSE% MOUNTPOINT
sda         iso9660 d-live nf 10.6.0 xf amd64 2020-09-26-13-15-55-00                              
├─sda1      iso9660 d-live nf 10.6.0 xf amd64 2020-09-26-13-15-55-00                     0   100% /media/marius/d-live nf 10.6.0
└─sda2      vfat    d-live nf 10.6.0 xf amd64 DEB0-0001                                           
sdb                                                                                               
└─sdb1      vfat                              F802-75AF                              27,9G     3% /media/marius/F802-75AF
mmcblk0                                                                                           
└─mmcblk0p1 ext4                              ff57c2c0-e962-4578-be1b-0500f82bceb3   53,8G     1% /home/go
nvme0n1                                                                                           
├─nvme0n1p1 ext4                              6ff37539-9538-40d4-b3bf-094f44e8410f   58,5G    18% /
├─nvme0n1p2 ext4                              5fb9e868-f3c7-47a5-96da-7ccf13bfd998  101,4G    15% /home
├─nvme0n1p3 swap                              25a379fc-3db3-4f58-813b-a914d147e7c2                [SWAP]
└─nvme0n1p4 vfat                              16DB-7490                             294,3M     2% /boot/efi

The device is mmcblk0p1 and mount point is /home/go


EDIT2:

$ stat -c '%n - %i' / /home /home/go
/ - 2
/home - 2
/home/go - 2
2
  • @roaima The %i is the inode number if option -f is missing. I guess you meant the filesystem ID?
    – Freddy
    May 26, 2021 at 22:41
  • 1
    @roaima Honestly I have no idea what the problem is (buggy sd card driver?). OP could update the output with stat -f -c '%n - %i' and let's see...
    – Freddy
    May 26, 2021 at 22:48

2 Answers 2

0

I had intended to ask you to provide the output of stat -f -c '%n - %i' / /home /home/go, which would have given the device identifiers for the filesystems underlying the directories. (If they'd all been different we would have known they were different filesystems.) However, the output of stat -c '%n - %i' / /home /home/go command I gave you is sufficient for our purposes - it's telling us that the root inode for all three directories is the same, i.e. 2, which also means they must be different filesystems.

Given that you can see the files with your LiveCD but not with your actual boot environment, I would suggest your files are on /, and when you mount /home and /home/go you mask the directories where the files are.

Find the files as root, like this

mkdir /mnt/root             # Create temporary directory mountpoint
mount --bind / /mnt/root    # Make /mnt/root identical to /
ls /mnt/root/home           # List area hidden by /home
ls /mnt/root/home/go        # List area hidden by /home/go

If either of the ls commands produce files then you won't see them in the corresponding ls /home or ls /home/go. Assuming - but only if - the ls commands for /mnt/home/... do show files but the corresponding ones for /home/... do not, then you can use one or both of these two segments to move the files to their correct places.

Move all the files from the masked /home/go to the real /home/go:

(
shopt -s dotglob
cp -au /mnt/root/home/go/. /home/go && rm -rf /mnt/root/home/go/*
)

Move all the files from the masked /home to the real /home:

(
shopt -s dotglob
cp -au /mnt/root/home/. /home && rm -rf /mnt/root/home/*
)

I've used cp && rm rather than mv because I don't want the command to fail during the merge. The cp -u flag stops older files overwriting newer ones.

2
  • Dear roaima, thank you for your answer. Unfortunately, neither of the 'ls' commands produce files. The last two code blocks produce errors. The first one says 'cp: cannot stat '/mnt/root/home/go/.': No such file or directory'
    – Mikkel Rev
    May 27, 2021 at 10:04
  • I've amended the answer slightly. If you see nothing under /mnt/home and/or /mnt/home/go then the suggested solution is invalid
    – roaima
    May 27, 2021 at 10:13
0

/home is is the mount point of one ext4 partition (or part of one) and designed so that all users have a home directory such as /home/userx etc

However, you simultaneously want to use /home/go as the mount point of a second partition (on another device!). I strongly suggest that you mount the 'go' partition somewhere else /mnt/go is recommended. This way your data will not be confused with your mount points.

For example, I have a large partition dedicated to video files. This is not mounted on /home/video, but is mounted on /mnt/video.

My GUI file manager is quite happy with this arrangement.

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.