You are not logged in.

#1 2017-04-12 07:19:25

angel6700
Member
Registered: 2009-09-06
Posts: 23

fstab and external usb

Hello,

I have my system configured for mounting hd partitions in fstab with UUID=  LABEL=
Everything works fine, but if I add some entries for an external flash drive like this:

/dev/sda1    /mnt/usbdiska       vfat   user,utf8,rw,auto,nofail,x-systemd.device-timeout=1,umask=111,dmask=000,noatime,flush
/dev/sdb1    /mnt/usbdiskb       vfat   user,utf8,rw,auto,nofail,x-systemd.device-timeout=1,umask=111,dmask=000,noatime,flush    

Then, if i reboot the computer with the USB flash drive plugged, then it tries to mount the partitions corresponding to the uuid or labels, with the parameters for the vfat flash drive.

What amI doing wrong?

Thanks in advance.

Offline

#2 2017-04-12 07:25:55

Jristz
Member
From: America/Santiago
Registered: 2011-06-11
Posts: 1,048

Re: fstab and external usb

If you have uniques Labels for the partitions and not want use PARTUUIDs then use the labels genfstab -L / with the flash connected to get the labels and UUID of all.


Lenovo ThinkPad L420 modified
:: Intel i7 2560QM :: 8 GB RAM :: SSD 256 GB ::
:: DVD read+Writter :: 3 USB 3.0 Expresa Card ::
:: a Favulous 1 mins lasting Io-Li battery ::cry::

Offline

#3 2017-04-12 07:44:32

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: fstab and external usb

ugh genfstab.

Why use /dev/sdXY for the external drives? You should write entries with their UUID/LABEL. You can get that with lsblk -f.

/dev/sdXY are not recommended for fstab because they can refer to partition on different drive on each boot.

It is even better to use udisks2 and some frontend daemon of it to (auto)mount external drive, especially those with Windows filesystems, saves you from a lot of troubles.

Offline

#4 2017-04-12 09:14:36

angel6700
Member
Registered: 2009-09-06
Posts: 23

Re: fstab and external usb

Thanks a lot,
I understand your ideas, but I think I will look the udisks way, I cannot use UUIDs or LABELs, because I'm talking about usb flash drives, and I do not know those parameters I I plug a new (unknown) drive.
So probably the fstab approach is not good for dealing with this drives.

Of course, I'm talking about a system without any Desktop Environment installed.
I will look how to automount without fstab.

Thanks again,

Offline

#5 2017-04-12 15:05:52

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: fstab and external usb

angel6700 wrote:

I cannot use UUIDs or LABELs, because I'm talking about usb flash drives, and I do not know those parameters I I plug a new (unknown) drive.
Thanks again,

lsblk -f as tom.ty89 said. However, udisks2 is preferable for removeable devices than fstab.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#6 2017-04-12 16:00:07

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: fstab and external usb

fsckd wrote:

lsblk -f as tom.ty89 said. However, udisks2 is preferable for removeable devices than fstab.

The problem is that he want an entry that will mount any usb drive attached. UUID or LABEL will only work for a specific USB drive. Probably the udisk method is the best. Or a custom script.

Offline

#7 2017-04-12 16:48:07

c00ter
Member
From: Alaskan in Washington State
Registered: 2014-08-28
Posts: 421

Re: fstab and external usb

Are you looking at Persistent Block Device Naming?

Regards


UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. -- Doug Gwyn

Offline

#8 2017-04-12 17:13:06

loqs
Member
Registered: 2014-03-06
Posts: 19,114

Re: fstab and external usb

c00ter wrote:

Is this not already covered in posts #4 - #6?

Offline

#9 2017-04-12 18:33:39

c00ter
Member
From: Alaskan in Washington State
Registered: 2014-08-28
Posts: 421

Re: fstab and external usb

I was unsure, that is why I first searched on what was being described, then attempted to put a label to it so that I could better understand the problem and perhaps lend some help based on experience.

Regards


UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. -- Doug Gwyn

Offline

Board footer

Powered by FluxBB