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 (minimum/optimal): 512 bytes / 512bytes 
Disk 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

格式化新分区的时候,报错,提示下面的错误,没有这个文件或目录。

Could not stat /dev/sda7 --- No such fileor directory
The device apparently does not exist; didyou specify it correctly?

[root@linuxidc ~]# mke2fs -t ext4 /dev/sda7 
mke2fs 1.41.12 (17-May-2010) 
Could not stat /dev/sda7 --- No such fileor directory 
  
The device apparently does not exist; didyou specify it correctly?

解决方法:执行partprobe 命令
partprobe包含在parted的rpm软件包中。
partprobe可以修改kernel中分区表,使kernel重新读取分区表。 
因此,使用该命令就可以创建分区并且在不重新启动机器的情况下系统能够识别这些分区。
 
查看是否安装过该命令:
[root@linuxidc~]# rpm -q parted 
packageparted is not installed

提示没有安装过,则需要安装parted
安装命令:#yum install parted #前提是保证你的虚拟机可以上网,要从网络下载安装包
[root@linuxidc~]# yum install parted

Loadedplugins: fastestmirror
1234567 Loadingmirror speeds from cached hostfile 
 * base: mirrors.skyshe.cn 
 * extras: mirrors.skyshe.cn 
 * updates: mirrors.skyshe.cn 
base                                                | 3.7 kB    00:00      
extras                                                |3.3 kB    00:00      
updates                                              | 3.4 kB    00:00

Settingup Install Process 
ResolvingDependencies 
-->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 k 
Installedsize: 2.1 M 
Isthis ok [y/N]: y 
DownloadingPackages: 
parted-2.1-25.el6.i686.rpm                            | 595 kB    00:16      
Runningrpm_check_debug 
RunningTransaction Test 
TransactionTest Succeeded 
RunningTransaction 
  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!

安装完成后,再进行查询一次,已经安装成功。
[root@linuxidc~]# rpm -q parted 
parted-2.1-25.el6.i686

执行一下该命令:
[root@linuxidc~]# partprobe 
Warning: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.

然后执行格式化,就OK了,如果还提示出错,重启之后再执行格式化就可以了。
[root@linuxidc~]# mkfs -t ext4 /dev/sda7 
mke2fs1.41.12 (17-May-2010) 
Filesystemlabel= 
OStype: Linux 
Blocksize=4096 (log=2) 
Fragmentsize=4096 (log=2) 
Stride=0blocks, Stripe width=0 blocks 
64384inodes, 257032 blocks 
12851blocks (5.00%) reserved for the super user 
Firstdata block=0 
Maximumfilesystem blocks=264241152 
8block groups
32768blocks per group, 32768 fragments per group 
8048inodes per group 
Superblockbackups stored on blocks:  
    32768, 98304, 163840, 229376 
  
Writinginode tables: done                          
Creatingjournal (4096 blocks): done
Writingsuperblocks and filesystem accounting information: done
  
Thisfilesystem will be automatically checked every 35 mounts or 
180days, whichever comes first.  Use tune2fs-c or -i to override.

