Other cannot obtain lock on media/.hal-mtab

Hello,

I installed the Mate desktop on my Freebsd box. As I also work with Linux and Windows systems and also have e-sata devices to read/write external Hard Disks from/for those systems, I have set up my system to be able to mount external Hard Disks with ext4, ntfs, fat etc. according to this FreeBSD manual https://www.freebsd.org/doc/handbook/usb-disks.html.
Also fusefs is installed and enabled in /boot/loader.conf

However, despite the fact that external discs are recognized by my system and shown in the Caja file manager, I can not mount the disks because of the following error message:
Code:
cannot obtain lock on media/.hal-mtab
Somebody here who knows a solution for this?
 
What file system is media/.hal-mtab on? What type of file system is that?
Do you know exactly which program generates that error message?
Can you use truss to see which system call causes that error message?

Here is my suspicion: Not all file systems support all file locking operations; in particular not when cross-mounting file systems that are native to other OSes, or when mounting through fuse. Your problem would be easier to debug if we knew exactly what that program that prints this error message is trying to do, and to which file system.
 
What file system is media/.hal-mtab on? What type of file system is that?
Do you know exactly which program generates that error message?
Can you use truss to see which system call causes that error message?

Here is my suspicion: Not all file systems support all file locking operations; in particular not when cross-mounting file systems that are native to other OSes, or when mounting through fuse. Your problem would be easier to debug if we knew exactly what that program that prints this error message is trying to do, and to which file system.

Thank you very much for your response.

I would love to give you more information about this subject, but at the moment I am doing a complete new setup of my system so I can't replicate the problem right now. But I expect to be able to give you an answer in a few days.

What I can tell you right now is that the filesystem I try to mount to is the ZFS root pool. And I try to mount an ext4 formatted disk from which I need to transfer several TB to my FreeBSD ZFS system. And in order to find a solution I also tried to mount with ext2 and ext3 on another (empty) disk.

I followed exactly these instructions https://www.freebsd.org/doc/handbook/usb-disks.html and my system (by default?) recognizes, mounts and reads my 32GB fat32 usb stick without a problem on
Code:
/media/disk
However a 1 TB external USB hard disk formatted as fat32 would not mount because of:
Code:
mount_msdosfs: /dev/sda6s1: Disk too big, try '-o large' mount option: invalid argument.

But when I connected the exact same disk with my e-sata connection it would not mount to
Code:
/media/disk
but to
Code:
/mnt/JohnDoe
but then I could not read the data because of:
Code:
An operation is already pending
I could however enter the disk as root, which I thought I could solve with
Code:
#chown JohnDoe:wheel /mnt/JohnDoe
but whatever I do I can not enter the disk as JohnDoe.

Also the same 1TB disk, but formatted as ext4, could be mounted with ext4fuse, but again; only as root. But when I try to mount with
Code:
mount -t ext2fs /dev/da6s1 /mnt/JohnDoe
I always get
Code:
cannot obtain lock on media/.hal-mtab

It seems having to do with setting the right (user) rights.

Furthermore I have got the impression that this problem also might be related to the autofs problem in this posting https://forums.freebsd.org/threads/60282/
 
Hello,

I installed the Mate desktop on my Freebsd box. As I also work with Linux and Windows systems and also have e-sata devices to read/write external Hard Disks from/for those systems, I have set up my system to be able to mount external Hard Disks with ext4, ntfs, fat etc. according to this FreeBSD manual https://www.freebsd.org/doc/handbook/usb-disks.html.
Also fusefs is installed and enabled in /boot/loader.conf

However, despite the fact that external discs are recognized by my system and shown in the Caja file manager, I can not mount the disks because of the following error message:
Code:
cannot obtain lock on media/.hal-mtab
Somebody here who knows a solution for this?

I am running FreeBSD 11.0 i386 with Xfce and the automounter configured, and am also experiencing this problem.
There appears to be a race condition, as I only get this symptom on ~2/3 of bootups.
I have several UFS volumes that I keep unmounted for backup purposes.
The Fat32 USB drive and internal UFS volumes appear grayed out on the Xfce desktop when the .hal-mtab error manifests.
When these phantom drives are absent after a bootup and startx, the automounter acts correctly.
 
I was having the same problem using Gnome in FreeBSD 11.
My mistake was to have kept the Automounting Removable Media settings (freebsd.org/doc/en_US.ISO8859-1/books/handbook/usb-disks.html) together with the HAL settings (freebsd.org/gnome/docs/halfaq.html#q3)

When you undo the settings for automount, nautilus started to mount the devices correctly.
 
Back
Top