Linux 格式化分区 报错Could not stat /dev/sda3 --- No such file or directory

执行分区过程如下:
[root@jyrac2 ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 3002.
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/sda: 24.6 GB, 24696061952 bytes
255 heads, 63 sectors/track, 3002 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2355 18916506 83 Linux
/dev/sda2 2356 2610 2048287+ 82 Linux swap / Solaris

Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): u
Changing display/entry units to sectors

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First sector (41929650-48234495, default 41929650):
Using default value 41929650
Last sector or +size or +sizeM or +sizeK (41929650-48234495, default 48234495):
Using default value 48234495

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.
You have new mail in /var/spool/mail/root

[root@jyrac2 ~]# fdisk -l

Disk /dev/sda: 24.6 GB, 24696061952 bytes
255 heads, 63 sectors/track, 3002 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2355 18916506 83 Linux
/dev/sda2 2356 2610 2048287+ 82 Linux swap / Solaris
/dev/sda3 2611 3003 3152423 83 Linux
新的分区为/dev/sda3

对分区进行格式化:
[root@jyrac2 /]# mkfs.ext3 /dev/sda3
mke2fs 1.39 (29-May-2006)
Could not stat /dev/sda3 --- No such file or directory

The device apparently does not exist; did you specify it correctly?

解决这个问题可以使用partprobe 命令,partprobe包含在parted的rpm软件包中。partprobe可以修改kernel中分区表,使kernel重新读取分区表。 因此,使用该命令就可以创建分区并且在不重新启动机器的情况下系统能够识别这些分区。
检查是否安装了partprobe软件包
[root@jyrac2 /]# rpm -q parted
parted-1.8.1-23.el5

[root@jyrac2 /]# partprobe
[root@jyrac2 /]# mkfs -t ext3 /dev/sda3
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
394400 inodes, 788105 blocks
39405 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=809500672
25 block groups
32768 blocks per group, 32768 fragments per group
15776 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912

Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
You have new mail in /var/spool/mail/root
格式化分区成功
[root@jyrac2 /]# mkdir /u02
[root@jyrac2 /]# mount /dev/sda3 /u02
[root@jyrac2 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 18G 16G 1.5G 92% /
tmpfs 2.0G 0 2.0G 0% /dev/shm
/dev/sda3 4.0G 237M 3.6G 7% /u02

时间: 2024-10-01 19:28:06

Linux 格式化分区 报错Could not stat /dev/sda3 --- No such file or directory的相关文章

linux报错/bin/sh M: bad interpreter: No such file or directory问题

原本今年老蒋就有打算学习Linux脚本方面的内容,于是在之前的各种图书活动中买了不少的书,但是大部分都连塑料封面都还没有拆.今天正好公司没有事情,于是就尝试折腾备份脚本,虽然是有参考网上的一些文档,但是好歹也需要自己摸索一方且修改成较为方便适合我们常规用途的脚本.   我们很多的网友玩Linux脚本修改和撰写的时候都基于Windows系统,所以我们在编辑的脚本文件执行的时候容易出现"/bin/sh^M: bad interpreter: No such file or directory&quo

linux报错/bin/bash^M: bad interpreter: No such file or directory问题

执行shell脚本时提示 /bin/bash^M: bad interpreter: No such file or directory  查看脚本文件是dos格式还是unix格式的几种办法. (1)cat -A filename  从显示结果可以判断,dos格式的文件行尾为^M$,unix格式的文件行尾为$. (2)od -t x1 filename 如果看到输出内容中存在0d 0a的字符,那么文件是dos格式,如果只有0a,则是unix格式. (3)vi filename打开文件,执行 :

linux分区报错解决办法

[root@localhost ~]# fdisk -l Disk /dev/sda: 32.6 GB, 32662945792 bytes 255 heads, 63 sectors/track, 3971 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes    Device Boot      Start         End      Blocks   Id  System /dev/sda1   *          

cxf客户端在linux环境下报错

问题描述 cxf客户端在linux环境下报错 linux下使用的JDK 1.6.0版本 javax.xml.ws.soap.SOAPFaultException: 11|Session| at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156) at $Proxy42.airMultiAvailability(Unknown Source) 解决方案 换个1.7的JDK试一下

linux下jsp报错问题-jsp页面在linux报错问题

问题描述 jsp页面在linux报错问题 HTTP Status 500 - javax.servlet.ServletException: File ""/jsp/base/header.jsp"" not found type Exception report message javax.servlet.ServletException: File ""/jsp/base/header.jsp"" not found de

c++-linux下C++报错:未定义的引用

问题描述 linux下C++报错:未定义的引用 本来只是想将vs上的代码拷到linux中去运行,结果出现了许多奇怪的问题. #include <iostream> #include "Person.h" using namespace std; int main(void) { Person *Tom = new Person("Tom", 23, "123"); return 0; } 用g++编译,结果报错"未定义的引用

ffmpeg-Mac下编译Android FFmpeg2.2.2报错gcc is unable to create an executable file

问题描述 Mac下编译Android FFmpeg2.2.2报错gcc is unable to create an executable file 大家好.报错如题.查看config.log里面有错: EGIN /var/folders/ch/3lnns2f14bv398_ghdz1v9_h0000gn/T//ffconf.nj0OFFb3.c 1 #include 2 #if !(defined ARM_ARCH_4 || defined TARGET_ARCH_4) 3 #error "u

Linux 有问必答:如何修复“fatal error: openssl/aes.h: No such file or directory

Linux 有问必答:如何修复"fatal error: openssl/aes.h: No such file or directory Question:我尝试在Linux编译一个程序,但是编译失败并报了一个错,"fatal error: openssl/aes.h: No such file or directory".我该怎样安装要求的头文件并在我的Linux上解决这个问题? fatal error: openssl/aes.h: No such file or di

Linux格式化分区 Could not start /dev/sda No such file or directory 错误如何解决

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 (