View the areas that are already well-divided
[[EMAIL PROTECTED] ~]# FDISK -L /DEV/SDA DISK /DEV/SDA: 21.5 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersunits = cylinders of 16065 * 512 = 8225280bytesSector size (logical/ Physical): 512 bytes /512 bytesi/o size (minimum/optimal): 512 bytes / 512bytesDisk 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
When the new partition is formatted, an error message is indicated, and there is no such file or directory.
Could not STAT/DEV/SDA7---No such fileor directory
The device apparently does not exist; Didyou Specify it correctly?
[Email protected] ~]# mke2fs-t ext4/dev/sda7mke2fs 1.41.12 (17-may-2010) Could not stat/dev/sda7---No such fileor dir Ectory the device apparently does not exist; Didyou Specify it correctly?
Workaround: Execute partprobe Command
Partprobe included in the RPM package for parted.
Partprobe You can modify the partition table in kernel to allow kernel to reread the partitioned table.
Therefore, you can use this command to create partitions and the system to recognize those partitions without restarting the machine.
To see if the command has been installed:
[Email protected]~]# rpm-q partedpackageparted is not installed
If the hint is not installed, you need to install parted
Install command:#yum install parted #前提是保证你的虚拟机可以上网 to download the installation package from the network
[Email protected]~]# yum Install parted
loadedplugins:fastestmirror
loadingmirror speeds from cached hostfile * base: mirrors.skyshe.cn * extras: mirrors.skyshe.cn * updates: mirrors.skyshe.cnbase | 3.7 kb 00:00 extras | 3.3 kb 00:00 updates | 3.4 kb 00:00
Settingup install processresolvingdependencies-->running transaction check---> Package parted.i686 0:2.1-25.el6 will be installed-->finished dependency resolution dependenciesresolved ============================================================== =============== package arch Version repository size================== ===========================================================installing: parted i686 2.1-25.el6 base 595 k transactionsummary==================================================== =========================install 1 package (s) Totaldownload size: 595 kinstalledsize: 2.1 misthis ok [y/n]: ydownloadingpackages: parted-2.1-25.el6.i686.rpm | 595 kB 00:16 Runningrpm_check_debugRunningTransaction testtransactiontest succeededrunningtransaction installing : parted-2.1-25.el6.i686 1/ 1 verifying : parted-2.1-25.el6.i686 1/1 Installed: parted.i686 0:2.1-25.el6 complete!
Once the installation is complete, the query is made again and the installation is successful.
[Email protected]~]# rpm-q partedparted-2.1-25.el6.i686
Execute the command:
[[email protected]~]# partprobewarning:warning: the kernel failed to re-read the partition table on /dev/sda (deviceor resource busy). as a result, it maynot reflect all of your changes until after reboot. Warning:warning: the kernel failed to re-read the partition table on /dev/sdb (deviceor resource busy). as a result, it maynot reflect all of your changes until after reboot. warning:unable to open /dev/sr0 read-write (Read-only file system) . /dev/sr0 has been opened read-only. warning:unable to open /dev/sr0 read-write (Read-only file system) . /dev/sr0 has been opened read-only. ERror:invalid partition table - recursive partition on /dev/sr0.
Then do the formatting, OK, if you also prompt an error, restart after the execution of the format.
[[email protected]~]# mkfs -t ext4 /dev/sda7mke2fs1.41.12 (17-May-2010) filesystemlabel=ostype: linuxblocksize=4096 (log=2) fragmentsize=4096 (log=2) Stride=0blocks, Stripe width=0 blocks64384inodes, 257032 blocks12851blocks (5.00%) reserved for the super userfirstdata block=0maximumfilesystem blocks= 2642411528block groups32768blocks per group, 32768 fragments per group8048inodes per groupsuperblockbackups stored on blocks: 32768, 98304, 163840, 229376 Writinginode tables: done Creatingjournal (4096 blocks): donewritingsuperblocks And filesystem accounting information:&nbSp;done thisfilesystem will be automatically checked every 35 mounts or180days, whichever comes first. use tune2fs-c or -i to override.
Linux formatted partition error could not START/DEV/SDA No such file or directory workaround