How can Linux prevent automatic disk naming?

To disable automatic disk naming, you can follow these steps:

  1. Open the terminal and log in to the root account.
  2. Use the command blkid to view the UUID and file system type of the disk.
  3. Find the UUID of the disk that needs to be excluded from automatic naming.
  4. Edit the /etc/fstab file and add a line with a format similar to the following:
UUID=[磁盘的UUID] [挂载点] [文件系统类型] noauto,x-systemd.automount 0 0

Be sure to replace [disk UUID] and [mount point] with the actual values you obtained.

  1. Save and close the /etc/fstab file.
  2. Reload the /etc/fstab file to apply changes:
sudo mount -a

Now the disk will no longer be automatically named, it will only be recognized when mounted manually.

广告
Closing in 10 seconds
bannerAds