Article Title: Why is the drive in Linux not obedient. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The operating method of the optical drive in Linux is different from that in Windows. This makes it inconvenient for some people who are new to the Linux operating system. I am going to give a more in-depth explanation of this issue, and then I will talk about an error in the creation of the optical drive in the Linux operating system. It helps you improve the control of the optical drive in Linux. I hope you will feel the same after reading this article.
1. The optical drive is automatically mounted after the instance is started.
After installing the Linux operating system, I want to hear the songs on CD and enjoy the joy of success. However, it was found that CD could not run as automatically as Microsoft's operating system after being put into the optical drive. This makes the system administrator very upset. In Linux, the optical drive is not automatically mounted by default. If the system administrator needs to use the optical drive, he needs to first put the CD or DVD disk into the optical drive, and then use the command mount to attach it to the optical drive. After use, the user can press the pop-up key on the optical drive. In this case, you need to use the unmount command after the command line or directly use the eject command to bring up the optical drive. Obviously, this is inconvenient for users who need to frequently use the optical drive. Is there any other convenient solution?
In fact, the system administrator can modify the fstab configuration file so that the system will automatically mount the optical drive at startup. In fact, this configuration is very simple. You only need to add a line to the fstab configuration file and use the Mount command to Mount the mounted optical drive. In this case, each time the Linux operating system is started, an optical drive icon is displayed on the desktop. Double-click this icon to open the optical drive and view the content in the optical drive. After use, right-click the icon and select pop-up. The CD is automatically displayed in the Linux operating system. In fact, this pop-up process involves two steps, the operating system will first uninstall the optical drive, and then the disc will pop up. Before you detach the optical drive, you cannot use the pop-up button on the optical drive to bring up the disc. This is different from the Windows operating system. In a Windows operating system, even if the operating system is reading content from the disc, you can press the pop-up button on the optical drive to force the optical drive to pop up. This facilitates user operations, but it will cause great damage to the CD, and also cause the interruption of the operating system to read files. In severe cases, the operating system will also be affected by crashes or blue screens. Therefore, this protection mechanism in Linux is troublesome, but it can protect the security of the CD and operating system files. I recommend such protection measures. Although it may be emphasized to users multiple times during the training that the optical drive should be popped up after the optical drive stops running, most of the staff in urgent need may not. Now, the Linux operating system uses the uninstall method (if the optical drive is in use, you cannot detach the optical drive) to force this protection, then the user can only observe it.
For this reason, the author's comment on the Linux operating system's optical drive processing method is, it is puzzled by the default method of not actively attaching the optical drive (however, you can modify the fstab configuration file to achieve automatic mounting ). However, they are certain about the protective measures for uninstalling the optical drive. This protection can maximize the service life of the disc and ensure the stability of the operating system.
Ii. Device Busy error during mounting.
Sometimes, when mounting the optical drive, the operating system will prompt the device is busy with an error message (device is busy ). However, the user does not use the optical drive. Why does the operating system prompt this error message? What should we do? The simplest method is to restart the operating system and mount the optical drive normally. However, if the problem is serious, the problem cannot be solved after the restart. Alternatively, you can re-mount the optical drive only after multiple restarts. However, even if this method is used to solve the Mounting Error of the optical drive, it is very troublesome to handle it. If you need to restart every time you encounter this problem, this will undoubtedly cause a lot of trouble for normal use. If the operating system is a server, several application services are running at the same time. In this case, frequent start of the operating system will obviously have a very negative impact on normal user access. Therefore, restarting the operating system is not the best solution to this problem. To solve this problem, we still need to start from the root of the problem. In fact, from the above error message, our system administrator can still get some inspiration. The system prompts that the optical drive cannot be mounted when the device is busy, so users must be using the device. However, this error message is not clear. In fact, this error message may be caused by two reasons. First, the Linux operating system is a multi-user operating system. Although I am not using the optical drive, are other users using the optical drive? Secondly, in the Linxu operating system, the optical drive is managed in the form of files. The optical drive may be mounted to/mnt/cdrom. If a process has been running in a similar directory, such as a soft drive or other partitions, this error will also occur.
Therefore, it is not long as the user does not use this optical drive, it can be mounted and detached normally. You also need to consider the usage of this device or directory by other users. Is there any other solution besides restarting the operating system? Of course, the answer is yes. I will simulate this error in an actual case, and then talk about my solution.
Step 1: A User mounts the CD disk and the optical drive.
First, the author enters as a common user. Then, put a CD into the optical drive. In the command line, use the mount command to mount the optical drive to the operating system. After mounting the optical drive (such as attaching the optical drive to the/mnt/cdrom directory), you can use the cd command to enter the directory, and use ls and other commands to view the file list and other related content in the CD. Then, use the eject command to try to bring up the optical drive for the same user. Everything works normally. Then insert the disc into the drive to be used. Note: The mount command must be available to privileged users.
Step 2: Use another account to log on to the eject operation.
Then I use the terminal to log on as the second user. Then, try to use the eject command in the command line to bring up the optical drive, and the system will prompt the Device Busy error message. Although the first user is not using this optical drive at this time, as long as the first user has not uninstalled the optical drive, the subsequent user will not be able to pop up the optical drive and re-enter the new optical drive.
[1] [2] Next page