The use of the Mount command, as well as tips on how to image files, removable hard disks and USB drives

Source: Internet
Author: User

This article describes the use of the Mount command, as well as tips on how to image files, removable hard disks and USB drives.

One, Mount command (Mount)

How to use the Attach (Mount) command.

Command format:

Copy CodeThe code is as follows:
Mount [-t vfstype] [-O options] Device dir



which
1.-t vfstype Specifies the type of file system that is not normally specified. Mount will automatically select the correct type. Common types are:
Disc or disc Image: iso9660
DOS FAT16 file system: MSDOS
Windows 9x FAT32 file system: VFAT
Windows NT NTFS file system: NTFS
Mount Windows file network share: SMBFS
UNIX (LINUX) file network share: NFS

The 2.-o options are primarily used to describe the way devices or files are hooked up. The commonly used parameters are:
Loop: Used to attach a file as a hard disk partition on the system
RO: Hook device with read-only method
RW: Mount device with read-write mode
Iocharset: Specifies the character set used to access the file system
3.device the device to mount (Mount).
Mount point of the 4.dir device on the system.

Second, attach the disc image file
It is easier to make and use disc mirroring under a Linux system than a Windows system, without having to borrow any third-party packages.

1. Make disc image file from CD-ROM. Put the disc in the CD drive and execute the command below.

Copy CodeThe code is as follows:
#cp/dev/cdrom/home/sunky/mydisk.iso or
#dd If=/dev/cdrom Of=/home/sunky/mydisk.iso

Description
Perform any of the commands above to make a disc image of the disc in the current CD-ROM:/home/sunky/mydisk.iso.

2. Make the files and directories into a disc image file, execute the following command.


Copy CodeThe code is as follows:
#mkisofs-R-j-v Mydisk-o/home/sunky/mydisk.iso/home/sunky/mydir

Description
This command will/home/sunky/mydir all directories and files in the directory, made into a disc image file/home/sunky/mydisk.iso, the disc is labeled as: Mydisk.

3. Mounting of the disc image file (Mount)


Copy CodeThe code is as follows:
#mkdir/mnt/vcdrom

Description: Create a directory to use as a mount point


Copy CodeThe code is as follows:
#mount-O loop-t iso9660/home/sunky/mydisk.iso/mnt/vcdrom

Description: Use the directory/mnt/vcdrom to access all files in the disk image file Mydisk.iso.

Third, mount the removable hard drive

For Linux systems, the USB interface's removable hard disk is treated as a SCSI device.
Before inserting a removable hard disk, you should first use Fdisk–l or more/proc/partitions to view the system's hard disk and hard disk partition.


Copy CodeThe code is as follows:
[Root at Pldyrouter/]# fdisk-l
disk/dev/sda:73 Dot 4 GB, 73407820800 bytes
255 heads, Sectors/track, 8924 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/DEV/SDA1 1 4 32098+ de Dell Utility
/DEV/SDA2 * 5 2554 20482875 7 Hpfs/ntfs
/dev/sda3 2555 7904 42973875-up Linux
/DEV/SDA4 7905 8924 8193150 f Win95 Ext ' d (LBA)
/dev/sda5 7905 8924 8193118+, Linux swap

From the above information, it is known that the system has a SCSI hard disk/DEV/SDA and its four disk partition/DEV/SDA1-/DEV/SDA4,/DEV/SDA5 is partition/DEV/SDA4 logical partition.
After the removable hard drive, then use Fdisk–l or more/proc/partitions to view the system's hard disk and hard disk partition situation


Copy CodeThe code is as follows:
[Root at Pldyrouter/]# fdisk-l
disk/dev/sda:73 Dot 4 GB, 73407820800 bytes
255 heads, Sectors/track, 8924 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/DEV/SDA1 1 4 32098+ de Dell Utility
/DEV/SDA2 * 5 2554 20482875 7 Hpfs/ntfs
/dev/sda3 2555 7904 42973875-up Linux
/DEV/SDA4 7905 8924 8193150 f Win95 Ext ' d (LBA)
/dev/sda5 7905 8924 8193118+, Linux swap
disk/dev/sdc:40.0 GB, 40007761920 bytes
255 heads, Sectors/track, 4864 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/DEV/SDC1 1 510 4096543+ 7 Hpfs/ntfs
/DEV/SDC2 511 4864 34973505 F Win95 Ext ' d (LBA)
/DEV/SDC5 511 4864 34973473+ b Win95 FAT32

