How can Linux prevent automatic disk naming?
To disable automatic disk naming, you can follow these steps:
- Open the terminal and log in to the root account.
- Use the command blkid to view the UUID and file system type of the disk.
- Find the UUID of the disk that needs to be excluded from automatic naming.
- 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.
- Save and close the /etc/fstab file.
- 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.