奇怪的问题:Fdisk之后,不能mkfs?

[复制链接]
查看11 | 回复5 | 2005-2-28 12:57:00 | 显示全部楼层 |阅读模式
Redhat Linux 7.2
在fdisk分出来新分区之后,不能mkfs.
[root@database root]# fdisk /dev/sda
The number of cylinders for this disk is set to 26724.
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: 255 heads, 63 sectors, 26724 cylinders
Units = cylinders of 16065 * 512 bytes
___Device_Boot____Start_______End____Blocks___Id__System
/dev/sda1___*_________1_______892___7164958+__83__Linux
/dev/sda2___________893______1657___6144862+__83__Linux
/dev/sda3__________1658______2294___5116702+__83__Linux
/dev/sda4__________2295_____26724_196233975____f__Win95_Ext'd_(LBA)
/dev/sda5__________2295______2740___3582463+__83__Linux
/dev/sda6__________2741______3059___2562336___83__Linux
/dev/sda7__________3060______3320___2096451___82__Linux_swap
/dev/sda8__________3321______4595__10241406___83__Linux
/dev/sda9__________4596_____10970__51207156___83__Linux
/dev/sda10________10971_____13520__20482843+__83__Linux
/dev/sda11________13521_____21169__61440561___83__Linux
/dev/sda12________21170_____26724__44620506___83__Linux
Command (m for help): q
[root@database root]# mkfs -t ext2 /dev/sda11
mke2fs 1.23, 15-Aug-2001 for EXT2 FS 0.5b, 95/08/09
mkfs.ext2: No such device or address while trying to determine filesystem size
经过反复测试,发现只要是一个逻辑盘(raid),是同时分出来的分区(比如fdisk一下子分区了4个),就能够mkfs
如果是fdisk先分区了两个,前面两个可以mkfs。
再运行fdisk,再分出两个分区来,就不可以了。报告上面的错误。
奇怪。

回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
嘿嘿,重起就OK了。
奇怪,原来没有注意过还有这样的现象。
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
关键可能在这里:
fdisk完之后,报告这个信息:
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Re-read table failed with error 16: Device or resource busy.
Reboot your system to ensure the partition table is updated.
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
只要出现这个告警,就不能mkfs。
但是为什么出现这个告警信息呢?不能读取partition tab?
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
分区表不能调用,好像是在做完之后系统读取(只读取)分区表一次
可能是fdisk的一个bug
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
经过反复测试和Google搜索, 发现如下:
只要这个磁盘上面已经有了Mount的分区, 那么fdisk之后,就无法再次读取分区表.
从而无法mkfs.
/proc/partitions里面也看不到新分区.
如果这个磁盘原来没有mount 的分区, 就不会出现错误.
如果已经有Mount分区,似乎只能先Umount下来,没有别的解决方案.
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
所以应该在单用户下操作:)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行