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