Thứ Năm, 12 tháng 10, 2017

Re-read The Partition Table Without Rebooting Linux System

If you are using hot swappable hard disk and created a new partition using the fdisk, then you need to reboot Linux based system to get partition recognized. Without reboot, you will NOT be able to create a filesystem on your newly created or modified partitions with the mke2fs command.
The kernel still uses the old table. The new table will be utilized at the next reboot or after you run partprobe or kpartx command. Both of these programs informs the operating system kernel of partition table changes, by requesting that the operating system re-read the partition table.

You will seen an error that read as follows:
Re-reading the partition table failed.: Device or resource busy


After the fdisk command session (which makes changes to partition table) just type the following command:
# partprobe

OR
# partprobe /dev/sdX

Replace /dev/sdX or /dev/hdX with actual device name. Now you will able to create filesystem on new partition with the mke2fs command.

Share This!


Không có nhận xét nào:

Đăng nhận xét