0

I just installed Linux Mint Maya (13.2) onto a USB stick with uNetbootin (http://sourceforge.net/projects/unetbootin/). The install seems to work ok, and has a "persistence" partition which allows changes to persist between sessions.

One thing which is weird is that i can't do df to see the available space:

$ df -h
df: cannot read table of mounted file systems: Is a directory 

I assume it's talking about /etc/mtab, and indeed when i look at mtab i can see it's not a file, it's a directory:

$ ls -l /etc
....
-rw-r--r-- 1 root root      63 Jul 29 13:16 fstab
drwxr-xr-x 2 root root       3 Mar 30  2012 fstab.d
....
drwxr-xr-x 2 root root    4096 Jul 29 12:03 mtab
-rw------- 1 root mint       0 Jul 29 11:43 mtab.fuselock
....

(i've just listed entries which i think are relevant). When i look in /etc/ls -l mtab there's lots of links:

$ ls -l /etc/mtab
total 0
lrwxrwxrwx 1 root root 18 Jul 29 11:29 ex -> /usr/bin/vim.basic
lrwxrwxrwx 1 root root 28 Jul 29 11:29 ex.1.gz -> /usr/share/man/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 Jul 29 11:29 ex.fr.1.gz -> /usr/share/man/fr/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 Jul 29 11:29 ex.it.1.gz -> /usr/share/man/it/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 Jul 29 11:29 ex.pl.1.gz -> /usr/share/man/pl/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 Jul 29 11:29 ex.ru.1.gz -> /usr/share/man/ru/man1/vim.1.gz
lrwxrwxrwx 1 root root 14 Jul 29 12:03 gnome-text-editor -> /usr/bin/gedit
lrwxrwxrwx 1 root root 30 Jul 29 12:03 gnome-text-editor.1.gz -> /usr/share/man/man1/gedit.1.gz
lrwxrwxrwx 1 root root 29 Jul 29 11:42 gnome-www-browser -> /usr/bin/google-chrome-stable
lrwxrwxrwx 1 root root 29 Jul 29 11:42 google-chrome -> /usr/bin/google-chrome-stable
lrwxrwxrwx 1 root root 18 Jul 29 11:28 rview -> /usr/bin/vim.basic
lrwxrwxrwx 1 root root 18 Jul 29 11:28 rvim -> /usr/bin/vim.basic
lrwxrwxrwx 1 root root 18 Jul 29 11:28 vi -> /usr/bin/vim.basic
lrwxrwxrwx 1 root root 28 Jul 29 11:28 vi.1.gz -> /usr/share/man/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 Jul 29 11:28 vi.fr.1.gz -> /usr/share/man/fr/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 Jul 29 11:28 vi.it.1.gz -> /usr/share/man/it/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 Jul 29 11:28 vi.pl.1.gz -> /usr/share/man/pl/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 Jul 29 11:28 vi.ru.1.gz -> /usr/share/man/ru/man1/vim.1.gz
lrwxrwxrwx 1 root root 18 Jul 29 11:29 view -> /usr/bin/vim.basic
lrwxrwxrwx 1 root root 28 Jul 29 11:29 view.1.gz -> /usr/share/man/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 Jul 29 11:29 view.fr.1.gz -> /usr/share/man/fr/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 Jul 29 11:29 view.it.1.gz -> /usr/share/man/it/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 Jul 29 11:29 view.pl.1.gz -> /usr/share/man/pl/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 Jul 29 11:29 view.ru.1.gz -> /usr/share/man/ru/man1/vim.1.gz
lrwxrwxrwx 1 root root 18 Jul 29 11:28 vim -> /usr/bin/vim.basic
lrwxrwxrwx 1 root root 18 Jul 29 11:28 vimdiff -> /usr/bin/vim.basic
lrwxrwxrwx 1 root root 29 Jul 29 11:42 x-www-browser -> /usr/bin/google-chrome-stable

fstab seems normal, FWIW.

$ cat /etc/fstab
overlayfs / overlayfs rw 0 0
tmpfs /tmp tmpfs nosuid,nodev 0 0

Does anyone know

1) what's going on with mtab here?

2) how i can fix it without cocking up my USB install (which has taken me ages to get working up to this point)

