Working with Devices
This section presents commands that work with devices. You’ll learn how to mount and unmount devices and how to format a floppy diskette.
Mounting and Unmounting Drives
You cannot access a hard drive partition, CD-ROM, or floppy diskette until the related device or partition is mounted. Mounting a device checks the status of the device and readies it for access. Linux can be configured to automatically mount a device or partition when it boots; but you must manually mount other devices and partitions.
Tip
If a device uses removable media, the media may not be present when the system boots. If the system is configured to automatically mount such a device and the media is not present, an error occurs. Therefore, devices that use removable media are not generally configured for automatic mounting.
Before you can remove media from a device, you must unmount it. The system also unmounts devices when it shuts down. Mounting and unmounting devices is a privileged operation; generally, only the root user can manually mount and unmount devices.
To mount a device or partition, you use the mount command, which has the following pattern:
mount options device directoryThe mount command provides many options. However, you can generally use the mount command without any options; consult the manual page to learn about the available options.
Tip
The reason you can use the mount
command without options is that the file
/etc/fstab describes your system’s devices and the type ...