-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Are you sure you want to erase 'Mass Storage Device'? #439
Comments
Problem is that as which /dev/sdX device drives appear is not guaranteed to be fixed on Linux. |
Should I have used 'sd*' in my description? The point is to be more
descriptive _without_ naming an exact device (which of course could be
wrong). I thought a capital X, shown -to- the user would convey this. Do
you disagree?
…--
A democracy functions on trust. Without that, things easily descend into
chaos and anarchy.
On Fri, Jun 3, 2022, 4:05 AM maxnet ***@***.***> wrote:
"/dev/sdX" would be a much more welcome description.
Problem is that as which /dev/sdX device drives appear is not guaranteed
to be fixed on Linux.
Your USB drive may be /dev/sdb today and /dev/sdc tomorrow.
—
Reply to this email directly, view it on GitHub
<#439 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFP2MS5EGUE5J2FN77B33VNHDHJANCNFSM5V4DQMYQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
IMHO many users would get confused by "/dev/sdX" (or "/dev/sd*"), and not realise that the "X" designates a placeholder? 🤷 Also, on a system with multiple USB drives connected, "/dev/sdX" doesn't really help identify which drive Imager is going to overwrite? IIRC the "Mass Storage Device" string comes from the USB descriptor for your particular card-reader, so on some systems it might say something like "Internal SD card reader" or "Sandisk USB3.0 SD" instead of "Mass Storage Device"? |
😬 Well, first I have to apologize for a hot take made without
sufficiently remembering the issue context ...
Instead allow me to continue to opine that "Mass Storage Device" is
sufficiently vague as to be more than just confusing - it undermines user
confidence in the application. Several users will have multiple Mass
Storage Devices, so warning that some "random" one of those is about to be
destroyed is not at all comforting. Indeed a warning such as this MUST
_uniquely_ identify the device about to be wiped in a way the user can
recognize. Else the warning is meaningless... (but yes there MUST be a
warning!)
…On Sat, Jun 4, 2022, 2:43 AM Andrew Scheller ***@***.***> wrote:
IMHO many users would get confused by "/dev/sdX" (or "/dev/sd*"), and not
realise that the "X" designates a placeholder? 🤷 Also, on a system with
multiple USB drives connected, "/dev/sdX" doesn't really help identify
*which* drive Imager is going to overwrite?
(Oh - were you thinking that the "sd" in "/dev/sdX" stands for "SD card"?
It doesn't, it stands for "SCSI Device", and in the Linux-world all
internal SATA HDDs and all USB flash drives / USB card-readers / USB HDDs
appear as "/dev/sdX")
IIRC the "Mass Storage Device" string comes from the USB descriptor for
your particular card-reader, so on some systems it *might* say something
like "Internal SD card reader" or "Sandisk USB3.0 SD" instead of "Mass
Storage Device"?
—
Reply to this email directly, view it on GitHub
<#439 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFP2MYHNFGAG6RTNPABQLVNMCKVANCNFSM5V4DQMYQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Do you have any clever suggestions for how RPi Imager might uniquely do that? Some USB SD card-readers (particularly the cheaper ones) just identify themselves as a "USB Mass Storage Device" without any additional information; so if you have a "generic" 16GB USB Flash drive and a 16GB SD-card in a "generic" USB card-reader plugged in at the same time, there's no way for the Linux kernel (or RPi Imager) to tell them apart - it just sees them as two USB-attached block devices. |
(unplug everything ...)
😅 I have almost a dozen in my system, most which are mounted with cwds on
them ... yeah that won't happen.
But just reporting the size of the device would give some confidence it is
the correct one. Might even be able to match the size against a parse of
`dmesg | tail -n 40` or so to capture device insertion details. I'll bet a
mfg name shows up there ...
…On Sun, Jun 5, 2022, 3:16 AM Andrew Scheller ***@***.***> wrote:
Indeed a warning such as this MUST *uniquely* identify the device about
to be wiped in a way the user can recognize.
Do you have any clever suggestions for how RPi Imager might uniquely do
that? Some USB SD card-readers (particularly the cheaper ones) just
identify themselves as a "USB Mass Storage Device" without any additional
information; so if you have a "generic" 16GB USB Flash drive and a 16GB
SD-card in a "generic" USB card-reader plugged in at the same time, there's
no way for the Linux kernel (or RPi Imager) to tell them apart - it just
sees them as two USB-attached block devices.
If you're worried that you can't tell which device is which, I guess the
only reliable way to be sure is to unplug everything *except* for your
USB card-reader. 😕
—
Reply to this email directly, view it on GitHub
<#439 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFP2I2XCLOJQEERWGQIYLVNRO5BANCNFSM5V4DQMYQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Imager already shows the manufacturer name if it is there... E.g.:
Then Imager shows it as "Generic STORAGE DEVICE" |
sigh.
rpi-mager did not show anything to ME. That is the case we are dealing
with here.
rpi-mager needs to make more of an effort to help us end users understand
the warning I screenshot'd in my OP.
…On Sun, Jun 5, 2022, 11:32 AM maxnet ***@***.***> wrote:
I'll bet a mfg name shows up there ...
Imager already shows the manufacturer name if it is there...
Problem is SD card reader vendors are not so original with the name.
E.g.:
$ cat /sys/class/block/sdc/device/vendor
Generic
$ cat /sys/class/block/sdc/device/model
STORAGE DEVICE
Then Imager shows it as "Generic STORAGE DEVICE"
—
Reply to this email directly, view it on GitHub
<#439 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFP2OBVD4EMGLK554QNCTVNTJCLANCNFSM5V4DQMYQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I was reading over this and I found a weird approach to this. |
Don't think we have that kind of information (unless Imager is started first, before anything is plugged.) Safest solution is to only run Imager on the Pi itself. The netinstall thing. |
Surely this is the safest solution, but rpi-imager is just a whole lot more convenient (thx ^^). I guess you could extract it from the system logs, but that's not a good style, is it? In linux there is an "sd 6:0:0:0: [sdX] Attached SCSI removable disk" event in dmesg/journalctl(idk about openrc logs) I know this could open a whole new can of worms, but what is your opinion about the approach with the timestamp, disregarding the technical difficulties? If you think this is a waste of time, just say it. I don't want to force anything, I just wanted to mention the idea. Edit: Is it maybe event possible to use the file creation time in /dev? |
I can't speak for Linux, but on macOS I know it is possible to get the icon associated with a drive, I have seen more than one program use it. There is a StackOverflow article on the subject. I recently blew away an SSD with important data accidentally using the Pi Imager so this issue is pretty close to my heart. The following UI changes would have certainly prevented me from making the mistake (which I admit was ultimately my own responsibility). |
Linux does also display an SD-card icon for some drives, but it can only do this when the USB device reports itself as a SD-card-reader. As mentioned above, many of the cheaper USB card-readers just report themselves to the OS as a "generic USB Storage Device"; so there's no way of reliably telling whether a drive is an SD-card, a USB flash drive, or a USB HDD or SSD. I don't work on RPi-Imager myself, but many years ago I worked on Etcher, and that also had many similar "complaints" to this one. |
This doesn't have to have complete reliability everywhere. For it to work with repeatable results on the same machine would, I think, be adequate. Also note, I think the big bold 2 TB on the right, not inline with the name of the drive, would alone have been enough. |
On linux the following bash script seems helpful:
#!/bin/bash
for drv in /sys/devices/pci*/*/*/usb*/*/*/*/*/*/block/*
do
echo $(basename $drv) $(cat $drv/device/vendor) $(cat $drv/size)
done
…On Fri, Dec 30, 2022 at 10:15 AM Adam Leggett ***@***.***> wrote:
This doesn't have to have complete reliability everywhere. For it to work
with repeatable results on the same machine would, I think, be adequate.
—
Reply to this email directly, view it on GitHub
<#439 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFP2IC2Q5BTJVZZSO5YZTWP4DBXANCNFSM5V4DQMYQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
How about the approach with plugin timestamps? Those would let you differentiate them? |
I don't mean to sound rude, but if people don't spot the difference between "2000.4 GB" and "15.6 GB", then I'm not sure if they'd spot the difference between "inserted 3 hours ago" and "inserted 4 minutes ago" ? 🤷 |
Layout can have an enormous impact on what people read and understand when they look at a UI. Mixing "2000.4 GB" in with the name of the device caused me to skim over it, combined with the device name it just looked like a block of text, which I ignored because there was one item in the list (the SD card wasn't showing up for whatever reason) and I was used to there being one item in the list. Whether that could be considered lazy or not, it is how people operate. It's possible people would similarly skim over "inserted 4 minutes ago", but if one or both (2 TB or 2.0 TB is preferable to 2000.4 GB) is aligned to the right and/or in a different weight, size or color than the name of the device, it is more likely people will notice and process it. At least on a Mac, the icon would make a huge difference because people are used to seeing the icon on the Desktop or in Finder already, and they are familiar with it. Notice that in my "After" screenshot above, a person would notice the difference between the two items even if they were looking at the screen from across a room. Not so with the "Before". |
No worries, i agree☺ I think that the timestamp would often be unique enough. E.g: I often buy those packs of three SanDisk 16 GB USBs and have one always plugged in to live-Boot other Linux distros. Of course I do not want to force anything, and I dont expect you to implement it. I just want your feedback, if I should start to put the work in it myself over on the disklist repo. Sorry if I am annoying |
Haha 😆
Not at all, it's always useful to get different points of view 🙂 But I won't comment on any of your other points as I don't work on RPi Imager myself. |
The imager seems to be using version 8.0.9 with a few tweaks, but https://github.com/balena-io-modules/drivelist is at version v11.1.0. |
No C code was updated in the newer upstream drivelist version, and we are not using the node.js bits that did had an update. And the way they are handling some things in the newer upstream drivelist in node.js code did NOT work properly on Mac OS X for me. That's why I solved things differently with my "tweak" |
I opened a PR on balena-io-modules/drivelist#421, which adds a field called I already have a fork of rpi-imager that also contains a linux C++ implementation. It just displays the timestamp right after the device's name. On Linux my Multi-Card reader that keep the empty device entries are not a problem because (I guess) udev modifies the device, when an SD-Card is plugged in. I could not test the issue you are describing with the USB HUB, because I do not have one at hand. |
The description I see for the target SD device is simply 'Mass Storage Device', which is pretty unnerving. "/dev/sdX" would be a much more welcome description. (this is on Linux, lsblk is being used to find candidates)
The text was updated successfully, but these errors were encountered: