简体   繁体   中英

How to format file system of a specific size in Linux

How to format a file system in Linux. Lets say I have a partition /dev/sda3 which is 3GB of size but in my case I would like to format only 2Gb of space and mount it. So while running mkfs.xfs -size=2g /dev/sda3 I am getting an error. Can someone advise on this ? Thanks.

You have to use resize2fs command for that purpose (To change the size of file system)
1> formate the filesystem
mkfs.xfs .ext3 /path/ or mkfs -t .ext3 /path/
2> then resize ot to size you want
resize2Fs -L 2GB /dev/sda3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM