4

I'm running slackware 14.0 linux.

I was recently doing an open office document and sent emails out and then my internet was cutting out then after a bit I got hinted that my disk was full then I cleared up some space. But what I don't understand is how is it possible that I can use my computer with the root filesystem mounted but it doesn't automatically show it with the mount command?

Here is an extract when I execute dmesg while looking for info about the root partition (sda2):

[    4.293905] sd 2:0:0:0: [sda] 234441648 512-byte logical blocks: (120 GB/111 GiB)
[    4.294372] sd 2:0:0:0: [sda] Write Protect is off
[    4.294434] sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    4.294477] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    4.307345]  sda: sda1 sda2 sda3 sda4
[    4.307942] sd 2:0:0:0: [sda] Attached SCSI disk
[    4.322793] EXT3-fs (sda2): mounted filesystem with ordered data mode
[    6.917851] EXT3-fs (sda2): using internal journal
[   15.260713] EXT3-fs (sda3): using internal journal
[   15.260774] EXT3-fs (sda3): mounted filesystem with ordered data mode
[   15.297340] EXT3-fs (sda4): using internal journal
[   15.297400] EXT3-fs (sda4): mounted filesystem with ordered data mode

I also ran fsck to do a thorough scan on the same partition and it found no errors.

When I ran mount, I see this but no entry for sda2:

proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
/dev/sda3 on /80gb type ext3 (rw,commit=0)
/dev/sda4 on /disk type ext3 (rw,commit=0)
/dev/sda1 on /DOS type vfat (rw,umask=0022)
tmpfs on /dev/shm type tmpfs (rw)
/dev/ram0 on /tmp type ext2 (rw,nodev,noatime,nodiratime)

So I gave it a gamble to mount it manually and I get this error:

mount: /dev/sda2 already mounted or / busy

I looked for a running utility that might have something to do with automounting with "ps -A | grep uto" but nothing was found.

I checked /etc/fstab and I see:

/dev/sda2        /                ext3        defaults         1   1
/dev/sda3        /80gb            ext3        defaults         1   2
/dev/sda4        /disk            ext3        defaults         1   2
/dev/sda1        /DOS             vfat        umask=0022       1   0
/dev/cdrom       /mnt/cdrom       auto        noauto,owner,ro,comment=x-gvfs-show 0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0

Yet what is odd is that I can still access the filesystem even though its not listed in mount and I am able to save data to it.

Also, what's even odder is that for me to find disk space info in the root filesystem I have to execute "df -h /" instead of "df -h". then it shows "-" as the filesystem. I would rather do "df -h" and see "/dev/sda2" as the filesystem with the correct free space.

Also, when I stared at the startup sequence, it indicated that everything is mounted. Only time it would unmount things is when I restart or shutdown my computer.

How do I fix this so when I execute mount with no parameters, I see the root partition already mounted along with the other partitions?

3
  • Typing "mount" won't display "/" - "/" is where everything is mounted. Type "df -h". Apr 11 at 2:21
  • @CinaedSimson I dunno, mount does show / for me (on Debian 10). It's a mountpoint, why do you think mount shouldn't show it?
    – marcelm
    Apr 11 at 16:09
  • Try "dmesg | grep EXT4-fs" and you should see filesystems on all the partitions. Root should be the one with "mounted filesystem with ordered data mode - or in your case, sda1. In fact, there should also be a "re-mounted" entry for sda1. Apr 11 at 19:20
8

The mount command only shows you whatever is listed in /etc/mtab. If you want to see all the mounts, you can do cat /proc/mounts. You can mount something without having it recorded in /etc/mtab by using the mount -n option.

The fact that /etc/mtab and /proc/mounts are not necessarily the same thing can be useful for the shutdown scripts, as it lets them only worry about unmounting the stuff that's listed in /etc/mtab.

7
  • Why is this still a thing in modern Linux? In the distant past, there was no /proc/mounts, so /etc/mtab was needed...
    – user253751
    Apr 11 at 12:58
  • @user253751 Probably for backwards compatibility, people might have code that depends on this behavior.
    – Garo
    Apr 11 at 14:27
  • @user253751 "Why is this still a thing in modern Linux?" - It probably varies by distribution; on my system (Debian 10), /etc/mtab is a symlink to /proc/self/mounts, so mount shows all mounts.
    – marcelm
    Apr 11 at 16:10
  • I checked /proc/mounts but I did not see /dev/sda2 listed for / but I did see rootfs listed for /. and mtab is a separate file which also does not list /dev/sda2. fstab DOES list /dev/sda2 as explained in my question.
    – Mike St
    Apr 11 at 17:41
  • @Garo: I had a bunch of stuff break when they switched /etc/mtab -> /proc/mounts. Turned out that old stuff assumed that when /etc/mtab couldn't be opened for writing that / was still readonly and /etc/mtab was untrustworthy.
    – Joshua
    Apr 11 at 18:27

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.