Linux 格式化分区 报错Could not stat /dev/sda3 --- No such file or directory
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 partitions 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
10.18 Linux mke2fs命令格式化硬盘(给硬盘写入文件系统) 前面讲到,mkfs 命令为硬盘分区写入文件系统时,无法手动调整分区的默认参数(比如块大小是 4096 Bytes),如果想要调整,就需要使用本节介绍的 mke2fs 命令。
Linux硬盘分区,卸载,挂载,格式化,加到开机启动项 0、创建挂载目录 mkdir -p /www 1、确认是否有没有分区的磁盘,如下图,没有分区的磁盘是 /dev/xvdb ,在您的服务器中可能是 /dev/vdb 请注意按实际名称修改 fdisk -l 2、为磁盘分区,若已分区的,请跳过! fdisk /dev/xvdb 3、输入n开始创建分.
一、问题背景 在使用mkfs格式化1TB左右容量的硬盘时发现所耗费的时间很长,简直是一种折磨。
eric0435 系统架构师(高级工程师),ACOUG amp;CSOUG核心成员,Oracle Young Expert 。政府信息化技术顾问。湖南省政府采购评审专家,从2007年开始从事社会保险系统开发,应用架构设计,数据库管理工作。擅长Oracle数据库故障诊断,性能调优。
相关文章
- ffmpeg:m4a转mp3(ffmpeg 4.2.2 / linux / centos8)
- 本地上传文件至Linux虚拟机报错“复制时发生出错“
- linux - vim 意外退出导致下次vim进入报错提示恢复
- 【错误记录】编译 Linux 内核报错 ( /bin/sh: 1: flex: not found )
- linux下, 再次遇到使用thinkphp的模板标签时,报错used undefined function ThinkTemplatesimplexml_load_string() 是因为没有安装 php-xml包
- L77.linux命令每日一练 -- 第11章 Linux系统管理命令 -- vmstat和mpstat
- L70.linux命令每日一练 -- 第十章 Linux网络管理命令 -- nc和ssh
- Linux操作系统根社区简介
- 【云原生之Docker实战】使用Docker部署Linux系统监控平台Netdata
- 嵌入式Linux开发,Ubuntu下交叉编译报错:error while loading shared libraries: libc++.so: cannot open shared objec
- 嵌入式Linux开发,Ubuntu下交叉编译内核报错:error while loading shared libraries: /lib/x86_64-linux-gnu/libc++.so:
- 嵌入式linux开发,连接busybox的telnetd服务,报错:telnet: Unable to connect to remote host: Connection refused
- linux 启动network后报错:device eth0 does not seem to be present, delaying initialization
- 74:应急响应-win&linux分析后门&勒索病毒&攻击 ==》暴力破解攻击成功的在4624的eventID里!PChunter可查看非系统的可疑启动项/服务/定时任务,还是很直观的!Linux下gscan也不错,EDR可参考。
- Linux系列 linux 常用命令(笔记)
- Linux中应用层C语言的经典实现方法
- 【Linux】Docker 搭建 Jenkins
- Linux常用命令详细大全(面试常考)
- 安卓通过Linux Deploy安装linux系统
- Linux调试bin报错原因