Skip to content

fix(usb-drive): broaden mount.sh partition device filter#8127

Merged
eventualbuddha merged 1 commit intomainfrom
brian/mount-to-partition-based-path
Mar 17, 2026
Merged

fix(usb-drive): broaden mount.sh partition device filter#8127
eventualbuddha merged 1 commit intomainfrom
brian/mount-to-partition-based-path

Conversation

@eventualbuddha
Copy link
Copy Markdown
Contributor

Overview

Extracted from #8057
Refs #7897

Look for more kinds of drives than simply those that show up as /dev/sd*. Also changes the mount point to include the partition name so multiple partitions may be mounted simultaneously.

Demo Video or Screenshot

❯ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda      8:0    0    4G  0 disk
└─sda1   8:1    0    4G  0 part
sdb      8:16   0    4G  0 disk
└─sdb1   8:17   0    4G  0 part
sr0     11:0    1 1024M  0 rom
vda    254:0    0  100G  0 disk
├─vda1 254:1    0   99G  0 part /
├─vda2 254:2    0    1K  0 part
└─vda5 254:5    0  975M  0 part [SWAP]

❯ sudo ./scripts/mount.sh /dev/sda1

❯ sudo ./scripts/mount.sh /dev/sdb1

❯ mount | rg /dev/sd
/dev/sda1 on /media/vx/usb-drive-sda1 type vfat (rw,nosuid,nodev,noexec,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
/dev/sdb1 on /media/vx/usb-drive-sdb1 type vfat (rw,nosuid,nodev,noexec,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)

❯ ./bin/usb-drive watch
{"status":"mounted","mountPoint":"/media/vx/usb-drive-sda1"}

Since libs/usb-drive doesn't support multiple drives yet, only the first one is reported as expected.

Testing Plan

Tested manually as shown above.

Look for more kinds of drives than simply those that show up as
/dev/sd*. Also changes the mount point to include the partition name so
multiple partitions may be mounted simultaneously.
@eventualbuddha eventualbuddha merged commit 0d16fc7 into main Mar 17, 2026
59 checks passed
@eventualbuddha eventualbuddha deleted the brian/mount-to-partition-based-path branch March 17, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants