l, -license Display licensing informationĭevelopers' email address: support and information: F, -force Force execution despite errors T, -zero-time Fake the time to be 00:00 UTC, Jan 1, 1970 z, -mft-zone-multiplier NUM Set the MFT zone multiplier S, -sectors-per-track NUM Specify the number of sectors per track H, -heads NUM Specify the number of heads p, -partition-start SECTOR Specify the partition start sector s, -sector-size BYTES Specify the sector size for the device c, -cluster-size BYTES Specify the cluster size for the volume I, -no-indexing Disable indexing on the volume C, -enable-compression Enable compression on the volume For example, NTFS flags: # mkfs.ntfs -help V, -version output version information and exitĪs you can see, the -t flag lets us pass filesystem-specific flags. t, -type=TYPE file system type, when undefined ext2 is usedįs-options parameters to real file system builderĭefining -V more than once will cause a dry-run The general syntax for mkfs is: # mkfs -help You'll use the block device corresponding to the partition you want to format, such as /dev/sda2. In fact, it expects block devices, so if I'm going to use a new file /tmp/file for mkfs, I have to force it do so. Now, unfortunately, while parted operates just fine on a file, like the one I used above, mkfs can't go hunting for partitions in such files. On my system for example, mkfs.bfs, mkfs.cramfs, mkfs.ext2, mkfs.ext3, mkfs.ext4, mkfs.ext4dev, mkfs.fat, mkfs.minix, mkfs.msdos, mkfs.ntfs, mkfs.vfat are available. Mkfs, like fsck, is essentially a frontend to various filesystem-specific commands. Indeed, parted will tell you that you should use it for manipulating partitions, not filesystems, which brings me to: While parted can create partitions of filesystem ntfs just fine, it can't format an existing partition (!) to NTFS: mkfs partition fs-type I'll label the partitions: # parted /tmp/part name 1 hello Note how it uses SI prefixes, whereas GParted steadfastly uses binary prefixes (while dropping the silly i). Number Start End Size File system Name Flags Sector size (logical/physical): 512B/512B parted expects locations in MB for mkpartfs, but we can specify the suffix: parted /tmp/part mkpart primary ext4 3G 5GĪnd another, now an NTFS partition of 1GB: parted /tmp/part mkpart primary ntfs 5G 6G Then we make, say, an ext4 partition starting starting at 3GB (i.e., leaving the initial 3G free) and of size 2GB (i.e., ending at 5GB). Or mklabel msdos, if you want the old-school 4-primary-partition thing (called MBR or MSDOS partition table). You should replace that with the device you need ( /dev/sda, for example).įirst, if your disk doesn't have a partition table, we must create one: parted /tmp/part mklabel gpt I'm going to use a temporary file ( /tmp/part) I created to show you the commands, so the sizes will be somewhat small. The commands can be contracted to a unique prefix (e.g., h is short for help). Version display the version number and copyright information of GNU Parted Toggle ] toggle the state of FLAG on partition NUMBER Set NUMBER FLAG STATE change the FLAG on partition NUMBER Resize NUMBER START END resize partition NUMBER and its file system Rescue START END rescue a lost partition near START and END Print display the partition table, available devices, free space, all found partitions, or a particular partition Name NUMBER NAME name partition NUMBER as NAME Move NUMBER START END move partition NUMBER Resizepart NUMBER END resize partition NUMBER Mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system Mkpart PART-TYPE START END make a partition Mkfs NUMBER FS-TYPE make a FS-TYPE file system on partition NUMBER Mklabel,mktable LABEL-TYPE create a new disklabel (partition table) Help print general help, or help on COMMAND It has the following commands: align-check TYPE N check partition N for TYPE(min|opt) alignmentĬheck NUMBER do a simple check on the file systemĬp FROM-NUMBER TO-NUMBER copy file system to another partition Given the choice, parted is the program you should prefer. Parted doesn't need an argument (it tries to "guess"), but you should always specify the disk. It has the following commands: Command action The mkfs commands are not interactive.įdisk expects a device (such as /dev/sda) as an argument. The various mkfs programs, if you already have partitions and wish to format.įdisk and parted are interactive, and have help commands, so you can always look for help within the program.
0 Comments
Leave a Reply. |