thanks! max

EDIT: (too long-winded for a comment) This is in response to an answer by @Celada pointing out that /etc/mtab looks like it's holding the contents of /etc/alternatives: that's right, it does!

/etc/alternatives is there as well, and has everything that's in /etc/mtab, plus lots more. (i've checked this by copying the contents into an array and subtracting one from the other).

Looking at the contents of /etc/mtab, the lines in there all refer to software i have installed since first booting the usb stick install: namely, vim, (full version instead of the 'mini' one that comes with the install) chrome and gedit (a text editor). As i said these lines are all in /etc/alternatives too.

I've done the following:

$ sudo mv /etc/mtab /etc/mtab_BACK
$ sudo ln -s /proc/mounts /etc/mtab

and now i can df again:

$ df -h
df: `/cow': No such file or directory
df: `/home/max/.gvfs': Transport endpoint is not connected
Filesystem      Size  Used Avail Use% Mounted on
rootfs          4.0G  872M  2.9G  23% /
udev            1.2G  4.0K  1.2G   1% /dev
tmpfs           465M  984K  464M   1% /run
/dev/sdb1        15G  5.0G  9.8G  34% /cdrom
/dev/loop0      869M  869M     0 100% /rofs
/cow            4.0G  872M  2.9G  23% /
tmpfs           1.2G   16K  1.2G   1% /tmp
none            5.0M     0  5.0M   0% /run/lock
none            1.2G  144K  1.2G   1% /run/shm

The error message at the top is confusing: /cow is listed (this is the persistence partition i think) but the error says df: '/cow': No such file or directory. Is this a problem do you think?

  • I don't know if the missing /cow is normal or not. I seems erroneous, but it might be normal. Live Linux distributions with persistence partitions do some funny juggling at startup involving mounting the original, mounting the persistence partition, mounting a union of both, moving the originals out of the way, and moving the union in place. /cow's non-existence might be a leftover artifact from that, I don't know. As for /home/max/.gvfs, that's nothing to worry about. That's a GNOME virtual filesystem that somehow got disconnected. – Celada Jul 29 '15 at 15:04
  • thanks - after a restart, the /cow error message is still there but the .gvfs one is gone. /etc/mtab seems normal. The line for /cow is /cow / overlayfs rw,relatime,lowerdir=//filesystem.squashfs,upperdir=/cow 0 0 , in case that's of interest. Anyway, thanks a lot! – Max Williams Jul 29 '15 at 15:17
1

The file listing of /etc/mtab appears to belong to /etc/alternatives! Is there any way you could have accidentally renamed /etc/alternatives to /etc/mtab?

Is /etc/alternatives missing? If so, then the fix is just to rename /etc/mtab back to /etc/alternatives. If not, then you are stuck with the problem of merging the contents of the real /etc/alternatives with the /etc/mtab which is supposed to be /etc/alternatives.

Once /etc/mtab is moved out of the way, the easiest thing to do would be to just recreate it as a symlink to /proc/mounts:

ln -s /proc/mounts /etc/mtab
  • thanks @Celada - /etc/alternatives is there too and in fact has all of the lines from /etc/mtab plus a load of others. (it looks like /etc/mtab just has entries for the 3 bits of software i've installed manually since booting up - gedit, chrome and vim). So, theoretically i should be able to just ditch /etc/mtab and symlink it as you say. I'll try renaming it first... – Max Williams Jul 29 '15 at 14:32
  • This looks like it's worked! With a slight bit of oddness though - mind having a look at my edit? – Max Williams Jul 29 '15 at 14:38

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.