在格式化Linux分區的時候,不少人遇到了棘手的問題,提示Could not stat /dev/sda7 --- No such fileor directory錯誤,那麼有什麼辦法能夠解決Linux格式化分區的報錯問題呢?
Linux查看已經分好的區
[root@linuxidc ~]# fdisk -l /dev/sda
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280bytes
Sector size (logical/physical): 512 bytes /512 bytes
I/O size (minimum/optimal): 512 bytes / 512bytes
Disk identifier: 0x7d57cb1f
Device Boot Start End Blocks Id System
/dev/sda1 1 2610 20964793+ 5 Extended
/dev/sda5 1 128 1028097 83 Linux
/dev/sda6 129 256 1028128+ 83 Linux
/dev/sda7 257 384 1028128+ 83 Linux
格式化新分區的時候,報錯,提示下面的錯誤,沒有這個文件或目錄。
Could not stat /dev/sda7 --- No such fileor directory
The device apparently does not exist; didyou specify it correctly?
[root@linuxidc ~]# mke2fs -t ext4 /dev/sda7
mke2fs 1.41.12 (17-May-2010)
Could not stat /dev/sda7 --- No such fileor directory
The device apparently does not exist; didyou specify it correctly?
解決方法:
執行partprobe 命令
partprobe包含在parted的rpm軟件包中。
partprobe可以修改kernel中分區表,使kernel重新讀取分區表。
因此,使用該命令就可以創建分區並且在不重新啟動機器的情況下系統能夠識別這些分區。
查看是否安裝過該命令:
[root@linuxidc~]# rpm -q parted
packageparted is not installed
提示沒有安裝過,則需要安裝parted
安裝命令:#yum install parted #前提是保證你的虛擬機可以上網,要從網絡下載安裝包
[root@linuxidc~]# yum install parted
Loadedplugins: fastestmirror
1234567 Loadingmirror speeds from cached hostfile
* base: mirrors.skyshe.cn
* extras: mirrors.skyshe.cn
* updates: mirrors.skyshe.cn
base | 3.7 kB 00:00
extras |3.3 kB 00:00
updates | 3.4 kB 00:00
Settingup Install Process
ResolvingDependencies
--》Running transaction check
---》Package parted.i686 0:2.1-25.el6 will be installed
--》Finished Dependency Resolution
DependenciesResolved
Package Arch Version Repository Size
上一頁12下一頁共2頁