I have some USB external drives. When running the nautilus (GUI filter app), the disks are listed on the left side of the menu. And when clicking the disk name, it is mounted.
However, how to list up and mount USB external disks as commands as CLI, without using the nautilus GUI?
One possible way is to use ls /dev before and after plugging in the usb device. The difference will be the new device connected. (dmesg should also show the new connection.)
I think that udev automatically mounts it and with fedora it seems to mount at /run/media/username/device. You can see if it is mounted with the mount command.
You could also make an entry in /etc/fstab for each device (using UUID) and specify where it should be mounted then udev will use that location instead.
The man mount command gives a lot of info about how to mount devices, but you still need to know the name of the device to mount. An example mount command that would work is sudo mount /dev/device /mnt which would mount the named device at /mnt for access. If the ls /dev command showed me that the new device was /dev/sda and it had a partition /dev/sda1 then I would use the partition name (sda1) in place of âdeviceâ in the mount command above.
I was able to list up and mount the USB external drive with the commands.
I was able to list up USB external devices including the not-mounted ones. I am masking the UUID as âXXXX-XXXXâ. So far the lsblk + options are the best to print what I want to see. However, I am still looking for how to print âUSB volume labelâ that is printed in the left menu of the ânautilusâ filter. The âLABELâ is not the USB driveâs name. Do you know how to print the label name from the lsblk?