Skip to content
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

GNU/Linux: Allow seeing the path of the device when choosing the device to image #304

Closed
brunoais opened this issue Nov 11, 2021 · 15 comments

Comments

@brunoais
Copy link

Problem:
Currently, for an advanced user who knows the device names, it's not straightforward to know which device to choose from the provided list. I end up attaching and removing the SD card a few times to make sure which one listed is the SD card.

Suggestion:
Add the path to the device being chosen to the devices list, so I can confirm the name of the device being written to.
I'm fine even if it requires flipping a configuration option or including a command line argument.

@brunoais brunoais changed the title GNU/Linux: Allow seeing the name of the device when choosing the device to image GNU/Linux: Allow seeing the path of the device when choosing the device to image Nov 11, 2021
@lurch
Copy link
Contributor

lurch commented Nov 11, 2021

Don't the device-names on Linux tend to change though, based on the order you plug in devices? Just speaking as a third-party, I find using the disk-size to be a much more reliable way of telling drives apart, on the occasions when I have multiple drives connected at once. 🤷‍♂️

@brunoais
Copy link
Author

brunoais commented Nov 11, 2021

An SD card will always be an mmcblkX where X is a number.
An IDE drive will always be a hdx where x is a letter
An ATA drive will always be a dx where x is a letter
A SATA drive will always be an sdx where x is a letter
An NVMe drive will always be an nvmex where x is a number

Just by looking at the name, you can already distinguish between what's connected. Ofc if you have multiple SD cards, you may not know the number.
However, if you are trying to flash an SD card and you have other drives attached, the SD card will always be the mmcblkX drive, undoubtedly.

Makes sense?

@lurch
Copy link
Contributor

lurch commented Nov 11, 2021

the SD card will always be the mmcblkX drive

That only works for the built-in SD card slot on a Raspberry Pi, or for the built-in SD card slot on a laptop (that's internally connected via PCIe rather than via USB). In the majority of cases, I suspect that people are using RPi Imager with a USB SD card-reader; and on Linux any drive plugged in via USB (SD card-reader, Flash drive, HDD, SSD, or an internal-card-reader that's connected via USB) always appears as sdx (i.e. the same as SATA drives).

@brunoais
Copy link
Author

That's interesting. I went to try the USB dongle I have (I think that thing is already 10 years old) and it also registers the SD card as mmcblk (I now use the internal reader, though). Maybe it's something with newer dongles?

@lurch
Copy link
Contributor

lurch commented Nov 12, 2021

That's also interesting. In all the years I've been using different USB drives and different USB card-readers on Linux, they've always shown up as /dev/sdx 🤷‍♂️
Anyway, sorry for dragging your original question so OffTopic! 😆

@Managor
Copy link

Managor commented Jul 4, 2023

I have a Thinkpad T410 with an integrated SD card reader. Whenever I plug a SD card in there, it registers as mmcblk0 but rpi-imager is unable to see it. Either fix rpi-imager to be able to detect mmcblk devices or allow us to choose the device path ourselves.

@lurch
Copy link
Contributor

lurch commented Jul 15, 2023

@Managor See #606

@Managor
Copy link

Managor commented Jul 15, 2023

Sort of a duplicate, but I'm happy this gets more attention

@maxnet
Copy link
Collaborator

maxnet commented Jul 17, 2023

Sort of a duplicate, but I'm happy this gets more attention

@Managor
Do you happen to run Arch Linux or a distribution using Arch packages like Manjoro?
As that is what the other two users reporting this issue have in common...

@Managor
Copy link

Managor commented Jul 17, 2023

Yeah, Arch. I doubt that's the cause though.

@maxnet
Copy link
Collaborator

maxnet commented Jul 17, 2023

Yeah, Arch. I doubt that's the cause though.

Do note that one of the other affected users mentioned in #610 that it did work a couple weeks ago...
Our software hasn't changed recently.
So I wouldn't rule out an Arch update to another package (like the Linux kernel, or lsblk which we use to ask if the drive is removable, or systemd/udev) causing a change in behavior...

Care to try if the issue also appears on your hardware, if you boot a live USB image of Fedora or Ubuntu?
(Can just do "sudo yum install -y rpi-imager && rpi-imager" on Fedora or "sudo apt update && sudo apt install rpi-imager && rpi-imager" under Ubuntu in the live environment to run Imager, without having to install the OS to disk).

@Managor
Copy link

Managor commented Jul 19, 2023

Alright. It was the issue.

lsblk -o name,rm,hotplug shows mmcblk0 as hotplugable on Kubuntu 22.04 whereas on Arch it does not.

@MrSmoer
Copy link
Contributor

MrSmoer commented Jul 29, 2023

There was a similar discussion about displaying the device path in #439, I for myself 'd find it most helpful if there was a timestamp (or something like "n seconds ago") when the device got plugged in. This way one wouldn't have to lsblk and it's helpful information for the average user.
I don't know how to keep going on this, because balena did not reply to my pr yet balena-io-modules/drivelist#421

@Managor
Copy link

Managor commented Feb 4, 2024

I believe this might have been fixed on Arch's end. mmcblk0 is now listed as hotplugable with lsblk -o name,rm,hotplug

$ lsblk -o name,rm,hotplug
NAME        RM HOTPLUG
...
mmcblk0      0       1
├─mmcblk0p1  0       1
└─mmcblk0p2  0       1

@tdewey-rpi
Copy link
Collaborator

Rejecting feature request.

As was pointed out earlier in this issue, the name of the created device cannot be relied upon to determine actual form factor for choosing the storage device.

The effective workaround was already captured by the OP - if you cannot distinguish based on the criteria available, hotplugging the device at the "Choose Storage" window should make it obvious.

@tdewey-rpi tdewey-rpi closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2024
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

No branches or pull requests

6 participants