You are not logged in.

#1 2014-09-16 14:36:51

jaro
Member
Registered: 2013-10-10
Posts: 25

[SOLVED] usb mass storage (/dev/sdb) is automatically unmounted

Hi

I've upgraded my system about 2 weeks ago and it looks like my usb stick gets unmounted immediately after manual mount (mount /mnt/sd)
I've got the following entry in /etc/fstab:

/dev/sdb       /mnt/sd         auto    noauto,user,exec        0 0

journalctl -b shows me:

Sep 16 16:23:37 my_host kernel: usb 1-1.3: USB disconnect, device number 10
Sep 16 16:25:31 my_host kernel: usb 1-1.3: new high-speed USB device number 11 using ehci-pci
Sep 16 16:25:31 my_host kernel: usb-storage 1-1.3:1.0: USB Mass Storage device detected
Sep 16 16:25:31 my_host kernel: scsi13 : usb-storage 1-1.3:1.0
Sep 16 16:25:32 my_host kernel: scsi 13:0:0:0: Direct-Access     Kingston DataTraveler 2.0 PMAP PQ: 0 ANSI: 0 CCS
Sep 16 16:25:32 my_host kernel: sd 13:0:0:0: [sdb] 7827456 512-byte logical blocks: (4.00 GB/3.73 GiB)
Sep 16 16:25:32 my_host kernel: sd 13:0:0:0: [sdb] Write Protect is off
Sep 16 16:25:32 my_host kernel: sd 13:0:0:0: [sdb] Mode Sense: 23 00 00 00
Sep 16 16:25:32 my_host kernel: sd 13:0:0:0: [sdb] No Caching mode page found
Sep 16 16:25:32 my_host kernel: sd 13:0:0:0: [sdb] Assuming drive cache: write through
Sep 16 16:25:33 my_host kernel:  sdb: unknown partition table
Sep 16 16:25:33 my_host kernel: sd 13:0:0:0: [sdb] Attached SCSI removable disk
Sep 16 16:25:50 my_host kernel: EXT4-fs (sdb): mounting ext2 file system using the ext4 subsystem
Sep 16 16:25:50 my_host systemd[1]: Unit mnt-sd.mount is bound to inactive service. Stopping, too.
Sep 16 16:25:50 my_host systemd[1]: Unmounting /mnt/sd...
Sep 16 16:25:50 my_host kernel: EXT4-fs (sdb): mounted filesystem without journal. Opts: (null)
Sep 16 16:25:50 my_host systemd[1]: Unmounted /mnt/sd.

How can I turn off auto unmounting of /mnt/sd.
My kernel is 3.16.2-1-ARCH #1 SMP PREEMPT.
My systemd is systemd-sysvcompat 216-3.

thanks for help

Last edited by jaro (2014-09-19 15:27:34)

Offline

#2 2014-09-16 14:44:50

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] usb mass storage (/dev/sdb) is automatically unmounted

Not a solution to your issue (although it will make it go away): fstab should not be used for removable drives. Use something based on udisks or udisks2.

Also, if you insist on using fstab, you have no guarantee that this device will always show up as /dev/sdb. You should be using this.

Last edited by tomk (2014-09-16 14:45:09)

Offline

#3 2014-09-17 14:20:02

jaro
Member
Registered: 2013-10-10
Posts: 25

Re: [SOLVED] usb mass storage (/dev/sdb) is automatically unmounted

Thanks for the reply.
What if I remove any entries related to /dev/sdb from /etc/fstab and I'm absolutely sure that the device is registered in a system as /dev/sdb:
kernel: sd 7:0:0:0: [sdb] 7827456 512-byte logical blocks: (4.00 GB/3.73 GiB)
I mount it as root: mount /dev/sdb /mnt/sd/
and it still is unmounted by systemd:
systemd[1]: Unmounting /mnt/sd

How can I force systemd not to touch /dev/sdb

Offline

#4 2014-09-17 14:57:52

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: [SOLVED] usb mass storage (/dev/sdb) is automatically unmounted

Are you sure there is a partition on the disk?

Because:
Sep 16 16:25:33 my_host kernel:  sdb: unknown partition table

Generally a partition appears as /dev/sdb1 not just /dev/sdb

Offline

#5 2014-09-17 15:13:14

jaro
Member
Registered: 2013-10-10
Posts: 25

Re: [SOLVED] usb mass storage (/dev/sdb) is automatically unmounted