From the above information, there is a SCSI hard disk/DEV/SDC and its two disk partition/DEV/SDC1?,/DEV/SDC2, where/DEV/SDC5 is the logical partition of the/DEV/SDC2 partition.

You can use the following command to hook up/DEV/SDC1 and/DEV/SDC5.


Copy CodeThe code is as follows:
#mkdir-P/MNT/USBHD1
#mkdir-P/MNT/USBHD2



Description
Create a directory to use as a mount point


Copy CodeThe code is as follows:
#mount-T NTFS/DEV/SDC1/MNT/USBHD1
#mount-T VFAT/DEV/SDC5/MNT/USBHD2



Description
For NTFS-formatted disk partitions, you should use the-T NTFS parameter, and the-T VFAT parameter should be used for disk partitions in FAT32 format.
If the kanji file name is displayed as garbled or not displayed, you can use the following command format:


Copy CodeThe code is as follows:
#mount-T Ntfs-o iocharset=cp936/dev/sdc1/mnt/usbhd1
#mount-T Vfat-o iocharset=cp936/dev/sdc5/mnt/usbhd2



Using the Fdisk partition command and the Mkfs file system creation command under the Linux system, the partition of the removable hard disk can be made into the ext2, ext3 format peculiar to the Linux system.
This makes it much easier to use it under Linux.

Use the following command to hook up directly:


Copy CodeThe code is as follows:
#mount/DEV/SDC1/MNT/USBHD1

Four, attach USB flash drive

As with the USB interface of a removable hard disk, the USB stick is also treated as a SCSI device for Linux systems.
Use the same method as moving the hard disk. Before inserting a USB flash drive, you should first use Fdisk–l or more/proc/partitions to view the system's hard disk and hard disk partition.


Copy CodeThe code is as follows:
[Root at Pldyrouter root]# fdisk-l
disk/dev/sda:73 Dot 4 GB, 73407820800 bytes
255 heads, Sectors/track, 8924 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/DEV/SDA1 1 4 32098+ de Dell Utility
/DEV/SDA2 * 5 2554 20482875 7 Hpfs/ntfs
/dev/sda3 2555 7904 42973875-up Linux
/DEV/SDA4 7905 8924 8193150 f Win95 Ext ' d (LBA)
/dev/sda5 7905 8924 8193118+, Linux swap

After inserting the USB drive, use Fdisk–l or more/proc/partitions to view the system's hard disk and hard disk partition.


Copy CodeThe code is as follows:
[Root at Pldyrouter root]# fdisk-l
disk/dev/sda:73 Dot 4 GB, 73407820800 bytes
255 heads, Sectors/track, 8924 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/DEV/SDA1 1 4 32098+ de Dell Utility
/DEV/SDA2 * 5 2554 20482875 7 Hpfs/ntfs
/dev/sda3 2555 7904 42973875-up Linux
/DEV/SDA4 7905 8924 8193150 f Win95 Ext ' d (LBA)
/dev/sda5 7905 8924 8193118+, Linux swap
disk/dev/sdd:131 MB, 131072000 bytes
9 Heads, Sectors/track, 888 cylinders
Units = Cylinders of 288 * 147456 bytes
Device Boot Start End Blocks Id System
/DEV/SDD1 * 1 889 127983+ b Win95 FAT32
Partition 1 has different physical/logical endings:
phys= (+, 8, logical=) (888, 7, 31)

The system has a SCSI hard disk/DEV/SDD and a disk partition/dev/sdd1.

/DEV/SDD1 is the USB drive we are going to hook up with, mount it with the following command:


Copy CodeThe code is as follows:
#mkdir-P/MNT/USB



Note: Create a directory to use as a mount point


Copy CodeThe code is as follows:
#mount-T Vfat/dev/sdd1/mnt/usb

Description: You can now access the USB flash drive through/MNT/USB, if the Chinese character file name is displayed as garbled or not displayed, please use the following command to access:


Copy CodeThe code is as follows:
#mount-T Vfat-o iocharset=cp936/dev/sdd1/mnt/usb

Here, the use of Mount command mount in Linux is introduced, it is recommended that friends do more hands-on, their own practice under the above example, to help understand the content.

The use of the Mount command, as well as tips on how to image files, removable hard disks and USB drives

Related Article

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.