Linux create a new partition & view the file system type of each partition

1. New partition

     Switch to root account

1.1 [fdisk -l] The largest partition is /dev/sda3, indicating that the newly created partition will be sda4

1.2 Enter [fdisk /dev/sda]

1.2.1 Enter [m] at the command line prompt

1.2.2 Enter the command [n] to add a new partition.

1.2.3 Enter the command [p] to create the primary partition.

1.2.4 Enter [Enter] and select the default size, so as not to waste space

1.2.5 Enter [Enter], and select the default start cylinder.

1.2.6 Enter [w], keep the modification

1.3 Enter [reboot] to restart linux, you must reboot, otherwise /dev/sda4 cannot be formatted.

1.4 At this time, in the /dev/ directory, you can see a new partition such as /dev/sda4

1.5 [mkfs.ext4 /dev/sda4] Format

1.6 Create the disk4 directory in the root directory

1.7 [mount /dev/sda4 /disk4/] Mount the partition to /disk4/

1.8 Modify the /etc/fstab file in vim, add the line [/dev/sda4 /disk4 ext4 defaults 0 0], and save it to achieve automatic mount at boot.

 

Second, view the partition file system type

   2.1   parted  /dev/sda

   2.2  print  list

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326574223&siteId=291194637