1

 1 [root@localhost ~]# lsblk 
 2 NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
 3 sda             8:0    0   40G  0 disk 
 4 ├─sda1          8:1    0  512M  0 part /boot
 5 └─sda2          8:2    0 25.5G  0 part 
 6   ├─rhel-swap 253:0    0  512M  0 lvm  [SWAP]
 7   └─rhel-root 253:1    0   25G  0 lvm  /
 8 sr0            11:0    1  3.6G  0 rom  /mnt/cdrom
 9 [root@localhost ~]# fdisk /dev/sda 
10 Welcome to fdisk (util-linux 2.23.2).
11 Changes will remain in memory only, until you decide to write them.
12 Be careful before using the write command.
13 Command (m for help): p
14 Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
15 Units = sectors of 1 * 512 = 512 bytes
16 Sector size (logical/physical): 512 bytes / 512 bytes
17 I/O size (minimum/optimal): 512 bytes / 512 bytes
18 Disk label type: dos
19 Disk identifier: 0x0009ed86
20    Device Boot      Start         End      Blocks   Id  System
21 /dev/sda1   *        2048     1050623      524288   83  Linux
22 /dev/sda2         1050624    54544383    26746880   8e  Linux LVM
23 Command (m for help): n
24 Partition type:
25    p   primary (2 primary, 0 extended, 2 free)
26    e   extended
27 Select (default p): 
28 Using default response p
29 Partition number (3,4, default 3): 
30 First sector (54544384-83886079, default 54544384): 
31 Using default value 54544384
32 Last sector, +sectors or +size{K,M,G} (54544384-83886079, default 83886079): +5G     
33 Partition 3 of type Linux and of size 5 GiB is set
34 Command (m for help): p
35 Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
36 Units = sectors of 1 * 512 = 512 bytes
37 Sector size (logical/physical): 512 bytes / 512 bytes
38 I/O size (minimum/optimal): 512 bytes / 512 bytes
39 Disk label type: dos
40 Disk identifier: 0x0009ed86
41    Device Boot      Start         End      Blocks   Id  System
42 /dev/sda1   *        2048     1050623      524288   83  Linux
43 /dev/sda2         1050624    54544383    26746880   8e  Linux LVM
44 /dev/sda3        54544384    65030143     5242880   83  Linux
45 Command (m for help): w
46 The partition table has been altered!
47 Calling ioctl() to re-read partition table.
48 WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
49 The kernel still uses the old table. The new table will be used at
50 the next reboot or after you run partprobe(8) or kpartx(8)
51 Syncing disks.
52 [root@localhost ~]# partprobe /dev/sda
53  [root@localhost ~]# lsblk
54  NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
55  sda 8:0 0 40G 0 disk
56  ├─sda1 8:1 0 512M 0 part /boot
57  ├─sda2 8:2 0 25.5G 0 part
58  │ ├─rhel-swap 253:0 0 512M 0 lvm [SWAP]
59  │ └─rhel-root 253:1 0 25G 0 lvm /
60  └─sda3 8:3 0 5G 0 part
61  sr0 11:0 1 3.6G 0 rom /mnt/cdrom

 

posted @ 2021-10-25 14:58  看看python  阅读(18)  评论(0)    收藏  举报