Disk management, mounting a disk, attaching a disk image file, mounting a USB flash drive, umount command, dd

Source: Internet
Author: User

Disk management, mounting a disk, attaching a disk image file, mounting a USB flash drive, umount command, dd

1 mount

Command Format:

Mount [-t vfstype]-o options device dir

Where:

*-T vfstype specifies the type of the file system, which is usually not required. Mount automatically selects the correct type. Regular

Use types:

CD or CD image: iso9660

DOSfat16 File System: msdos

Windows 9x fat32 File System: vfat

WindowsNT ntfs file system: ntfs

MountWindows file network sharing: smbfs

Network Sharing for UNIX (LINUX) files: nfs

*-O options is used to describe the mounting method of a device or file. Common parameters include:

Loop: used to connect a file to the system as a hard disk partition.

Ro: mounting a device in read-only mode

Rw: mounting a device in read/write mode

Iocharset: Specifies the character set used to access the file system

* The device to mount.

* Mount point of the dir device on the system ).

2. Attach a CD image file

Thanks to the huge advances in disk technology in recent years, new computer systems have been configured with large-capacity disk systems. In Windows, many people are used to making software and materials into CD image files and using them through virtual optical drives. doing so has many advantages:

1. Ease the wear and tear of the optical drive;

2. Currently, the hard disk capacity is huge, which is not a problem for storing a disk image file. It is very convenient to call it;

III. the read speed of the hard disk is higher than the read speed of the disc, and the cpu usage is greatly reduced. in fact, it is more convenient to create and use a CD image in a Linux system than in a Windows system. You do not have to borrow any third-party software package.

1. Create an image file from the CD. Put the CD into the optical drive and execute the following command.

# Cp/dev/cdrom/home/sunky/mydisk. iso or

# Ddif =/dev/cdrom of =/home/sunky/mydisk. iso

Note: You can execute any of the above commands to make the current CD in the optical drive into a CD image file/home/sunky/mydisk. iso

2. Make the file and directory into a CD image file and execute the following command.

# Mkisofs-r-J-V mydisk-o/home/sunky/mydisk. iso/home/sunky/mydir

Note: This command will make all the directories and files under the/home/sunky/mydir Directory into a CD image file/home/sunky/mydisk. iso, and the disc volume is marked as mydisk.

3. mount the disk image file)

# Mkdir/mnt/vcdrom

Note: create a directory for mountpoint)

# Mount-o loop-t iso9660/home/sunky/mydisk. iso/mnt/vcdrom

Note: You can use/mnt/vcdrom to access all files in the disk image file mydisk. iso.

2 hanging on USB flash drive

1. Check the name of the storage device

Sudofdisk-l

2. Mount the storage device sdb1 to the mount point/mnt directory

Sudomount/dev/sdb1/mnt

3. Access/mnt

4. Uninstall/mnt

3umount uninstall command

Unmount command: sudoumount mount point

4 dd

Dd: Copy

Example 1: copy a cd (note that your CD is in the ISO format !)

Ddif =/dev/cdrom of = cdrom. iso

Example 2: copy the sfile to the dfile.

$ Dd if = sfile of = dfile

Example 3: Create a m empty file

Ddif =/dev/zero of=hello.txt bs = 100 M count = 1

/Dev/null. The nickname is a bottomless pit. You can output any data to it. It can be used without support!

/Dev/zero is an input device. You can use it to initialize the file. The data read from it is 0.

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.