Linux格式化分区报错Could not start /dev/sda No such file or directory 解决办法的更多相关文章

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

    分区的过程正常: [root@db1 /]# fdisk -l   Disk /dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/tr ...

  2. ././include/linux/kconfig.h:4:32: fatal error: generated/autoconf.h: No such file or directory 解决办法

    我在编写内核驱动模块的时候报了一个非常奇怪的错误,如下图: 在目录下看了一下确实没有发现这个文件,感觉很奇怪,因为我记得之前编译模块是没有错误的,所以不可能是我代码写的有问题. 查阅了资料很多说要清除 ...

  3. (转)启动网卡报错(Failed to start LSB: Bring up/down networking )解决办法总结

    启动网卡报错(Failed to start LSB: Bring up/down networking )解决办法总结 原文:http://blog.51cto.com/11863547/19059 ...

  4. 搭建elsticsearch集群 报错with the same id but is a different node instance解决办法

    搭建elsticsearch集群 报错with the same id but is a different node instance解决办法 学习了:https://blog.csdn.net/q ...

  5. MySQL8.0报错Can't connect to MySQL server on 'localhost' (10061)的解决办法

    MySQL8.0报错Can't connect to MySQL server on 'localhost' (10061)的解决办法 事情的起因     今天课堂上要展示小组项目,需要用一个软件叫W ...

  6. nginx 启动报错“var/run/nginx/nginx.pid" no such file or directory

    nginx 启动报错“var/run/nginx/nginx.pid" no such file or directory 今天刚搭建的nginx服务器启动时,报错“var/run/ngin ...

  7. shell 报错 /bin/bash^M: bad interpreter: No such file or directory

    shell 执行报错: ./test.sh: /bin/bash^M: bad interpreter: No such file or directory 原因:window和linux 的文件格式 ...

  8. 升级openssh编译报错“configure: error: *** working libcrypto not found, check config.log”的解决办法

    问题描述 在linux上,欲将OpenSSH_6.4p1编译升级到OpenSSH_8.0p1时,执行了./configure --prefix=/usr --sysconfdir=/etc/ssh - ...

  9. CURL命令报错:dyld: lazy symbol binding failed: Symbol not found: _SSL_load_error_strings解决办法

    Mac OS X 10.11.6, curl 命令报错,错误如下: dyld: lazy symbol binding failed: Symbol not found: _SSL_load_erro ...

随机推荐

  1. 《算法实战策略》-chaper19-队列、栈和双端队列

    对于计算机专业的学生来说,他们一定会很熟悉一句话:程序设计 = 算法 + 数据结构.而根据笔者的理解,所谓程序设计其实就是为了编程解决实际问题,所谓算法是一种解决问题某种思维的方法,但是思维需要得到编 ...

  2. Selenium webdriver 元素操作

    本来这些东西网上一搜一大堆,但是本着收集的精神,整理一份放着吧!哈!哈!哈! 1. 输入框(text field or textarea) WebElement element = driver.fi ...

  3. 基于Equinox构建OSGi项目

    几种OSGi框架 Several independently implemented OSGi frameworks exist today, including four that are avai ...

  4. linux使用mount挂载iso文件

    mount -t iso9660 -o loop /home/user/XXX.iso /mnt/iso

  5. SuppressWarnings的警告

    简介:java.lang.SuppressWarnings是J2SE 5.0中标准的Annotation之一.可以标注在类.字段.方法.参数.构造方法,以及局部变量上.作用:告诉编译器忽略指定的警告, ...

  6. Python模拟登录实战(三)

    目标:模拟登录知乎 代码如下: #!/usr/bin/env python # -*- coding:utf-8 -*- __author__ = 'ziv·chan' import re impor ...

  7. [Javascript] Intro to Recursion - Refactoring to a Pure Function

    Previous post: http://www.cnblogs.com/Answer1215/p/4990418.html let input, config, tasks; input = [' ...

  8. jboss7 加载module过程

    1. 调试类: org.jboss.as.server.Main的main方法 断点: Module.registerURLStreamHandlerFactoryModule(Module.getB ...

  9. Array.asList:数组转list时你一定要知道的“陷阱”!

    最近开发中,业务上处理,经常用到asList方法,这让我不经想起了它的很多容易让人犯错的地方或者误解的地方,所以就想抽出时间来,整理一下,和大家分享出来,深夜了,话不多说,主要以代码为主,简易的代码, ...

  10. sass笔记-2|Sass基础语法之让样式表更具条理性和可读性

    这一篇主要详述保持sass条理性和可读性的3个最基本方法--嵌套.导入和注释. 零. 变量 变量本身的作用是为了保持属性值的可维护性,把所有需要维护的属性值放在同一个地方,快速更改,处处生效,可谓售后 ...