Linux格式化扩展分区时会报错,因为Linux扩展分区格式化无意义,它是为logicalpartition服务的,它们大小一

样。在一块硬盘里你最多只能创造fourpartiton,包括主分区与expand分区,而一个expand分区可以创造去多个

logicalpartition,是在logicalpartition使用space的。此时,为了解决问题,可以在扩展分区上创建主分区(p)

或逻辑分区(l)

以下演示出错解决过程:

1、创建扩展分区

[root@localhosttmp]# fdisk /dev/sda

WARNING:DOS-compatible mode is deprecated. It's strongly recommended to

switchoff the mode (command 'c') and change display units to

sectors(command 'u').

Command(m for help): n

Firstcylinder (4106-4178, default 4106):

Usingdefault value 4106

Lastcylinder, +cylinders or +size{K,M,G} (4106-4178, default 4178): +100M

Command(m for help): W

Thepartition table has been altered!

Callingioctl() to re-read partition table.

WARNING:Re-reading the partition table failed with error 16: 设备或资源忙.

Thekernel still uses the old table. The new table will be used at

thenext reboot or after you run partprobe(8) or kpartx(8)

Syncingdisks.

[root@localhosttmp]# fdisk -l

Disk/dev/sda: 34.4 GB, 34359738368 bytes

255heads, 63 sectors/track, 4177 cylinders

Units= cylinders of 16065 * 512 = 8225280 bytes

Sectorsize (logical/physical): 512 bytes / 512 bytes

I/Osize (minimum/optimal): 512 bytes / 512 bytes

Diskidentifier: 0x0003d455

DeviceBoot Start End Blocks Id System

/dev/sda1 * 1 128 1024000 83 Linux

Partition1 does not end on cylinder boundary.

/dev/sda2 128 2040 15360000 83 Linux

/dev/sda3 2040 3825 14336000 83 Linux

/dev/sda4 3825 4178 2833408 5 Extended

/dev/sda5 3825 4106 2252800 82 Linux swap / Solaris

/dev/sda6 4106 4119 109964 83 Linux

2、格式化磁盘分区

[root@localhost~]# mount /dev/sda6 /data

mount:you must specify the filesystem type

显示分区未格式化

[root@localhost~]# mkfs -t ext3 -c /dev/sda6

mke2fs1.41.12 (17-May-2010)

mkfs.ext3:inode_size (128) * inodes_count (0) too big for a

filesystemwith 0 blocks, specify higher inode_ratio (-i)

orlower inode count (-N).

3、格式化扩展分区报错解决

格式磁盘时发现如下错误,原因是扩展分区无法格式化,

解决方法是在扩展分区上创建主分区(p)或逻辑分区(l)

[root@localhost~]# fdisk /dev/sda6

Devicecontains neither a valid DOS partition table, nor Sun, SGI or OSFdisklabel

Buildinga new DOS disklabel with disk identifier 0xcbd45cde.

Changeswill remain in memory only, until you decide to write them.

Afterthat, of course, the previous content won't be recoverable.

Warning:invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING:DOS-compatible mode is deprecated. It's strongly recommended to

switchoff the mode (command 'c') and change display units to

sectors(command 'u').

Command(m for help): p

Disk/dev/sda6: 112 MB, 112603136 bytes

255heads, 63 sectors/track, 13 cylinders

Units= cylinders of 16065 * 512 = 8225280 bytes

Sectorsize (logical/physical): 512 bytes / 512 bytes

I/Osize (minimum/optimal): 512 bytes / 512 bytes

Diskidentifier: 0xcbd45cde

DeviceBoot Start End Blocks Id System

Command(m for help): n

Commandaction

e extended

p primary partition (1-4)

p

Partitionnumber (1-4): 1

Firstcylinder (1-13, default 1):

Usingdefault value 1

Lastcylinder, +cylinders or +size{K,M,G} (1-13, default 13): 13M

Command(m for help): P

Disk/dev/sda6: 112 MB, 112603136 bytes

