Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

automount sda1

Featured Replies

Good day!
I can not auto-flush.
The directory is created / deleted when installing / removing the flash.
But the mount does not happen - error 1.

 

/var/log/arbian-hardware-monitor.log


Fri Oct 26 19:51:50 UTC 2018 | Orange Pi Lite | 5.65 | armhf | armv7l | 4.14.78-sunxi


To autoload flash:

/etc/udev/rules.d/20-automount_flash.rules


ACTION=="add" KERNEL=="sd[a-z][0-9]"  RUN+="/bin/mkdir -p /media/%k"
ACTION=="add" KERNEL=="sd[a-z][0-9]"  RUN+="/bin/mount    uid=1000      /dev/%k /media/%k"
ACTION=="remove"  KERNEL=="sd[a-z][0-9]"  RUN+="/bin/rmdir /media/%k"

result in:
/var/log/daemon.log

Process '/bin/mount    uid=1000    /dev/sda1 /media/sda1' failed with exit code 1.

---- error!!

sudo mount /media/sda1 /media/sda1        #    ok!!!!!

 

Why error?


Sergey

 

  • Author

Good day, Guidol!
In the examples, uid=1000 is present everywhere (https://habr.com/post/58769/    uid=1000; http://zenux.ru/articles/40/  uid=1000).
I enter under the root. Does not help and UID=0 (if at the entrance uid = 0).
Since it is necessary to do the right thing for a single user with root or without root rights?
Sergey

 

2 hours ago, 1955sergey1955 said:

Since it is necessary to do the right thing for a single user with root or without root rights?

uid=1000 is only for unix-/linux-filesystem like ext4 and not for FAT/VFAT

 

the mount command doesnt work from udev on my test system, but ther is another command: pmount

- pmount - mount removable devices as normal user

 

So install pmount:

apt install pmount

 

and then change your udev-file /etc/udev/rules.d/20-automount_flash.rules:

ACTION=="add" KERNEL=="sd[a-z][0-9]"  RUN+="/bin/mkdir -p /media/%k"
ACTION=="add" KERNEL=="sd[a-z][0-9]"  RUN+="/usr/bin/pmount /dev/%k /media/%k"
ACTION=="remove" KERNEL=="sd[a-z][0-9]"  RUN+="/bin/rmdir /media/%k"

after that reload the udev-rules with:
 

udevadm control --reload-rules

BUT: be aware to securely umount your USB-Device (Stick?) 

  • Author

Good day, Guidol!

Unfortunately the team did not help.
The result is deplorable - the mount does not occur.
In addition, the command rmdir does not work when extracting USB.
Sergey

 

 

19 minutes ago, 1955sergey1955 said:

The result is deplorable - the mount does not occur.
In addition, the command rmdir does not work when extracting USB.

on my NanoPi Neo2 with armbian it did work with pmount.

maybe you add a chmod 777 for the created directory

 

the rmdir and umount only does work if you are not actively in the directory of the device, because when it is in use you cant rmdir/umount

  • Author

Good day, Guidol!

The create directory command mount did not affect the creation / deletion of a directory.

 

ACTION=="add" KERNEL=="sd[a-z][0-9]" RUN+="/bin/mkdir -p /media/%k"

#ACTION=="add" KERNEL=="sd[a-z][0-9]" RUN+="/usr/bin/pmount /dev/%k /media/%k"

ACTION=="remove" KERNEL=="sd[a-z][0-9]" RUN+="/bin/rmdir /media/%k"

Creating a directory always passes.
When you exclude the pmount command, the directory is erased.

 

terminal command:  pmount   /dev/sda1 /media/sda1   - mounting device - ok.

 

Sergey

 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.