分区的过程正常:

[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 命令相关推荐

  1. linux 格式化未分配区间,Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令...

    安装操作系统的时候,有一部分空间没有使用,在系统安装后,准备重新分区并格式化,在挂到/u01下,来安装Oracle的. 分区的过程正常: [root@db1 /]# fdisk -l Disk /de ...

  2. 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  25 ...

  3. 使用nsenter进入docker容器后端报错 mesg: ttyname failed: No such file or directory

    通过nsenter 进入到docker容器的后端总是报下面的错,, [root@devdtt ~]# docker inspect -f {{.State.Pid}} mynginx4 11950 [ ...

  4. python读取csv文件路径正确但报错FileNotFoundError: [Errno 2] No such file or directory

    项目场景: python读取csv文件路径正确但报错FileNotFoundError: [Errno 2] No such file or directory 问题描述: #储存调用表格.数据 #调 ...

  5. 报错GL/gl.h: No such file or directory

    1.问题描述 opencv第一次编译时,报错GL/gl.h: No such file or directory 错误信息如下: /home/wrj/anaconda3/include/qt/QtGu ...

  6. 记一次报错原因Error: ENOENT: no such file or directory, open ‘E:\目录‘

    背景:我是将本地文件夹转化成git仓库,之后报错. Error: ENOENT: no such file or directory, open 'E:\目录' 解决方式:我发现了有一个 git 标记 ...

  7. 编译git时,make报错:zlib.h: No such file or directory

    解压git时,make报错 解决方法: 缺少 zlib的头文件 输入:yum install zlib-devel 即可

  8. 4种方法转义字符解决报错FileNotFoundError: [Errno 2] No such file or directory

    写在前面: 前面的案例不想看可以直接看结尾的4个结论. 直接看第4个结论,就是文章的最后.二八定律.[方法4通用性极强] 快速跳转至 通用性方法4 QQ:1981791622. 备注:我是CSDN道友 ...

  9. Linux下svn报错:Can‘t create temporary file from template ‘/tmp/svn-XXXXXX‘: Permission denied

    解决办法: 注释掉:/usr/lib/systemd/system/httpd.service 中的 PrivateTmp=true 然后重启httpd服务就可以了 原因解释: 服务器的svn搭配了a ...

最新文章

  1. 面试官问: 如何保证 MQ消息是有序的?
  2. 推荐15个实用强大的网站,每一个都让人惊艳
  3. 明星居然来我们宜昌保利时代拍戏——电影《被光抓走的人》
  4. 【Android 内存优化】Java 内存模型 ( Java 虚拟机内存模型 | 线程私有区 | 共享数据区 | 内存回收算法 | 引用计数 | 可达性分析 )
  5. SQL SERVER镜像切换
  6. 基于Spring的Web缓存
  7. Python之re模块 —— 正则表达式操作
  8. hibernate mysql 模糊查询_服务器-hibernate操作mysql,模糊查询时中文查不到,数字和英文可以查到...
  9. Python 解释器
  10. Windows 环境下 git 客户端中的 git-bash 和 MINGW64
  11. 鸿蒙系统安兔兔排行榜,安兔兔评测鸿蒙版下载-安兔兔评测 鸿蒙版v9.0.7-PC6鸿蒙网...
  12. 【机器视觉】——相机和镜头的选择
  13. 《zw版·Halcon-delphi系列原创教程》halconxlib控件列表
  14. 用户视图切换为Linux视图,视图_ITPUB博客
  15. CSDN:如何获得C币
  16. 技术交底书(二)-----一种基于移动终端的安全防护系统
  17. java下载神奇宝贝mega,神奇宝贝mega
  18. php支付宝接口开发流程,对接支付宝支付接口开发详细步骤(证书签名方式)
  19. 学习《恋上数据结构与算法》目录索引 (持续更新中)
  20. 淘宝模拟登录2解决滑动验证问题

热门文章

  1. python 问题自动匹配解决方案_最好的 Python IDE,你们推荐使用哪一个?
  2. 数据结构之外部排序:失败树
  3. matplotlib 快速绘图
  4. clone的fork与pthread_create创建线程有何不同pthread多线程编程的学习小结
  5. 用Java语言编写的特殊算法
  6. Python 编码问题:‘ascii‘ codec can‘t encode characters in position 的解决方案(中文乱码终极解决方案)
  7. Springboot是什么?Springboot详解!入门介绍
  8. Python判断端口服务是否启动
  9. web安全测试---WebScarab工具介绍(中间攻击,可以修改请求参数)
  10. Codeforces 543 B. World Tour