Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令
来源:互联网 发布:java负数转正数 编辑:程序博客网 时间:2024/05/17 13:11
分区的过程正常:
[root@db1 /]# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 650 5116702+ 83 Linux
/dev/sda3 651 841 1534207+ 82 Linux swap / Solaris
[root@db1 /]# fdisk /dev/sda
The number of cylinders for this disk is set to 2610.
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): n
Command action
e extended
p primary partition (1-4)
p
Selected partition 4
First cylinder (842-2610, default 842):
Using default value 842
Last cylinder or +size or +sizeM or +sizeK (842-2610, default 2610):
Using default value 2610
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.
再次查看,分区已经划好:
[root@db1 /]# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 650 5116702+ 83 Linux
/dev/sda3 651 841 1534207+ 82 Linux swap / Solaris
/dev/sda4 842 2610 14209492+ 83 Linux
但是格式化的时候,报错:
[root@db1 /]# mkfs -t ext3 /dev/sda4
mke2fs 1.39 (29-May-2006)
Could not stat /dev/sda4 --- No such file or directory
The device apparently does not exist; did you specify it correctly?
解决方法:执行下partprobe 命令
partprobe包含在parted的rpm软件包中。partprobe可以修改kernel中分区表,使kernel重新读取分区表。 因此,使用该命令就可以创建分区并且在不重新启动机器的情况下系统能够识别这些分区。
查看是否安装该命令:
[root@db1 dev]# rpm -q parted
parted-1.8.1-23.el5
我们执行一下该命令:
[root@db1 dev]# partprobe
Warning: Unable to open /dev/hdc read-write (Read-only file system). /dev/hdc has been opened read-only.
然后在格式化,就ok了:
[root@db1 dev]# mkfs -t ext3 /dev/sda4
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1778880 inodes, 3552373 blocks
177618 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=3640655872
109 block groups
32768 blocks per group, 32768 fragments per group
16320 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
- Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令
- Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令
- Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令
- Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令
- Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令
- Could not stat /dev/sda4 --- No such file or directory
- Linux中VMware启动报错:could not open /dev/ vmmon:no such file or directory
- ubuntu下VMware Workstation报错"Could not open /dev/vmmon: No such file or directory"
- linux执行脚本报错: No such file or directory
- Could not launch app - No such file or directory Error
- linux vmware Could not open /dev/vmmon: No such file or directory.
- redis 编译报错 CC:not find 和 error: jemalloc/jemalloc.h: No such file or directory
- locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
- locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
- locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
- locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
- 拾记-linux-(./文件) 报错 cannot open shared object file: No such file or directory
- 解决 Stat Failed On ....No Such FIle or directory
- 华为机试——字符串字母转换(二)
- WebX实践指南_请求处理(一)
- Face Alignment by Coarse-to-Fine Shape Searching
- j2ee常用知识
- apache网站根目录修改失败原因
- Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令
- WIN32程序任务栏加上进度条
- Android调用WebService服务
- PHP获取昨天时间戳,当前时间信息数组,上周与上周所在的年份,上月与上月所在的年份
- String,StringBuffer与StringBuilder的异同
- 状态开关按钮(ToggleButton)和开关(Switch)的功能与用法
- 关于工业4.0和智能制造的总结以及背后的思考
- WiX Wrapper Exe installer
- Unix(include vim)常用命令