To automatically mount a USB disk in Debian, you can follow these steps:

  1. Insert the USB disk into the USB port of your computer.
  2. Open a terminal window.
  3. Type the command sudo blkid and press Enter. This command will show you the list of connected devices and their UUIDs.
  4. Identify the UUID of your USB disk.
  5. Type the command sudo nano /etc/fstab and press Enter. This command will open the fstab file in the nano text editor.
  6. Add the following line at the end of the file, replacing UUID with the UUID of your USB disk:

UUID=YOUR-UUID /mnt/usb vfat defaults 0 0

  1. Press Ctrl+X, then Y, and then Enter to save and exit the file.
  2. Type the command sudo mkdir /mnt/usb and press Enter. This command will create a directory where the USB disk will be mounted.
  3. Type the command sudo mount -a and press Enter. This command will mount all the devices listed in the fstab file, including your USB disk.
  4. To verify that the USB disk has been mounted, type the command df -h and press Enter. This command will show you the list of mounted devices and their mount points. Your USB disk should be listed with the mount point /mnt/usb.

From now on, whenever you insert your USB disk into the USB port, it will be automatically mounted in the /mnt/usb directory

How to automatically mount the inserted U disk in debian

原文地址: https://www.cveoy.top/t/topic/cHzl 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录