raamsri / automount-usb Goto Github PK
View Code? Open in Web Editor NEWAutomount USB drives
License: The Unlicense
Automount USB drives
License: The Unlicense
not a real issue but a littel annoying
if you for ex have a device that gives you the /dev/sda instead of /dev/sda1 it dont get mounted.
like this example
[ 4978.787826] usb-storage 1-1.3:1.0: USB Mass Storage device detected
[ 4978.788197] scsi host2: usb-storage 1-1.3:1.0
[ 4979.805924] scsi 2:0:0:0: Direct-Access Linux File-CD Gadget 0000 PQ: 0 ANSI: 2
[ 4979.807424] sd 2:0:0:0: Attached scsi generic sg6 type 0
[ 4979.809403] sd 2:0:0:0: [sdg] Attached SCSI removable disk
[ 4979.815000] scsi 2:0:0:1: Direct-Access Linux File-CD Gadget 0000 PQ: 0 ANSI: 2
[ 4979.816149] sd 2:0:0:1: Attached scsi generic sg7 type 0
[ 4979.818784] sd 2:0:0:1: [sdh] Attached SCSI removable disk
[ 4990.284873] sd 2:0:0:0: [sdg] 3771392 512-byte logical blocks: (1.93 GB/1.80 GiB)
[ 4990.285424] sd 2:0:0:0: [sdg] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 4990.288976] sdg:
does anyone have a good idea for how to solve this ?
In the docs it states "use libudev".
Do you mean Linux's internal udev system ? or a C library known as libudev ?
How would it be different than what you are doing ? since you are using usb subsystem anyway.
I have tried this approach (with systemd and 99 rues) on raspberry pi and it works perfectly but when USB disk is inserted it hangs during reboot (soft and hard) - any idea why it might be? I spent a lot of time trying to figure it out but no luck.
OS: dietpi v8.12 (which is a debian distro, kernal v 5.15.76), 64bit version on RPi4.
The udev rule for the SD drive is set to sd[a-z]*[0-9]
, but on this system, the USB drive is detected as sda
and therefore doesn't match and the USB mounting doesn't happen.
I haven't gone back to check, but I am 99% sure this was working with the 32bit version of the OS.
Changing the match to sd*
resolved my problem. Note that changing it to sd[a-z]*[0-9]*
did not solve the problem.
First thanks for your great job!
And I got the following problem!
If the partition name have blank space in it like below , the Label can't be get through the script
Number Start End Size File system Name Flags
1 17.4kB 134MB 134MB Microsoft reserved partition msftres
2 135MB 4001GB 4001GB ntfs Basic data partition msftdata
So I change the partition name without blank space and the script worked again !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.