1

[root@localhost ~]# lsblk 
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda             8:0    0   40G  0 disk 
├─sda1          8:1    0  512M  0 part /boot
└─sda2          8:2    0 25.5G  0 part 
  ├─rhel-swap 253:0    0  512M  0 lvm  [SWAP]
  └─rhel-root 253:1    0   25G  0 lvm  /
sr0            11:0    1  3.6G  0 rom  /mnt/cdrom
[root@localhost ~]# fdisk /dev/sda 
Welcome to fdisk (util-linux 2.23.2).
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: 42.9 GB, 42949672960 bytes, 83886080 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
Disk label type: dos
Disk identifier: 0x0009ed86
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1050623      524288   83  Linux
/dev/sda2         1050624    54544383    26746880   8e  Linux LVM
Command (m for help): n
Partition type:
   p   primary (2 primary, 0 extended, 2 free)
   e   extended
Select (default p): 
Using default response p
Partition number (3,4, default 3): 
First sector (54544384-83886079, default 54544384): 
Using default value 54544384
Last sector, +sectors or +size{K,M,G} (54544384-83886079, default 83886079): +5G     
Partition 3 of type Linux and of size 5 GiB is set
Command (m for help): p
Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 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
Disk label type: dos
Disk identifier: 0x0009ed86
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1050623      524288   83  Linux
/dev/sda2         1050624    54544383    26746880   8e  Linux LVM
/dev/sda3        54544384    65030143     5242880   83  Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[root@localhost ~]# partprobe /dev/sda
 [root@localhost ~]# lsblk
 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
 sda 8:0 0 40G 0 disk
 ├─sda1 8:1 0 512M 0 part /boot
 ├─sda2 8:2 0 25.5G 0 part
 │ ├─rhel-swap 253:0 0 512M 0 lvm [SWAP]
 │ └─rhel-root 253:1 0 25G 0 lvm /
 └─sda3 8:3 0 5G 0 part
 sr0 11:0 1 3.6G 0 rom /mnt/cdrom

node1(192.168.22.77)target端( iSCSI服务端)

client1(192.168.22.107)initiator端( iSCSI客户端)

原文地址:https://www.cnblogs.com/kkpython/p/15458679.html