[英]How to format file system of a specific size in Linux
How to format a file system in Linux. 如何在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.
可以说我有一个/ dev / sda3分区,其大小为3GB,但就我而言,我只想格式化2Gb的空间并挂载它。 So while running mkfs.xfs -size=2g /dev/sda3 I am getting an error.
因此,在运行mkfs.xfs -size = 2g / dev / sda3时出现错误。 Can someone advise on this ?
有人可以建议吗? Thanks.
谢谢。
You have to use resize2fs command for that purpose (To change the size of file system) 为此,您必须使用resize2fs命令(更改文件系统的大小)
1> formate the filesystem 1>建立文件系统
mkfs.xfs .ext3 /path/ or mkfs -t .ext3 /path/ mkfs.xfs .ext3 / path /或mkfs -t .ext3 / path /
2> then resize ot to size you want 2>然后将ot调整为所需大小
resize2Fs -L 2GB /dev/sda3 resize2Fs -L 2GB / dev / sda3
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.