Montare un disco USB automaticamente in Debian: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
| Line 1: | Line 1: | ||
* Lo scopo è montare automaticamente la partizione /dev/sdd1 al collegamento del disco, e smontarla al meglio dopo lo scollegamento. | * Lo scopo è montare automaticamente la partizione /dev/sdd1 al collegamento del disco, e smontarla al meglio dopo lo scollegamento. | ||
=Con usbmount= | |||
sudo apt-get install usbmount | |||
* Verranno montati in /media/usb? | |||
==Riferimenti== | |||
*[http://unix.stackexchange.com/questions/44454/how-to-mount-removable-media-in-media-label-automatically-when-inserted-with linux - How to mount removable media in /media/<LABEL> automatically when inserted, without any desktop environment? - Unix & Linux Stack Exchange] | |||
*[http://unix.stackexchange.com/questions/24731/automounting-usb-sticks-on-debian Automounting USB sticks on Debian - Unix & Linux Stack Exchange] | |||
=Con regola udev= | |||
* Creare la regole udev | * Creare la regole udev | ||
sudoedit /etc/udev/rules.d/80-usb-archive.rules | sudoedit /etc/udev/rules.d/80-usb-archive.rules | ||
Latest revision as of 14:30, 25 September 2014
- Lo scopo è montare automaticamente la partizione /dev/sdd1 al collegamento del disco, e smontarla al meglio dopo lo scollegamento.
Con usbmount
sudo apt-get install usbmount
- Verranno montati in /media/usb?
Riferimenti
- linux - How to mount removable media in /media/<LABEL> automatically when inserted, without any desktop environment? - Unix & Linux Stack Exchange
- Automounting USB sticks on Debian - Unix & Linux Stack Exchange
Con regola udev
- Creare la regole udev
sudoedit /etc/udev/rules.d/80-usb-archive.rules
# Script executed at insertion
KERNEL=="sdd1",ACTION=="add", SUBSYSTEMS=="block", RUN+="mkdir /media/archive; /bin/mount /dev/sdd1 /media/archive", OPTIONS="last_rule"
# This one is used to umount with fuse to be sure
ACTION=="remove", SUBSYSTEMS=="usb", ATTRS{serial}=="575841314138303739363235", RUN+="/bin/umount /media/archive"
# Remove mountpoint to be sure
ACTION=="remove", SUBSYSTEMS=="usb", ATTRS{serial}=="575841314138303739363235", RUN+="/bin/rmdir /media/archive", OPTIONS="last_rule"
- Ricaricare le regole udev:
sudo udevadm control --reload-rules
- Per rimontare il disco senza staccarloW
sudo apt-get install parted sudo partscan