器:fdisk ,gparted添加分区,调整分区,,,whatever,,,

1.gparted 先切出未分配空间。

2.fdisk 进行添加分区,设置相应大小

先rreboot,不然会special device /dev/sda7 does not exist

3.mkfs.ext4 格式化

挂载,mount /dev/sdb1 /mnt/tmp 

4.修改/etc/fstab

 

 


 fdisk /dev/sda

Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 4D8563CE-0F81-43AA-8C89-D6D03D895A6D

Device          Start        End    Sectors   Size Type
/dev/sda1        2048    1050623    1048576   512M EFI System
/dev/sda3  1937065984 1953523711   16457728   7.9G Linux swap
/dev/sda4   586989568  684643864   97654297  46.6G Linux filesystem
/dev/sda5   684644352  685230079     585728   286M Linux filesystem
/dev/sda6   685230080 1715746815 1030516736 491.4G Linux filesystem

Partition table entries are not in disk order.

Command (m for help): m



Command (m for help): F
Unpartitioned space /dev/sda: 385 GiB, 413316153344 bytes, 807258112 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

     Start        End   Sectors   Size
      2048       2048         0     0B
   1050624  586989567 585938944 279.4G
1715746816 1937065983 221319168 105.5G

Command (m for help): n
Partition number (2,7-128, default 2): 7
First sector (1050624-1953525134, default 1050624): 
Last sector, +sectors or +size{K,M,G,T,P} (1050624-586989567, default 586989567): 356989567        

Created a new partition 7 of type 'Linux filesystem' and of size 169.7 GiB.

Command (m for help): m








 sudo tail /var/log/messages
 2006  sudo apt-get install -y gparted
 2007  gparted
 2008  sudo gparted
 2009  ls
 2010  sudo fdisk -l
 2011  mkfs.ext4 /dev/sda7

 

你可能感兴趣的:(linux)