255heads, 63 sectors/track, 13 cylinders

Units= cylinders of 16065 * 512 = 8225280 bytes

Sectorsize (logical/physical): 512 bytes / 512 bytes

I/Osize (minimum/optimal): 512 bytes / 512 bytes

Diskidentifier: 0xcbd45cde

DeviceBoot Start End Blocks Id System

/dev/sda6p1 1 13 104391 83 Linux

Command(m for help): W

Thepartition table has been altered!

Callingioctl() to re-read partition table.

WARNING:Re-reading the partition table failed with error 22: 无效的参数.

Thekernel still uses the old table. The new table will be used at

thenext reboot or after you run partprobe(8) or kpartx(8)

Syncingdisks.

此处要重启使生效,也可以使用partprobe命令

[root@localhost~]# partprobe

Warning:WARNING: the kernel failed to re-read the partition table on /dev/sda(设备或资源忙). As a

result, it may not reflect all of your changes until afterreboot.

Warning:无法以读写方式打开/dev/sr0(只读文件系统)。/dev/sr0已按照只读方式打开。

Warning:无法以读写方式打开/dev/sr0(只读文件系统)。/dev/sr0已按照只读方式打开。

Error:无效的分区表 -/dev/sr0 出现递归分区。

[root@localhost~]# fdisk -l

Disk/dev/sda: 34.4 GB, 34359738368 bytes

255heads, 63 sectors/track, 4177 cylinders

Units= cylinders of 16065 * 512 = 8225280 bytes

Sectorsize (logical/physical): 512 bytes / 512 bytes

I/Osize (minimum/optimal): 512 bytes / 512 bytes

Diskidentifier: 0x0003d455

DeviceBoot Start End Blocks Id System

/dev/sda1 * 1 128 1024000 83 Linux

Partition1 does not end on cylinder boundary.

/dev/sda2 128 2040 15360000 83 Linux

/dev/sda3 2040 3825 14336000 83 Linux

/dev/sda4 3825 4178 2833408 5 Extended

/dev/sda5 3825 4106 2252800 82 Linux swap / Solaris

/dev/sda6 4106 4119 109964 83 Linux

[root@localhost~]# mkdir /data

再次格式化,显示格式化成功。

[root@localhost~]# mkfs.ext3 /dev/sda6

mke2fs1.41.12 (17-May-2010)

文件系统标签=

操作系统:Linux

块大小=1024(log=0)

分块大小=1024(log=0)

Stride=0blocks, Stripe width=0 blocks

27552inodes, 109964 blocks

5498blocks (5.00%) reserved for the super user

第一个数据块=1

Maximumfilesystem blocks=67371008

14block groups

8192blocks per group, 8192 fragments per group

1968inodes per group

Superblockbackups stored on blocks:

8193,24577, 40961, 57345, 73729

正在写入inode表:完成

Creatingjournal (4096 blocks): 完成

Writingsuperblocks and filesystem accounting information: 完成

Thisfilesystem will be automatically checked every 24 mounts or

180days, whichever comes first. Use tune2fs -c or -i to override.

4、再次挂载磁盘分区,挂载成功

[root@localhost~]# mount /dev/sda6 /data

[root@localhost~]# df -hT

[root@localhost/]# df -hT

Filesystem Type Size Used Avail Use% Mounted on

/dev/sda2 ext4 15G 8.4G 5.9G 59% /

/dev/sda1 ext4 969M 54M 865M 6% /boot

/dev/sda3 ext4 14G 525M 13G 5% /home

/dev/sr0 iso9660 1.8G 1.8G 0 100% /mnt/iso

share vboxsf 222G 93G 129G 42% /mnt/share

/dev/sda6 ext3 104M 5.7M 93M 6% /data

