URL복사 |
공유하기 | ||||||
Issue
Environment
Resolution
So in general we would suggest:
If a new partition was added and none of the existing partitions were modified, consider using the For example, a partition #1 is an existing partition and a new partition #2 is already added in
List the partition table of disk:
Read disk and try to add all partitions to the system:
(These last 2 lines are normal in this case because partition 1 is already added in the system before partition 2 is added) Check that we have device nodes for
|
URL복사 |
공유하기 | ||||||
Issue
Environment
Resolution
So in general we would suggest:
If a new partition was added and none of the existing partitions were modified, consider using the For example, a partition #1 is an existing partition and a new partition #2 is already added in
List the partition table of disk:
Read disk and try to add all partitions to the system:
(These last 2 lines are normal in this case because partition 1 is already added in the system before partition 2 is added) Check that we have device nodes for
|
버그가 아니라 데이터의 안정성을 위해서 사용중인(eg,mount) 장치에서는 갱신된 파티션을 커널에 적용되지 않도록 parted 패키지가 변경이 되었다고 합니다. (partprobe는 parted패키지에서 제공하는 유틸)
이유는 RHEL5를 비롯한 이전버전의 parted 패키지에서는 변경된 파티션 정보를 커널에 적용하는 과정에서 오류를 체크하는 부분이 없었기 때문입니다. partprobe가 종종 동작되지 않을 때도, 그 발생한 오류는 사용자에게 보고되지 않기 때문에 사용자는 파티션 작업이 정상적으로 적용되었다고 착각할 수 있지만, 실제 장치에서는 파티션 변경 내용이 적용되지 않아 데이터 입출력 간의 중첩쓰기로 인한 데이터 손실 등이 우려되므로, RHEL6에서는 데이터 안정성을 위해 사용중인 장치의 경우 변경된 파티션 테이블을 갱신하지 못하도록 수정되었습니다.
따라서 partprobe를 이용하여 변경된 파티션 정보를 다시 읽어 커널의 파티션테이블을 갱신하도록 하려면 mount 되어 있는 장치를 모두 umount 한 후 partprobe를 사용하거나 서버를 리부팅하여야 합니다.
하지만 partprobe를 사용하지 않고도 커널의 파티션테이블을 갱신할 수 있는 방법이 있는데,
partx 명령의 기능을 사용하면 사용중인 장치를 umount하거나 리부팅하지 않고도 커널의 파티션테이블을 갱신할 수 있습니다. (partx는 util-linux-ng 패키지에서 제공하는 유틸)
# partx -v -a /dev/sda
Issue
- Added a new partition to a disk that have some existing partitions already mounted. Can the new partition be used without reboot in RHEL6?
Environment
- Red Hat Enterprise Linux (RHEL) 6
Resolution
partprobe
was commonly used in RHEL 5 to inform the OS of partition table changes on the disk. In RHEL 6, it will only trigger the OS to update the partitions on a disk that none of its partitions are in use (e.g. mounted). If any partition on a disk is in use, partprobe
will not trigger the OS to update partitions in the system because it is considered unsafe in some situations.
So in general we would suggest:
- Unmount all the partitions of the disk before modifying the partition table on the disk, and then run
partprobe
to update the partitions in system. - If this is not possible (e.g. the mounted partition is a system partition), reboot the system after modifying the partition table. The partitions information will be re-read after reboot.
If a new partition was added and none of the existing partitions were modified, consider using the partx
command to update the system partition table. Do note that the partx
command does not do much checking between the new and the existing partition table in the system and assumes the user knows what they are are doing. So it can corrupt the data on disk if the existing partitions are modified or the partition table is not set correctly. So use at one's own risk.
For example, a partition #1 is an existing partition and a new partition #2 is already added in /dev/sdb
by fdisk
. Here we use partx -v -a /dev/sdb
to add the new partition to the system:
# ls /dev/sdb*
/dev/sdb /dev/sdb1
List the partition table of disk:
# partx -l /dev/sdb
# 1: 63- 505007 ( 504945 sectors, 258 MB)# 2: 505008- 1010015 ( 505008 sectors, 258 MB)# 4: 0- -1 ( 0 sectors, 0 MB)# 3: 0- -1 ( 0 sectors, 0 MB)
Read disk and try to add all partitions to the system:
# partx -v -a /dev/sdbdevice /dev/sdb: start 0 size 2097152 gpt: 0 slices
ors, 258 MB)dos: 4 slices # 1: 63- 505007 ( 504945 sec
t # 2: 505008- 1010015 ( 505008 sectors, 258 MB)0- -1 ( 0 sectors, 0 MB) BLK# 3: 0- -1 ( 0 sectors, 0 MB) # 4
:PG: Device or resource busy error adding partition 1
(These last 2 lines are normal in this case because partition 1 is already added in the system before partition 2 is added)
Check that we have device nodes for /dev/sdb
itself and the partitions on it:
# ls /dev/sdb*
/dev/sdb /dev/sdb1 /dev/sdb2
'OS > Linux' 카테고리의 다른 글
[RHEL] Large Page Memory (0) | 2014.03.08 |
---|---|
[RHEL] Understanding Linux buffers/cached (0) | 2014.01.29 |
A quick overview of Linux kernel crash dump analysis (0) | 2014.01.29 |
[RHEL] Analyzing the Core Dump (0) | 2014.01.29 |
[RHEL] How to analyze and interpret sar data. (0) | 2014.01.29 |
[Linux] GNU 'make' (0) | 2011.02.09 |
[Linux] RPM 사용하기 (0) | 2011.02.09 |
[Linux] 레드햇 패키징 하우투 RPM HOWTO (RPM at Idle) (0) | 2011.02.09 |
[Linux] lsscsi utility for Linux (0) | 2010.10.30 |
[Linux] MondoRescue HOWTO (0) | 2010.01.08 |
Comments
The question is how to use a new partition without rebooting, and the solution is to take the disk out of service (equivalent to rebooting, from a downtime perspective) or reboot? Dynamic resizing of disks is very common in SAN and VMWare environments, and this "enhancement" to RHEL 6 that disables dynamic updates to active partition tables is ill advised, in my opinion.
The solution contains non-reboot way too using partx.
If it will work without surprises, then would think that was an enhancement actually.
Partprobe became honestly advisable and 100% safe and split out its new risky "partx" twin-brother.
^IMO