Linux creates a specified file size and implements the conversion from ext2 to ext3

Source: Internet
Author: User
Tags chmod file size mkdir file permissions

Create a ext2 file of the specified size

Generate a 1G space of a specified size using DD

DD If=/dev/zero of=/home/foobar bs=1m count=1000 create 1G size space

Format created space (at this point the file type is ext2)

Mke2fs-vfm0/home/foobar

Create a table of contents

Mkdir/foobar

Mount the generated space to the specified directory

Mount-o loop/home/foobar/foobar/

Set file permissions

chmod 777/foobar

View disk space size and file type

Df-ht/foobar

Implementation of transitions from ext2 to ext3

Uninstall the mounted directory first

Umount/foobar

Converts the ext2 file type to ext3, specifying the file to convert

/sbin/tune2fs-j/home/foobar converts foobar ext2 format to ext3 format

Mount the generated space to the specified directory

Mount-o loop-text3/home/foobar/foobar/

View disk space size and file type

Df-ht/foobar

Create a ext3 file of the specified size

DD If=/dev/zero Of=/home/foobar bs=1m count=1000

Mkfs.ext3-vfm0/home/foobar

Mkdir/foobar

Mount-o loop/home/foobar/foobar/

chmod 777/foobar

Df-ht/foobar

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/

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.