linux格式化扩展分区报错解决相关推荐

  1. Linux 格式化扩展分区(Extended)

    如果你在Linux系统中格式化磁盘时遇到如下错误,那么表示你正在格式化一个扩展分区. [root@GETTestLNX06 ~]# mkfs.ext4 /dev/sdb1 mke2fs 1.41.12 ...

  2. win10装系统时分区报错解决方法 无法找到新的分区也找不到现有分区

    windows7装到windows10时,这个错误是最常见的,原因是因为windows7的硬盘分区表格式是MBR的,而windows10的硬盘分区表格式是GPT(也叫GUID)的,硬盘分区表格式不兼容 ...

  3. linux使用parted分区报错,使用parted对硬盘进行分区

    使用parted对硬盘进行分区 在linux系统中,分区通常可以使用fdisk和parted工具,分区表通常有MBR分区表和GPT分区表.对于磁盘大小小于2T的磁盘,我们可以使用fdisk和parte ...

  4. Linux系统安装Redis以及报错解决方法

    1.我们先下载好redis的版本,然后通过类似于xftp等工具,将其拖进linux中,放置于/opt当中,或是直接到官网下载 官网地址https://redis.io/ 2.然后使用解压命令解压 ta ...

  5. linux挂载ntfs分区报错,Linux下挂载NTFS分区和挂载分区的方法

    Linux下挂载NTFS分区和挂载分区的方法 如果你的磁盘格式为NTFS就按照以下步骤如果不是就直接跳下一步 首先去下载个 NTFS-3G 下载地址:http://www.tuxera.com/com ...

  6. Linux CentOS 6.x报错解决:错误:Cannot retrieve metalink for repository: epel. Please verify its path and tr

  7. linux tar 解压报错解决方法

    问题一 使用tar命令解压.zip文件的时候,遇到如下异常, gzip: stdin has more than one entry--rest ignored tar: Child returned ...

  8. 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 ...

  9. Linux/ubuntu 安装 redis 4.0报错解决:redis-server.service: Can't open PID file /var/run/redis/redis-server.

    此文首发于我的个人博客:Linux/ubuntu 安装 redis 4.0报错解决:redis-server.service: Can't open PID file /var/run/redis/r ...

最新文章

  1. 华为,牵手这所新大学!
  2. xcode8控制台输出大量不用的log的问题解决NSLog失效的解决
  3. java snack_JSONPath小试牛刀之Snack3
  4. 消息队列重要机制讲解以及MQ设计思路(kafka、rabbitmq、rocketmq)
  5. 南开大学java考试试题_2014秋学期南开大学《Java语言程序设计》在线作业附答案...
  6. redis的压缩列表源码ziplist解析
  7. pandas dataframe随机采样
  8. 二次开发-如何在PHPEMS-发送短信验证码(以easy-sms为例)
  9. java发布rest服务器_ArcGIS Server 10 Java 版的Rest服务的部署方法
  10. oracle ADF 代码标准
  11. DBS:CUPhone
  12. arcgis python计算面积_如何在ARCMAP里面计算面积
  13. IR2104半桥驱动
  14. 解决插入word文档中的图片变得不清晰问题
  15. AT24C02数据存储
  16. The server time zone value ‘� й ��� ׼ʱ ��‘ is unrecognized or represents more than one time zone.
  17. 产品经理(20) #PRD产品需求文档
  18. springboot+redistemplate 集群配置
  19. C语言求最大公约数三种方法详解
  20. 微信小程序0基础快速入门(史上最全!!!)

热门文章

  1. DNA和RNA修饰的鉴定和编辑技术前沿综述 (全文翻译版)
  2. 在微信公众平台注册一个小程序开发账号
  3. 商鼎云 | 你的数据管家
  4. vivo6.0系统机器(亲测有效)激活xposed框架的方法
  5. 极云普惠云电脑 v1.2.9
  6. 关于对掘金和csdn的认识
  7. AT2382-[AGC015D]A or...or B Problem
  8. 逻辑为基、数企赋能(NO.21)—批判性思维
  9. DSPE-PEG-iRGD,磷脂-聚乙二醇-靶向穿膜肽iRGD,用于主动靶向研究
  10. 中小企业的上_云_梦,华为云CDN来实现