WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Automount USB with UDEV rules, Problem [SOLVED WITH RESTRICTIONS]  (Read 35916 times)

Offline mindmachine

  • Newbie
  • *
  • Posts: 45
Re: Automount USB with UDEV rules, Problem
« Reply #15 on: March 02, 2013, 03:04:58 PM »
Yeah, it is. It shows in /mnt as sdb1?? Strange, isn' t it? But , alas, I just notice, that it doesn't show any files. What is going on?
------------------------------------------------------------
mindmachine

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: Automount USB with UDEV rules, Problem
« Reply #16 on: March 02, 2013, 03:08:56 PM »
Hi mindmachine
What you see is the mount point that was created. If it's not listed in mtab, it's not mounted.
Let's see what messages this returns:
Code: [Select]
sudo mount -t auto -o rw /dev/sdb1 /mnt/sdb1

Offline mindmachine

  • Newbie
  • *
  • Posts: 45
Re: Automount USB with UDEV rules, Problem
« Reply #17 on: March 02, 2013, 03:14:06 PM »
Failed, invalid argument...
------------------------------------------------------------
mindmachine

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Automount USB with UDEV rules, Problem
« Reply #18 on: March 02, 2013, 03:15:54 PM »
It's still mounted rwxr-xr-x. :-(.
That is read-write.
However, no direct conclusions can be drawn from file permissions towards mount options.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: Automount USB with UDEV rules, Problem
« Reply #19 on: March 02, 2013, 03:24:53 PM »
Hi mindmachine
How about:
Code: [Select]
sudo mount /dev/sdb1 /mnt/sdb1
cat /etc/mtab | grep sdb1

Offline mindmachine

  • Newbie
  • *
  • Posts: 45
Re: Automount USB with UDEV rules, Problem
« Reply #20 on: March 02, 2013, 03:25:32 PM »
Yeah, but just for root. If I try to hand this over network as a share, you unfortunately don't get write permissions.
------------------------------------------------------------
mindmachine

Offline mindmachine

  • Newbie
  • *
  • Posts: 45
Re: Automount USB with UDEV rules, Problem
« Reply #21 on: March 02, 2013, 03:29:06 PM »
This also gives an invalid argument. I'll stop here for now, as I have to take care for the kids. I'll try again tomorrow or later on. It might be, that the mount point sdb1, as beeing created by udev rules atm is causing trouble. So I will go back to stock version ov the udev rule, create mouhnt point by hand and try to use the recommended arguments.

Thanks for your help by now. It is always a pleasure to find helpful people on the web!
------------------------------------------------------------
mindmachine

Offline mindmachine

  • Newbie
  • *
  • Posts: 45
Re: Automount USB with UDEV rules, Problem
« Reply #22 on: March 03, 2013, 09:44:02 AM »
Did some testing. Mountig by cmd using -t ntfs-3g works well. Mounting with -t auto gives "invalid argument". So I can't use the udev-scripts as I do use ext2, vfat and ntfs sticks. What can be done?
------------------------------------------------------------
mindmachine

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: Automount USB with UDEV rules, Problem
« Reply #23 on: March 03, 2013, 09:58:50 AM »
Hi mindmachine
Does:
Code: [Select]
sudo mount -t ntfs /dev/sdb1 /mnt/sdb1work?

Offline mindmachine

  • Newbie
  • *
  • Posts: 45
Re: Automount USB with UDEV rules, Problem
« Reply #24 on: March 03, 2013, 12:06:39 PM »
It's getting weird. Drive mounts with -t ntfs but now we got dr-x------ as file permissions??!!
------------------------------------------------------------
mindmachine

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: Automount USB with UDEV rules, Problem
« Reply #25 on: March 03, 2013, 12:34:12 PM »
Hi mindmachine
How about just
Code: [Select]
mount /mnt/sdb1

Offline mindmachine

  • Newbie
  • *
  • Posts: 45
Re: Automount USB with UDEV rules, Problem
« Reply #26 on: March 03, 2013, 01:07:29 PM »
That works. Drive is now mounted rw. How to put this in the udev script?
------------------------------------------------------------
mindmachine

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: Automount USB with UDEV rules, Problem
« Reply #27 on: March 03, 2013, 01:14:46 PM »
Hi mindmachine
Try changing
Code: [Select]
mount /dev/$1 /mnt/$1to:
Code: [Select]
mount /mnt/$1Also remember to add:
Code: [Select]
ln /usr/local/sbin/mount.ntfs-3g /usr/local/sbin/mount.ntfsto your  /opt/.filetool.lst  file.
I'll be back later this evening if you need more help.

Offline mindmachine

  • Newbie
  • *
  • Posts: 45
Re: Automount USB with UDEV rules, Problem
« Reply #28 on: March 03, 2013, 01:18:54 PM »
I already tried that, but again the drive is mounted read only by using the script (rtesp. it is not mounted, as there is no entry in mtab). Symlink is also already set and the folders are included for backup. This is really pestering me!!  ;D
Furthermore as there is an entry for sdb1 within fstab but still sdb1 doesn't mount via script. I already tried to increase "sleep" but that didn't do the trick. So my automount script starts obviously, running rebuildfstab, but isn't able to execute the mount /mnt/$1 command.
« Last Edit: March 03, 2013, 02:17:29 PM by mindmachine »
------------------------------------------------------------
mindmachine

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: Automount USB with UDEV rules, Problem
« Reply #29 on: March 03, 2013, 05:23:24 PM »
Hi mindmachine
Quote
Also remember to add:
Code: [Select]
ln /usr/local/sbin/mount.ntfs-3g /usr/local/sbin/mount.ntfsto your  /opt/.filetool.lst  file.
Sorry, I meant to say to add that to your  /opt/bootlocal.sh  file, NOT  /opt/.filetool.lst.