Unable to make XFCE "automount" a particular external hard drive.
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Unable to make XFCE "automount" a particular external hard drive.
Greetings!
Enjoy the colors as my attempt to liven up a dull topic!
I "need" to have Xfce automatically mount and be rw for user when I hook up this USB external HDD.
I can mount it finemanually as root with:
Code:
mount -t exfat /dev/sdb1 /media/WDMyPassport/
...at which point the user can read and write! It even appears in Thunar as an ejectable storage location!
I just want to not have to manually mount as root, as my user is a pointy-clicky-4-life and possibly harmful at the command prompt! Slackware 14.1 32bit (sans KDE) vs. WD My Passport (1TB external HDD).
Code:
root@fruitbomb:~# fdisk -l /dev/sdb
Disk /dev/sdb: 1000.2 GB, 1000170586112 bytes
255 heads, 63 sectors/track, 121597 cylinders, total 1953458176 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfecfd94e
Device Boot Start End Blocks Id System
/dev/sdb1 * 2 1953458175 976729087 7 HPFS/NTFS/exFAT
I have spent at least 20 hours on the net looking at various methods, none of which
have panned out....I can't even get it to tell me its UUID for some reason. I suspect
if I knew the UUID, I could make an fstab entry that would help?
I have actually gotten it to appear in Thunar when plugged in by using fstab rules,
but in that case Thunar says "mount: only root can mount /dev/sdb1 on /media/WDMyPassport."
I even tried setting /bin/ntfs-3g and /sbin/mount.exfat-fuse SUID,
but I'm not sure I did it properly...
Code:
root@fruitbomb:~# ls -lsh /bin/ntfs-3g
128K -rws--x--x 1 root root 125K Jun 11 2013 /bin/ntfs-3g*
root@fruitbomb:~# ls -lsh /sbin/mount.exfat-fuse
48K -rwsr-xr-x 1 rosario users 45K May 8 18:19 /sbin/mount.exfat-fuse*
If you want a partition to automount, do not expect the desktop environment to do it for you. Put it in your /etc/fstab (file system table) with the correct switches.
Here's an example from the fstab file I'm using on this computer right now. Both these entries point to partitions on an external USB drive; the entries that are remarked out with # are the entries that I replaced when I started using UUIDs:
Sorry, I suppose a more apt title would have been:
"Unable to make Slackware "automount" a particular external hard drive"
Code:
root@fruitbomb:~# mount -t exfat /dev/sdb1 /media/WDMyPassport/
FUSE exfat 0.9.6
root@fruitbomb:~# mount
/dev/mapper/bomfunk-root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
/dev/mapper/bomfunk-home on /home type ext4 (rw)
/dev/sda1 on /boot type ext4 (rw)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sdb1 on /media/WDMyPassport type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
root@fruitbomb:~# blkid
/dev/sda1: UUID="9f4afaa6-d603-4567-81e9-58e1c6687868" TYPE="ext4"
/dev/sda2: UUID="5df43021-bfa7-4c42-a8dc-69280d583948" TYPE="crypto_LUKS"
/dev/mapper/lukssda2: UUID="MjXooJ-Pdos-EZYd-2spf-501s-CBcX-Q3G6Y2" TYPE="LVM2_member"
/dev/mapper/bomfunk-root: UUID="5c3684f2-27e7-487b-8fb5-5c18aca2113d" TYPE="ext4"
/dev/mapper/bomfunk-swap: UUID="a9ba6577-1273-44c8-8810-a230831edc27" TYPE="swap"
/dev/mapper/bomfunk-home: UUID="f5d0bc36-ad67-4db9-b365-d2ebd8faddcc" TYPE="ext4"
I have tried at least a dozen well-crafted fstab entries. None allowed user read/write.
And for some reason, I can't see this bugger's UUID.
root@fruitbomb:~# lsblk -o NAME,KNAME,FSTYPE,UUID,OWNER,GROUP,MODE,RO,RM,MODEL
NAME KNAME FSTYPE UUID OWNER GROUP MODE RO RM MODEL
sda sda root disk brw-rw---- 0 0 FUJITSU MJA2160B
├─sda1 sda1 ext4 9f4afaa6-d603-4567-81e9-58e1c6687868 root disk brw-rw---- 0 0
└─sda2 sda2 crypto_LUKS 5df43021-bfa7-4c42-a8dc-69280d583948 root disk brw-rw---- 0 0
└─lukssda2 (dm-0) dm-0 LVM2_member MjXooJ-Pdos-EZYd-2spf-501s-CBcX-Q3G6Y2 root disk brw-rw---- 0 0
├─bomfunk-root (dm-1)
dm-1 ext4 5c3684f2-27e7-487b-8fb5-5c18aca2113d root disk brw-rw---- 0 0
├─bomfunk-swap (dm-2)
dm-2 swap a9ba6577-1273-44c8-8810-a230831edc27 root disk brw-rw---- 0 0
└─bomfunk-home (dm-3)
dm-3 ext4 f5d0bc36-ad67-4db9-b365-d2ebd8faddcc root disk brw-rw---- 0 0
sdb sdb root disk brw-rw---- 0 0 My Passport 0748
└─sdb1 sdb1 root disk brw-rw---- 0 0
sr0 sr0 root cdrom brw-rw---- 0 1 DVD-RAM UJ-862
root@fruitbomb:~# lsblk -ao NAME,KNAME,FSTYPE,UUID,OWNER,GROUP,MODE,RO,RM,MODEL
NAME KNAME FSTYPE UUID OWNER GROUP MODE RO RM MODEL
sda sda root disk brw-rw---- 0 0 FUJITSU MJA2160B
├─sda1 sda1 ext4 9f4afaa6-d603-4567-81e9-58e1c6687868 root disk brw-rw---- 0 0
└─sda2 sda2 crypto_LUKS 5df43021-bfa7-4c42-a8dc-69280d583948 root disk brw-rw---- 0 0
└─lukssda2 (dm-0) dm-0 LVM2_member MjXooJ-Pdos-EZYd-2spf-501s-CBcX-Q3G6Y2 root disk brw-rw---- 0 0
├─bomfunk-root (dm-1)
dm-1 ext4 5c3684f2-27e7-487b-8fb5-5c18aca2113d root disk brw-rw---- 0 0
├─bomfunk-swap (dm-2)
dm-2 swap a9ba6577-1273-44c8-8810-a230831edc27 root disk brw-rw---- 0 0
└─bomfunk-home (dm-3)
dm-3 ext4 f5d0bc36-ad67-4db9-b365-d2ebd8faddcc root disk brw-rw---- 0 0
sdb sdb root disk brw-rw---- 0 0 My Passport 0748
└─sdb1 sdb1 root disk brw-rw---- 0 0
sr0 sr0 root cdrom brw-rw---- 0 1 DVD-RAM UJ-862
ram0 ram0 root disk brw-rw---- 0 0
ram1 ram1 root disk brw-rw---- 0 0
ram2 ram2 root disk brw-rw---- 0 0
ram3 ram3 root disk brw-rw---- 0 0
ram4 ram4 root disk brw-rw---- 0 0
ram5 ram5 root disk brw-rw---- 0 0
ram6 ram6 root disk brw-rw---- 0 0
ram7 ram7 root disk brw-rw---- 0 0
ram8 ram8 root disk brw-rw---- 0 0
ram9 ram9 root disk brw-rw---- 0 0
loop0 loop0 root disk brw-rw---- 0 0
loop1 loop1 root disk brw-rw---- 0 0
loop2 loop2 root disk brw-rw---- 0 0
loop3 loop3 root disk brw-rw---- 0 0
loop4 loop4 root disk brw-rw---- 0 0
loop5 loop5 root disk brw-rw---- 0 0
loop6 loop6 root disk brw-rw---- 0 0
loop7 loop7 root disk brw-rw---- 0 0
ram10 ram10 root disk brw-rw---- 0 0
ram11 ram11 root disk brw-rw---- 0 0
ram12 ram12 root disk brw-rw---- 0 0
ram13 ram13 root disk brw-rw---- 0 0
ram14 ram14 root disk brw-rw---- 0 0
ram15 ram15 root disk brw-rw---- 0 0
(EDIT: I made a grevious error which is now fixed in the text)
It does not appear to report it's UUID, though it is mounted (by root) and read/write works for user....Maybe I'll have to make her learn some command prompt :cries inside:
Last edited by STDOUBT; 05-15-2014 at 11:07 PM.
Reason: Greivous error in text which is now fixed. Once more...all fixed now I swear to it!
You could put the commands in a shell script, and use a desktop file to run the script.
Something like the following:
mount-ext-drive.sh
Code:
#!/bin/bash
# Script to mount an external drive as root
if [ -e /dev/sdb1 ] && [ -d /media/WDMyPassport ]; then
mount -t exfat /dev/sdb1 /media/WDMyPassport/
else
exit 1
fi
@aaditya,
That is a good thought. Some kind of scripting.
Though I was hoping to make the OS do the work ;-).
FWIW:
Code:
root@fruitbomb:~# file /dev/disk/by-uuid/5c3684f2-27e7-487b-8fb5-5c18aca2113d
/dev/disk/by-uuid/5c3684f2-27e7-487b-8fb5-5c18aca2113d: symbolic link to `../../dm-1'
root@fruitbomb:~# file /dev/disk/by-uuid/5df43021-bfa7-4c42-a8dc-69280d583948
/dev/disk/by-uuid/5df43021-bfa7-4c42-a8dc-69280d583948: symbolic link to `../../sda2'
root@fruitbomb:~# file /dev/disk/by-uuid/9f4afaa6-d603-4567-81e9-58e1c6687868
/dev/disk/by-uuid/9f4afaa6-d603-4567-81e9-58e1c6687868: symbolic link to `../../sda1'
root@fruitbomb:~# file /dev/disk/by-uuid/a9ba6577-1273-44c8-8810-a230831edc27
/dev/disk/by-uuid/a9ba6577-1273-44c8-8810-a230831edc27: symbolic link to `../../dm-2'
root@fruitbomb:~# file /dev/disk/by-uuid/f5d0bc36-ad67-4db9-b365-d2ebd8faddcc
/dev/disk/by-uuid/f5d0bc36-ad67-4db9-b365-d2ebd8faddcc: symbolic link to `../../dm-3'
Ok, when I want to find the UUID of a device / partition, I simply type
Code:
lsblk -f
And another thing, I think Thunar allows auto mounting of removable drives; you can look at Settings -> Removable Drives and see if there's something that could help you.
Edit-
You could also look at Settings -> Session and Startup and see whether Thunar-volman is being auto started or not.
Also you could clear your Xfce session and reboot to see if it makes a difference.
Thunar won't actually mount the drive, but it will show an icon in the panel with all the other partitions that will perform the mount if you click on it. There's an eject button too.
aaditya's suggestion to see if the Thunar-volman is being started is a very good one; that's what provides the icon to click.
@ Richard Cranium
I found that Thunar-volman was not running. I had glanced at the "Session and Startup" and saw
"XFCE Volume Daemon", and by mistake, I thought that was the volume manager for hotplug devices.
I made sure thunar-volman (/usr/bin/thunar-volman) was running, rebooted, then looked at "Session and Startup" again to make sure it was still running. It shows as running in "Session and Startup" (the tick-box is checked), BUT I can't find thunar-volman by running ps.
@frankbell
If I uncomment this line in fstab, the icon appears immediately in Thunar.
Code:
/dev/sdb1 /media/WDMyPassport exfat defaults 0 0
Clicking on said icon results in: "mount: only root can mount /dev/sdb1 on /media/WDMyPassport."
Using the line below results in exactly the same behavior:
Slackware includes udisks2 which should auto-detect and auto-assign a mount point in Thunar. I would check and see if udisks2 is properly working. You should also have fstab's comment on the NTFS-3G partition commented out so udisks2 can work properly with NTFS-3G, udev, and FUSE.
Normally most people recommend a fixed mount point, but you should only do a fixed mount point for local disks, not removable ones.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.