On Linux, after installing the system, can you create partitions and the system can recognize these partitions without restarting the machine?
Workaround:
You can use a tool called Partprobe. It is included in the parted RPM software package. His version is parted-1.6 on red Hat Enterprise Linux 3. Partprobe is a tool that can modify partitioned tables in kernel. You can enable kernel to reread the partition table. The following command allows you to see if your system has a parted package installed
The code is as follows:
Rpm-q parted
For example:
The code is as follows:
# Rpm-q parted
parted-1.6.3-29
You can use the Up2date command to install this package if your system is properly registered to the RHN. Otherwise you can install the file from the CD.
You can use Fdisk or other commands to create a new partition, and then use the Partprobe command to reread the partition table.
The code is as follows:
# Partprobe
This command does not output any return information after execution, and you can use the MKE2FS command to create a file system on the new partition.
When you partition using the FDISK command in Linux, you sometimes encounter the warning:re-reading the partition table failed with error 16:device or resource busy. The kernel still uses the old table. The new table is used at the next reboot. This alarm message. As shown below
The code is as follows:
[Root@localhost ~]# Fdisk/dev/sde
The number of cylinders for this disk is set to 18928.
There is no wrong with then, but this is larger than 1024,
And could in certain setups cause problems with:
1 software that runs in boot time (e.g., old versions of LILO)
2) booting and partitioning software from the other OSs
(e.g., DOS fdisk, OS/2 fdisk)
Command (M for help): P
disk/dev/sde:155.6 GB, 155692564480 bytes
255 heads, Sectors/track, 18928 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 18275 146793906 5 Extended
/DEV/SDE5 1 18275 146793874+ Linux
Command (M for help): N
Command Action
L logical (5 or over)
P primary partition (1-4)
P
Partition number (1-4): 2
The cylinder (18276-18928, default 18276):
Using Default Value 18276
Last cylinder or +size or +sizem or +sizek (18276-18928, default 18928):
Using Default Value 18928
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 is used at the next reboot.
Syncing disks.
When you do not see the new partition information using the FDISK command, you can use the Partprobe command to resolve the problem without restarting the system because Partprobe can enable kernel to reread the partition information, thereby avoiding restarting the system.
The code is as follows:
Partprobe-inform the OS of partition table changes
DESCRIPTION
This manual page documents briefly the Partprobe command.
Partprobe is a program that informs the operating system kernel of partition table changes by requesting that the OP erating system re-read the partition table.