基礎命令學習目錄首頁php
原文連接:https://www.jb51.net/LINUXjishu/389836.htmlhtml
linux上,在安裝系統以後,能否建立分區而且在不從新啓動機器的狀況下系統可以識別這些分區?
解決方法:
你可使用一個叫作partprobe的工具。它包含在parted的rpm軟件包中。在Red Hat Enterprise Linux 3上他的版本是parted-1.6。 partprobe 是一個能夠修改kernel中分區表的工具。可使kernel從新讀取分區表。以下命令能夠查看你的系統是否安裝了parted軟件包
linux
舉例來講:
工具
parted-1.6.3-29
你可使用up2date命令安裝這個軟件包,若是在你的系統已經正確地註冊到RHN上了。不然你能夠從光盤上安裝這個文件。
你可使用fdisk或者其餘命令建立一個新的分區,而後使用partprobe命令從新讀取分區表。
post
這個命令執行完畢以後不會輸出任何返回信息,你可使用mke2fs命令在新的分區上建立文件系統。
在Linux中使用fdisk命令進行分區時,有時會遇到「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.」這種告警信息。以下所示
學習
The number of cylinders for this disk is set to 18928.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/sde: 155.6 GB, 155692564480 bytes
255 heads, 63 sectors/track, 18928 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 18275 146793906 5 Extended
/dev/sde5 1 18275 146793874+ 83 Linux
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
p
Partition number (1-4): 2
First 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 will be used at the next reboot.
Syncing disks.
此時使用fdisk命令看不到新建的分區信息,可使用partprobe命令解決這個問題而不用重啓系統,由於partprobe可使kernel從新讀取分區信息,從而避免重啓系統。
this
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 operating system re-read the partition table.url