Device, Linux file system, FHS ① Memorandum Creation of partition and file system / maintenance of file system integrity

du command

You can check the occupancy of files and directories with this command. 名称未設定.pngw.png

To create a partition on a new HDD with the parted command, follow the steps below.

    1. Specifying a partition table Use the mklabel subcommand to specify the partition table method. If not specified, it operates as MBR format. The format of the mklabel subcommand is as follows:

(parted) mklabel [partition table]

To explicitly specify the MBR format, specify msdos. (parted) mklabel msdos

  1. Create partition Create a partition with the mkpart subcommand. The format of the mkpart subcommand is as follows.

(parted) mkpart [partition type file system type partition name] start position end position

The partition type can be specified in MBR format, and specifies primary, extended, and logical. To create one 1000MB primary partition to use as an ext4 file system at the beginning, specify as follows. (parted) mkpart primary ext4 1 1000MB

gdisk This is the command that can create, delete, change and display information on a GPT format HDD.

fdisk Command to perform partition operation to MBR format HDD To use the partition created by fdisk, you need to create a file system on the partition. (1) You can create an ext2 / ext3 / ext4 file system with mke2fs. (2) With the mkfs command, you can create by specifying not only ext2 / ext3 / ext4 but also file systems such as reiserfs and xfs with the "-t" option.

mkfs makes ext2 by default.

名称未設定.pngクェ.png

XFS file system

XFS is a journaling file system developed by Silicon Graphics (SGI). → A journaling file system is a type of file system that has a function to prevent damage to the management area by leaving an update history called a journal or log when changing the management area.

fsck and e2fsck

Commands that can system check files and fix problems. The e2fsck command also checks the ext2 / ext3 / ext4 file system 名称未設定.pngっm.png

tune command

command to set parameters for the ext2 / ext3 / ext4 file system. 名称未設定.pngあsd.png

Recommended Posts

Device, Linux file system, FHS ① Memorandum Creation of partition and file system / maintenance of file system integrity
Device and Linux file system
Device, Linux file system, FHS ③ Memorandum (file permission and owner management, hard link and symbolic link creation, system file search, proper file placement)
Efficient use of Linux file system
Ping-t (subject 104) device, Linux file system, FSH
Steps to change partition including Linux system area and boot area
Linux file and directory permissions