Yes, I'm sure, since I'm able to mount it on my another arch linux which has not been upgraded since about 2 weeks.
Of course this another linux recognizes it as /dev/sdb.
I was even able to mount it on my updated arch linux once (as /dev/sdb) but never again. I think that for some reasons it wan not automaticaly unmounted by systemd. Since then I'm not able to reproduce it.

Offline

#6 2014-09-17 16:27:16

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] usb mass storage (/dev/sdb) is automatically unmounted

 Systemd has a parser for fstab called systemd-fstab-generator. It probably created a mount unit, something that should be called "mnt-sd.mount". Check its status:

systemctl status mnt-sd.mount
man systemd-fstab-generator

Offline

#7 2014-09-18 11:19:13

jaro
Member
Registered: 2013-10-10
Posts: 25

Re: [SOLVED] usb mass storage (/dev/sdb) is automatically unmounted

My problem was that after modifying /etc/fstab I most probably did not restart some services.
After removing all removable media from /etc/fstab and restarting entire machine all works as expected.
It is I'm able to manually mount all the removable media.
I set this thread as resolved but I'm still curious why it requires restarting the machine or in other words what service needs to be restarted.
The systemctl status mnt-sd.mount was inactive. After cleaning /etc/fstab it even does not exist.

thanks for help

Offline

#8 2014-09-18 12:22:49

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] usb mass storage (/dev/sdb) is automatically unmounted

 Trace back systemd services from the generator I mentioned. Since you already edited OP, why leave the logs outside [⁣code][⁣/code] tags?

Offline

#9 2014-09-18 14:51:18

jaro
Member
Registered: 2013-10-10
Posts: 25

Re: [SOLVED] usb mass storage (/dev/sdb) is automatically unmounted

Please be more verbose about OP and tags ???

Last edited by jaro (2014-09-18 14:51:51)

Offline

#10 2014-09-18 14:55:07

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] usb mass storage (/dev/sdb) is automatically unmounted

 In your Opening Post you pasted outputs of several commands, wrap them around in code tags [⁣code]output[⁣/code], so they look like this:

output

Offline

#11 2015-03-28 11:27:42

musv
Member
Registered: 2014-06-16
Posts: 13

Re: [SOLVED] usb mass storage (/dev/sdb) is automatically unmounted

A forum is a nice thing. I stumbled into a similar problem.

I have downloaded an iso file and want to mount that thing. But the f***cking Lenna Ware Systemd thing doesn't let me mount my iso file.

Mär 28 12:22:30 hexe kernel: ISO 9660 Extensions: Microsoft Joliet Level 3
Mär 28 12:22:30 hexe kernel: ISO 9660 Extensions: RRIP_1991A
Mär 28 12:22:30 hexe systemd[613]: Unit mnt-iso.mount is bound to inactive unit. Stopping, too.
Mär 28 12:22:30 hexe systemd[1]: Unit mnt-iso.mount is bound to inactive unit. Stopping, too.
Mär 28 12:22:30 hexe systemd[613]: Unmounting /mnt/iso...
Mär 28 12:22:30 hexe systemd[1]: Unmounting /mnt/iso...

So it's nice, that this thread has been marked as solved, but where is the solution described?

Offline

#12 2015-03-28 22:12:21

mhogomchungu
Member
Registered: 2013-03-29
Posts: 87

Re: [SOLVED] usb mass storage (/dev/sdb) is automatically unmounted

musv wrote:

A forum is a nice thing. I stumbled into a similar problem.

So it's nice, that this thread has been marked as solved, but where is the solution described?

The solution is to remove any references of your image file in "/etc/fstab" and then restart your computer.

The solution was mentioned here:

jaro wrote:

[...]
After removing all removable media from /etc/fstab and restarting entire machine all works as expected.
[...]

Offline

#13 2015-03-31 15:46:12

musv
Member
Registered: 2014-06-16
Posts: 13

Re: [SOLVED] usb mass storage (/dev/sdb) is automatically unmounted

Didn't work. Both the iso file and the mount location /mnt/iso were not in my fstab.

A downgrade to systemd-218 was the solution

Offline

#14 2015-05-06 17:21:37

nrdhm
Member
Registered: 2015-05-06
Posts: 1

Re: [SOLVED] usb mass storage (/dev/sdb) is automatically unmounted

I faced the same problem, my solution was:

systemctl reset-failed 

Last edited by nrdhm (2015-05-06 17:27:07)

Offline

Board footer

Powered by FluxBB