CentOS Linux 下格式化分区时出现错误:
Invalid argument passed to ext2 library while setting up superblock
[root@glnode04 ~]# mke2fs -j /dev/sdb1
Invalid argument passed to ext2 library while setting up superblock
这是因为在给磁盘 /dev/sdb 分区时,创建的分区是扩展分区而不是主分区,解决办法是在创建分区时选择主分区。
[root@glnode04 ~]# fdisk /dev/sdb1
Command (m for help): n
Command action
e extended
p primary partition (1-4) 这里选择
p
Partition number (1-4): 1
First cylinder (1-17882, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-17882, default 17882):
Using default value 17882
Command (m for help): w <保存并退出>
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@glnode04 ~]# fdisk -l
Disk /dev/sda: 147.0 GB, 147086327808 bytes
255 heads, 63 sectors/track, 17882 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 535 4192965 82 Linux swap / Solaris
/dev/sda3 536 17882 139339777+ 83 Linux
Disk /dev/sdb: 147.0 GB, 147086327808 bytes
255 heads, 63 sectors/track, 17882 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 17882 143637133+ 83 Linux
[root@glnode04 ~]# mke2fs -j /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
17956864 inodes, 35909283 blocks
1795464 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
1096 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@glnode04 /]# df -Th
文件系统 类型 容量 已用 可用 已用% 挂载点
/dev/sda3 ext3 129G 46G 77G 38% /
/dev/sda1 ext3 99M 39M 56M 41% /boot
tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm
/dev/sdb1 ext3 135G 188M 128G 1% /sdb1