Skip to main content
Topic: Can't figure out why mount fails with "Invalid argument" (Read 855 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Can't figure out why mount fails with "Invalid argument"

Hi!

I am trying to find a format for fstab, which I can adapt to all OSes in a few multiboot machines I run at home,  the idea being that in each partition the non-root OS containing partitions will be "noauto", so that I can write a script that will mount them when I want, something I have several reasons for.

I tried this on a partition with Funtoo on a machine booting from Artix, on a Fujitsu with intel-i5 (Ivybridge)   having Windows in the internal HD and all other (Linux)  OSes on an external USB HD and it worked fine as I expected.  After  several failures, of course.

When I later tried it on Artix, on HP with intel-i5 (Westmere) it did not work at all and I can't make any sense of the feed back I am getting:

Code: [Select]
$ ls /mnt
funtoo            sda11_Funtoo_X  sda2       sda6_Slack    sda9_artix_Bas  usb0
sda10_artix_Xfce  sda12_Void_X    sda5_Mint  sda7_Storage  sr0


Obs.:  The uuid below is not the real one, hope that is OK.

1) When fstab  says:

Code: [Select]
# sda11 FuntooX 
UUID=f6856cfc-0b6a-4f54-8005-82cbd9132ff0 /mnt/sda11_Funtoo_X ext4 rw,suid,dev,exec,noauto,group,async 0 0
#/dev/sda11 /mnt/sda11_Funtoo_X ext4 rw,suid,dev,exec,noauto,group,async 0 0

Then:
Code: [Select]
$ sudo mount /dev/disk/by-uuid/f6856cfc-0b6a-4f54-8005-82cbd9132ff0
mount: /mnt/sda11_Funtoo_X: mount failed: Invalid argument.
$ sudo mount /mnt/sda11
mount: /mnt/sda11: can't find in /etc/fstab.
$ sudo mount -U f6856cfc-0b6a-4f54-8005-82cbd9132ff0
mount: /mnt/sda11_Funtoo_X: mount failed: Invalid argument.
$ sudo mount source  -U f6856cfc-0b6a-4f54-8005-82cbd9132ff0
mount: source: mount point does not exist.
       dmesg(1) may have more information after failed mount system call.
$ sudo mount --source /dev/sda11
mount: /mnt/sda11_Funtoo_X: mount failed: Invalid argument.
$ ls /mnt
funtoo            sda11_Funtoo_X  sda2       sda6_Slack    sda9_artix_Bas  usb0
sda10_artix_Xfce  sda12_Void_X    sda5_Mint  sda7_Storage  sr0
$ sudo mount --target /mnt/sda_11_Funtoo_X
mount: /mnt/sda_11_Funtoo_X: can't find mount point in /etc/fstab.
$ sudo mount --target /mnt/sda11_Funtoo_X
mount: /mnt/sda11_Funtoo_X: mount failed: Invalid argument.
$  sudo mount -t ext4 /dev/disk/by-uuid/f6856cfc-0b6a-4f54-8005-82cbd9132ff0
mount: /mnt/sda11_Funtoo_X: mount failed: Invalid argument.
$ sudo mount /dev/disk/by-uuid/f6856cfc-0b6a-4f54-8005-82cbd9132ff0 /mnt/sda11_Funtoo_X
$ lsblk
NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda       8:0    0 465.8G  0 disk
├─sda1    8:1    0   512M  0 part
├─sda2    8:2    0   513M  0 part
├─sda3    8:3    0     1K  0 part
├─sda5    8:5    0  34.6G  0 part
├─sda6    8:6    0  35.2G  0 part /mnt/sda6_Slack
├─sda7    8:7    0   207G  0 part
├─sda8    8:8    0    16G  0 part [SWAP]
├─sda9    8:9    0  35.3G  0 part /
├─sda10   8:10   0  33.7G  0 part
├─sda11   8:11   0  45.1G  0 part /mnt/sda11_Funtoo_X
└─sda12   8:12   0  32.9G  0 part
sr0      11:0    1   4.4G  0 rom 
$

2) when fstab says:

Code: [Select]
# sda11 FuntooX 
# UUID=f6856cfc-0b6a-4f54-8005-82cbd9132ff0 /mnt/sda11_Funtoo_X ext4 rw,suid,dev,exec,noauto,group,async 0 0
/dev/sda11 /mnt/sda11_Funtoo_X ext4 rw,suid,dev,exec,noauto,group,async 0 0
Then:
Code: [Select]
$ sudo mount  /mnt/sda11_Funtoo_X
mount: /mnt/sda11_Funtoo_X: mount failed: Invalid argument.
$ sudo mount --target  /mnt/sda11_Funtoo_X
mount: /mnt/sda11_Funtoo_X: mount failed: Invalid argument.
$ sudo mount  /dev/sda11
mount: /mnt/sda11_Funtoo_X: mount failed: Invalid argument.
$ sudo mount --source /dev/sda11
mount: /mnt/sda11_Funtoo_X: mount failed: Invalid argument.
$ sudo mount  /dev/sda11 /mnt/sda11_Funtoo_X
$ lsblk
NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda       8:0    0 465.8G  0 disk
├─sda1    8:1    0   512M  0 part
├─sda2    8:2    0   513M  0 part
├─sda3    8:3    0     1K  0 part
├─sda5    8:5    0  34.6G  0 part
├─sda6    8:6    0  35.2G  0 part /mnt/sda6_Slack
├─sda7    8:7    0   207G  0 part
├─sda8    8:8    0    16G  0 part [SWAP]
├─sda9    8:9    0  35.3G  0 part /
├─sda10   8:10   0  33.7G  0 part
├─sda11   8:11   0  45.1G  0 part /mnt/sda11_Funtoo_X
└─sda12   8:12   0  32.9G  0 part
sr0      11:0    1   4.4G  0 rom 

The script is of the format (here with masked uuids):
Code: [Select]
#!/bin/sh
for i in  11111111-1111-1111-1111-111111111111 11111111-1111-1111-1111-111111111112 11111111-1111-1111-1111-111111111113 11111111-1111-1111-1111-111111111114 11111111-1111-1111-1111-111111111115 11111111-1111-1111-1111-111111111116 11111111-1111-1111-1111-111111111117 11111111-1111-1111-1111-111111111118 11111111-1111-1111-1111-111111111119 ; do mount /dev/disk/by-uuid/$i; done;

I have been testing with isolated command lines of the same kind for one single partition, to avoid possible errors in my scripting.

Re: Can't figure out why mount fails with "Invalid argument"

Reply #1
group ?

Do you realise that most of the fstab options you show are the defaults so are having no effect ?
AFAIKT only noauto has a effect, other than group which I guess simply stops it working.

There was no need to mask your UUID's. No one can do anything with that information unless they already have root access to your system.

If you don't want to mount a filesystem at boot the simplest solution is just not to put it in fstab.
I'm at a bit of a loss to understand the whole concept of what you are trying to do but lose the 'group' and you might have more success.

Re: Can't figure out why mount fails with "Invalid argument"

Reply #2
Some of the errors suggest that /mnt/sda11_Funtoo_X doesn't exist, then you try to mount a totally different directory /mnt/sda11 - do you need to ensure the mountpoint directories exist first, and create them if they don't?