3 steps to make and mount your own Linux hard disk partition

Source: Internet
Author: User

1. Create a large file

# dd If=/dev/zero of =/home/loopdevBS=1m Count=512

If:input file /dev/zero is a device that will always output 0

Of:output file

BS is the size of each block

Count is the total number of BS

Screen output:

512+0 Records in //Read 512 data
512+0 Records out //output 512 pen data
536870912 bytes (537 MB) copied, 6.45734 s, 83.1 MB/s

2. Formatting

# mkfs-t Ext4/home/loopdev

Using the Ext4 File system format

Screen output:

MKE2FS 1.41.12 (17-may-2010)
/home/loopdev is not a block special device.
Proceed anyway? (y,n) y //Because it is not a normal device, so prompt, select Y, press ENTER to continue

Screen output:

Filesystem label=
OS Type:linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
32768 inodes, 131072 blocks
6553 Blocks (5.00%) reserved for the Super user
First Data block=0
Maximum filesystem blocks=134217728
4 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304

Writing Inode Tables:done
Creating Journal (4096 blocks): Done
Writing superblocks and filesystem accounting Information:done

This filesystem'll be automatically checked every mounts or
Whichever comes first. Use Tune2fs-c or-i to override.

3. Mounting

# Mount-o loop/home/loopdev/root/myloopdev/

Attach the file to/root/myloopdev/

view down disk space conditions

# DF

Screen output:

Filesystem 1k-blocks used Available use% mounted on
/DEV/XVDA1 20641404 6202512 13390368 32%/
Tmpfs 960472 0 960472 0%/dev/shm
/home/loopdev 516040 16780 473048 4%/root/myloopdev


3 steps to make and mount your own Linux hard disk partition

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.