LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   USB Disk Mount oddness Slackware-14.0 (https://www.linuxquestions.org/questions/slackware-14/usb-disk-mount-oddness-slackware-14-0-a-4175446708/)

business_kid 01-22-2013 03:27 AM

USB Disk Mount oddness Slackware-14.0
 
I have 2 usb disks in /etc/fstab with the user option, so I can mount them as user
Code:

/dev/sdb1        /mnt/zip          auto        noatime,diratime,user    0  0
/dev/sdc1        /mnt/hd          auto              noatime,diratime,user    0  0

If I plug one in, and try as user to mount it, it's not seen. I have to run 'fdisk -l' as root, and then the system sees it. WM is XFCE. What's the deal? It will remount, however. There will be a quick lazy tweak out there somewhere to fix this nonsense, and I'd love to hear it.

Even dmesg |tail doesn't show the complete dialog. (Dmesg has to be sudo dmesg - who got all paranoid over in slackware ?:). It stops short of announcing the partitions, so the partitions 'don't exist' until I run the fdisk. Of course, XFCE's automounter is also snagged in permissions.

guanx 01-22-2013 09:25 AM

Quote:

Originally Posted by business_kid (Post 4875262)
... and try as user to mount it, it's not seen. ...

Could you retell this in plain text, i.e. something like this:

I issued the command "mount /dev/sdc1 /mnt", and got a message "mount: only root can do that"

Didier Spaier 01-22-2013 10:42 AM

I'd try to add the noauto option. Also look at dmesg's output when you plug in the usb disk.

business_kid 01-22-2013 12:28 PM

Thanks for the reply, and Didier for the 'noauto' idea - that's going in.

Quote:

Originally Posted by guanx (Post 4875470)
Could you retell this in plain text, i.e. something like this:

I issued the command "mount /dev/sdc1 /mnt", and got a message "mount: only root can do that"


Explaining anything in simple English is usually beyond me. Great minds run in great circles :-)
The error is/was
Code:

special device /dev/sdc1 does not exist
fdisk -l as root finds it, the partition table is read; I can mount it thereafter


Despite a reboot, the same thing isn't happening today, and my hardware is flaky, so I'll mark this solved without solving it. The USB port on my camera is knackered; I have 2xSD-->micro sd adapters, and one of them is disassembling itself:-/. It throws out a $2 sd card reader 100% of the time, though it's happy with it other days. It continually recognizes my usb key - it seems to have taken note of it somewhere. When/if I get the problem back the problem, and believe in my hardware, I'll start a new thread.

Didier Spaier 01-22-2013 12:52 PM

As you have two usb devices, the first one which is plugged in after booting gets the hdb1 interface name, whatever it be.

To avoid that, simply name them in /etc/fstab by their UUID (which will never change as it is an attribute of the physical device) not by the interface name in use at a point of time.

For that, plug one of them in, type "blkid" as root, and use the info given to feed a line for that device in /etc/fstab.

Here is an example:
Code:

su
/dev/sda1: LABEL="RM-CM-)servM-CM-) au systM-CM-(me" UUID="9A185F24185EFF27" TYPE="ntfs"
/dev/sda2: UUID="78D46329D462E938" TYPE="ntfs"
/dev/sda3: UUID="56d1b80a-c999-496a-b906-a13221e7890e" TYPE="ext4"
/dev/sda5: UUID="4b7861c6-bcc7-4ba0-931b-d0f4597e52dd" TYPE="ext4"
/dev/sda6: UUID="be30390a-f2d5-4fdc-96db-94c2b70e4955" TYPE="swap"
/dev/sdb1: UUID="cd2b0100-ec15-483e-9016-2b192d8d126a" TYPE="vfat"

Here let's say the last line if for a partition in an USB key, I would append following line for it /etc/fstab:
Code:

UUID=cd2b0100-ec15-483e-9016-2b192d8d126a  /mnt/usbkey  vfat  noauto,user  0  0

business_kid 01-23-2013 02:37 AM

Thanks Didier, but I have a personal loathing for uuids. Purely personal - I don't ask anyone else to loathe them. And with the exception of my usb key, there's a pile of usb disks get plugged in from time to tme - GPS, son's gear, phone, sd card reader, etc. The medium term cure is to set up automount in XFCE, but it's a permissions hack and I have to web search it each time.

Didier Spaier 01-23-2013 04:34 AM

Quote:

Originally Posted by business_kid (Post 4875932)
Thanks Didier, but I have a personal loathing for uuids. Purely personal - I don't ask anyone else to loathe them. And with the exception of my usb key, there's a pile of usb disks get plugged in from time to tme - GPS, son's gear, phone, sd card reader, etc. The medium term cure is to set up automount in XFCE, but it's a permissions hack and I have to web search it each time.

(1) if you don't like uuids, you could use labels instead -- just kidding, I assume that you loathe labels as well :^)
(2) I just launched XFCE for the first time ever in Slackware-14.0 (I'm a fluxboxer) and didn't have to set up anything to get automount of an USB HD (two partitions) plus an USB key. i just had to right click on the icon displayed for each partition and choose "open".
Code:

bash-4.2$ cat /proc/partitions
major minor  #blocks  name

  8        0  156290904 sda
  8        1    102400 sda1
  8        2  36467712 sda2
  8        3  97281607 sda3
  8        4          1 sda4
  8        5  18239488 sda5
  8        6    4192933 sda6
  11        0    1048575 sr0
  8      16  976759808 sdb
  8      17  911467590 sdb1
  8      18  28107776 sdb2
  8      19    3144704 sdb3
  8      20  34037760 sdb4
  8      32    126464 sdc
  8      33    126433 sdc1
bash-4.2$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        92G  55G  32G  64% /
/dev/sda5        18G  9,2G  7,2G  57% /current
tmpfs          1,5G    0  1,5G  0% /dev/shm
/dev/sda2        35G  30G  5,3G  85% /windows
/dev/sdc1      122M  43M  80M  35% /run/media/didier/USBSLACKINS
/dev/sdb4        33G  30G  2,8G  92% /run/media/didier/05CA0CD90B63ADB5
/dev/sdb2        27G  6,9G  19G  28% /run/media/didier/0c698508-4662-4d53-b18f-064aa97d1301
/dev/sda1      100M  25M  76M  25% /run/media/didier/Réservé au système
bash-4.2$

PS But please note that I have no entries in /etc/fstab for sdb2, sdb4 and sdc1.
Amazingly /dev/sdb1 which has one is not auto mounted.
So I guess that for XFCE to automount your partitions you should remove corresponding lines in /etc/fstab.
Maybe there is a setting you can use in XFCE to choose yourself the mount points - but hey, I guess that in that case you would need to identify the partitions either by UUID or by LABEL. Oh, well...

Oh, and /dev/sdb3 is a swap partition, so it's pretty normal that it be not mounted.

business_kid 01-24-2013 04:54 AM

It works here too - I have been using XFCE for 2-3 releases, but I don't know it yet. I never gave it any time. It works once as you said off the desktop; Thunar(file manager - I've learned that much) hasn't a clue about it, and if I unmount it, the icon vanishes :-/. Then pull it and push it back somewhere else, and thunar automounts it :-///.

/retires to a home for the bewildered :-)


All times are GMT -5. The time now is 04:01 AM.