0

I noticed a weird thing on my Chromebook today. It seems like 3 directories are mounted on the same partition and yet have totally different content. I tried googling the issue, but came up with a loot of people trying to have the same content in all directories.

When I run mount | grep /dev/mmcblk0p1 I get:

/dev/mmcblk0p1 on /mnt/stateful_partition type ext4 (rw,nosuid,nodev,noexec,relatime,commit=600,data=ordered)
/dev/mmcblk0p1 on /home type ext4 (rw,nosuid,nodev,noexec,relatime,commit=600,data=ordered)
/dev/mmcblk0p1 on /usr/local type ext4 (rw,nodev,relatime,commit=600,data=ordered)

However when I inspect each directory I get this.

For ls /home

chronos  root  user

For ls /usr/local

chronos  root  user

And for ls /mnt/stateful_partition

crouton  dev_image  encrypted  encrypted.block  encrypted.key  home  lost+found  shutdown_stateful_umount_failure  unencrypted

I noticed, that home is actually a directly in /mnt/stateful_partition, but I still don't fully understand it.

Can anyone enlighten me?

2

The moment I typed the question I figured it out myself. Maybe someone else is curious too.

The output of mount is misleading. The partition is only mounted on /mnt/stateful_partition and /home and /usr/local are not mounted on the same partition, but seem to be mount --bind to the directories dev-image and home in /mnt/stateful_partition.

Follow up: I opened an issue on Github to suggest a modification for this behavior.

Result: As I learned from this conversation the problem was, as so often, between chair and keyboard. mount is not the correct command, if one wishes to see the SOURCE of a directory. It only shows the partition where the data is stored, without structure information.

The solution is to use findmnt instead that prints a a nice tree of directories and their source.

| improve this answer | |

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.