vermaden / automount

Simple devd(8) based automounter for FreeBSD
66 stars 20 forks source link

Consider adding a trigger to format disks if they cannot be mounted #29

Closed probonopd closed 1 year ago

probonopd commented 3 years ago

Other operating systems ask the user whether the disk should be formatted in case a disk is attached the filesystem of which cannot be understood:

Classic Mac:

image

Windows 10:

image

I would like to implement something like this but for it to work the formatting tool would need to be notified by the automounter that a disk was attached the filesystem of which cannot be understood, and the /dev/... of that disk.

Ideally, the automounter would launch an executable like this:

/usr/local/sbin/formattingtool /dev/da0

with /usr/local/sbin/formattingtool being configurable.

The question is, what to do if the disk contains multiple partitions some of which can and some of which cannot be mounted. (In this case it should probably just report the non-mountable partitions?)

Or is there a better way to achieve this, e.g., using D-Bus? (Which seems complicated overkill to me.)

vermaden commented 1 year ago

Out of scope for automount(8).