Detailed description of Mount commands

Source: Internet
Author: User

Address: http://www.zhiweinet.com/jiaocheng/2009-02/2602.htm

Linux Tutorial: mount command: how to mount an external storage medium in Linux

When using a CD, floppy disk, or USB flash disk in Linux, you must run the mount command first. The mount command will specify these storage media as a directory in the system, and then directly access the corresponding directory to read and write data on the storage media.

1. Attach a cd

The command for attaching a CD is as follows:

# Mount-T is09660/dev/CDROM/mnt/CDROM

This command mounts the disc to the/mnt/CDROM directory, and uses the "ls/mnt/CDROM" command to display the data and files on the disc.

The command for detaching a CD is as follows:

# Umount/mnt/CDROM

2. mount a floppy disk

Run the following command to mount a floppy disk to the/mnt/Floppy directory:

# Mount/dev/fd0/mnt/floppy

The command to detach a floppy disk is as follows:

# Umount/mnt/floppy

3. attaching a USB flash disk is relatively complicated.

First, run the "fdisk-L" command to view the device Number of the plug-in flash memory, which is generally/dev/sda1. Then run the "mkdir/mnt/USB" command to create a directory for mounting the USB disk. Run the following command to mount the fat format USB flash drive:

# Mount-T msdos/dev/sda1/mnt/USB

Run the following command to mount a USB flash drive in FAT32 format:

# Mount-T vfat/dev/sda1/mnt/USB

4. Mount external hard disk partitions

To mount the external hard disk partition (FAT32 format), you also need to use "fdisk-1" to view the device Number of the external hard disk partition, which is assumed to be/dev/hda1. Run the following command to mount the/mnt/vfat Mount directory:

# Mount-T vfat/dev/hda1/mnt/vfat

Note: by default, Linux only allows the root user to execute the mount command. To enable general users to mount the disk or floppy disk automatically when the system starts, modify the/etc/fstab configuration file and add the following content:

Label = // ext3 defaults 11/dev/CDROM/mnt/CDROM iso9660 auto, owner, kudzu, Ro, user 00/dev/fdo/mnt/Floppy auto, owner, kudzu, Ro, user 00

"User" indicates that the mount command is assigned to a general user.

The/etc/fstab file is detailed in the Linux help manual. You may wish to take a look.

End

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.