External USB drives

Inserting and removing

When an external USB drive is inserted, it is automatically mounted, i.e. it becomes visible in the file manager and it appears as a subdirectory in /media/username/.

https://trisquel.info/files/caja-automount_0.png

Before removing it, click on the red symbol next to it so that Trisquel stops any read or write operation to it.

Avoid mounting at insertion

If you need to insert a USB drive but without mounting automatically (e.g. to examine it with ddrescue after it had problems when previously used):

1. In a terminal, run

$ sudo systemctl stop udisks2.service
2. Insert the device

3. In a terminal, run

$ sudo systemctl start udisks2.service
Stopping the udisks2 service prevents automatically mounting devices but also has side effects (e.g. gnome-disks won't work properly) hence why the above advice is restarting it after the USB drive was inserted.

Always avoid mounting a specific device

To always prevent a specific device from being mounted automatically at insertion, a possibility is to add an entry for it in /etc/fstab with the option "noauto". For example:

UUID=2023-05-03-14-46-00 none mac noauto 0 0

Obtain the UUID of the file system of the device with the blkid command (e.g. if lsblk shows the device as having a partition /dev/sb1, blkid /dev/sdb1 will provide the UUID value to replace 2023-05-03-14-46-00 in the line above).

Unmount a device automaticallly mounted

To unmount a device automatically mounted in order to further use it with command line (e.g. with dd), run

$ udiskctl unmount --block-device /dev/sdxy
Replace sdxy with the corresponding device, e.g. sdc1.

AttachmentSize
caja-automount.png66.65 KB

Revisions

05/03/2023 - 13:30
Avron
01/13/2024 - 16:41
knife