Linux DD Create EXT3 partition

Source: Internet
Author: User

Linux DD Create EXT3 partition

1. Create a 100M fast file using DD.

Command: DD If=/dev/zero of=/tmp/test.ext3 bs=1024 count=512000

Description: DD is a very useful command under Linux/unix, which is to copy a file with a block of the specified size.

Parameter if: input file, of: Output file, bs block size, bs=1024 block size 1024Byte, Count: number of blocks.

File size = 1024Byte * 512000 = 500MB

2. Format the file first as a Btrfs file system type.

Command: MKFS.BTRFS/TMP/TEST.EXT3

Description: Mkfs.btrfs Some systems may not have to be installed, the installation command under Ubuntu is: sudo apt-get install Btrfs-tools

3. Format the block file as the Ext3 file system type.

Command: MKFS.EXT3/TMP/TEST.EXT3

Note: The following warning pops up during the execution of the command, so you can select Yes directly.

/tmp/test.ext3 is not a block special device.
4. Mount.

Command: sudo mkdir/mnt/newext3disk
sudo mount-o loop-t ext3/tmp/test.ext3/mnt/newext3disk/

Description: "sudo mkdir/mnt/newext3disk" is used to create a mount point. The-o parameter in the Mount command is described as follows:

The-O options are primarily used to describe how 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

4. DF command to see.

Command: Df-h

The last line of the output is as follows, indicating that the mount was successful.

/dev/loop1 485M 11M 449M 3%/mnt/newext3disk

Linux DD Create EXT3 partition

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.