pvresize(축소)를 해서 약 48GB의 여유 공간을 확보했습니다 /dev/sda2
... 그리고 그 여유 공간에 파티션을 만들고 싶습니다.그런데 /dev/sda3
장치가 생성되지 않습니다..왜죠?다시 시작해야 합니까? (PV감소 후 재시동 불가...)
[root@SERVER ~]# parted -s /dev/sda print free
Model: ATA Hitachi HTS72503 (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Number Start End Size Type File system Flags
32,3kB 1049kB 1016kB Free Space
1 1049kB 538MB 537MB primary ext4 boot
2 538MB 272GB 271GB primary lvm
272GB 320GB 48,3GB Free Space
[root@SERVER ~]#
[root@SERVER ~]#
[root@SERVER ~]# parted /dev/sda print
Model: ATA Hitachi HTS72503 (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 538MB 537MB primary ext4 boot
2 538MB 272GB 271GB primary lvm
[root@SERVER ~]#
[root@SERVER ~]#
[root@SERVER ~]# parted /dev/sda mkpart primary 272GB 320GB
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Az eszköz vagy erőforrás foglalt). As a result, it may not reflect all of
your changes until after reboot.
[root@SERVER ~]#
[root@SERVER ~]#
[root@SERVER ~]#
[root@SERVER ~]# parted /dev/sda print
Model: ATA Hitachi HTS72503 (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 538MB 537MB primary ext4 boot
2 538MB 272GB 271GB primary lvm
3 272GB 320GB 48,3GB primary
[root@SERVER ~]#
[root@SERVER ~]# parted -s /dev/sda print free
Model: ATA Hitachi HTS72503 (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Number Start End Size Type File system Flags
32,3kB 1049kB 1016kB Free Space
1 1049kB 538MB 537MB primary ext4 boot
2 538MB 272GB 271GB primary lvm
3 272GB 320GB 48,3GB primary
320GB 320GB 352kB Free Space
[root@SERVER ~]#
[root@SERVER ~]#
[root@SERVER ~]#
[root@SERVER ~]# env LC_MESSAGES=EN ls -la /dev/sda*
brw-rw----. 1 root disk 8, 0 Jun 29 18:53 /dev/sda
brw-rw----. 1 root disk 8, 1 Jun 28 12:56 /dev/sda1
brw-rw----. 1 root disk 8, 2 Jun 28 12:56 /dev/sda2
[root@SERVER ~]#
[root@SERVER ~]#
[root@SERVER ~]#
[root@SERVER ~]# partprobe
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Az eszköz vagy erőforrás foglalt). As a result, it may not reflect all of your changes until after reboot.
[root@SERVER ~]#
[root@SERVER ~]#
[root@SERVER ~]# env LC_MESSAGES=EN ls -la /dev/sda*
brw-rw----. 1 root disk 8, 0 Jun 29 18:55 /dev/sda
brw-rw----. 1 root disk 8, 1 Jun 28 12:56 /dev/sda1
brw-rw----. 1 root disk 8, 2 Jun 28 12:56 /dev/sda2
[root@SERVER ~]#
[root@SERVER ~]# env LC_MESSAGES=EN fdisk -l
Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0007e24d
Device Boot Start End Blocks Id System
/dev/sda1 * 1 66 524288 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 66 33039 264859648 8e Linux LVM
/dev/sda3 33039 38914 47185920 83 Linux
[root@SERVER ~]# head -1 /etc/issue
Scientific Linux release 6.4 (Carbon)
[root@SERVER ~]#
고쳐 쓰다:
[root@SERVER ~]# kpartx -av /dev/sda
device-mapper: reload ioctl on sda1 failed: Invalid argument
create/reload failed on sda1
add map sda1 (0:0): 0 1048576 linear /dev/sda 2048
device-mapper: reload ioctl on sda2 failed: Invalid argument
create/reload failed on sda2
add map sda2 (0:0): 0 529719296 linear /dev/sda 1050624
device-mapper: reload ioctl on sda3 failed: Invalid argument
create/reload failed on sda3
add map sda3 (0:0): 0 94371840 linear /dev/sda 530769920
[root@SERVER ~]#
[root@SERVER ~]# env LC_MESSAGES=EN ls -la /dev/sda*
brw-rw----. 1 root disk 8, 0 Jun 29 22:05 /dev/sda
brw-rw----. 1 root disk 8, 1 Jun 28 12:56 /dev/sda1
brw-rw----. 1 root disk 8, 2 Jun 28 12:56 /dev/sda2
[root@SERVER ~]#
[root@SERVER ~]#
[root@SERVER ~]#
[root@SERVER ~]# sh rescan-scsi-bus.sh
WARN: /usr/bin/sg_inq not present -- please install sg3_utils
or rescan-scsi-bus.sh might not fully work.
Host adapter 0 (ata_piix) found.
Host adapter 1 (ata_piix) found.
Host adapter 2 (ahci) found.
Host adapter 3 (ahci) found.
Host adapter 4 (ahci) found.
Scanning SCSI subsystem for new devices
Scanning host 0 for SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
Scanning for device 0 0 0 0 ...
OLD: Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: MATSHITA Model: DVD/CDRW UJDA775 Rev: CB03
Type: CD-ROM ANSI SCSI revision: 05
Scanning host 1 for SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
Scanning host 2 for SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
Scanning for device 2 0 0 0 ...
OLD: Host: scsi2 Channel: 00 Id: 00 Lun: 00
Vendor: ATA Model: Hitachi HTS72503 Rev: GHBO
Type: Direct-Access ANSI SCSI revision: 05
Scanning host 3 for SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
Scanning host 4 for SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
0 new device(s) found.
0 device(s) removed.
[root@SERVER ~]#
[root@SERVER ~]#
[root@SERVER ~]# env LC_MESSAGES=EN ls -la /dev/sda*
brw-rw----. 1 root disk 8, 0 Jun 29 22:05 /dev/sda
brw-rw----. 1 root disk 8, 1 Jun 28 12:56 /dev/sda1
brw-rw----. 1 root disk 8, 2 Jun 28 12:56 /dev/sda2
[root@SERVER ~]#
답변1
다시 시작할 필요 없이 직접 실행하세요.파텍스( kpartx /dev/sda
) sda 파티션 테이블을 다시 스캔합니다.
답변2
parted
커널이 최신 BLKPG ioctl 대신 파티션 테이블을 다시 로드할 수 있도록 여전히 BLKRRPART ioctl을 사용하는 이전 버전을 실행하고 있습니다 . BLKRRPART는 사용 중인 파티션이 없는 디스크에서만 작동하므로 커널에 변경 사항을 알리고 재부팅을 권장하는 오류가 나타납니다.
최신 버전의 parted로 업데이트하면 이 오류가 발생하지 않습니다. 메시지에 표시된 대로 재부팅하면 변경 사항이 적용됩니다. 시스템에 있는 util-linux 패키지의 이전 버전에 따라 partx -a
또는 최신 버전을 사용하여 partx -u
재부팅하지 않고도 새 파티션을 추가 할 수 있습니다 .