Command to restrict the folder size in Centos

Source: Internet
Author: User
1. use the dd command to create a M file named vhost01.img: ddif =/dev/zeroibs = 2 Mcount = 50of =/data/htdocs/vhost01.img: if =/dev/zero: indicates that the input file is/dev/zero, a virtual device. as the name suggests, the data in the file is 0ibs = 2 M: indicates that the size of each read block is 2 Mcount = 50: Table

1. use the dd command to create a M file named vhost01.img:
Dd if =/dev/zero ibs = 2 M count = 50 of =/data/htdocs/vhost01.img
Explanation:
If =/dev/zero: indicates that the input file is/dev/zero, a virtual device. as the name suggests, all the data in it is 0.
Ibs = 2 M: indicates that the size of each read block is 2 M.
Count = 50: 50 bytes are read.

Of =/data/htdocs/vhost01.img: output file

2. associate the regular file with the loop device
Losetup/dev/loop0/data/htdocs/vhost01.img

3. create a file system
Mkfs. ext3/dev/loop0

4. file mounting device
Mount-t ext3/dev/loop0/data/htdocs/vhost01

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.