创建 ext4 分区失败并显示“无效块计数”

创建 ext4 分区失败并显示“无效块计数”

环境: - VMWare ESX 4.0 上的虚拟机 - 操作系统:完全最新的 RHEL 5.8

添加新的(虚拟)磁盘后,我想在此磁盘上的 LVM 上创建 ext4 分区。

迄今为止采取的步骤:

$ sudo /sbin/fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 10443.
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)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
p
Partition number (1-4): 1
First cylinder (1-10443, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-10443, default 10443):
Using default value 10443

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
$ sudo /usr/sbin/pvcreate /dev/sdb1
  Writing physical volume data to disk "/dev/sdb1"
  Physical volume "/dev/sdb1" successfully created
$ sudo /usr/sbin/vgcreate VGora /dev/sdb1
  /dev/hdc: open failed: No medium found
  Volume group "VGora" successfully created
$ sudo /usr/sbin/lvcreate -l "100%FREE" -n oradata VGora
  Logical volume "oradata" created

创建ext4分区失败:

$ sudo /sbin/mke2fs -t ext4 /dev/VGora/oradata
mke2fs 1.39 (29-May-2006)
mke2fs: invalid blocks count - /dev/VGora/oradata

有关创建的分区的更多信息:

$ sudo /usr/sbin/vgdisplay VGora
  --- Volume group ---
  VG Name               VGora
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               80.00 GB
  PE Size               4.00 MB
  Total PE              20479
  Alloc PE / Size       20479 / 80.00 GB
  Free  PE / Size       0 / 0
  VG UUID               ggjERV-sGbG-1nCv-HW61-LJk4-I7cX-Z3Infh

$ sudo /usr/sbin/lvdisplay VGora
  --- Logical volume ---
  LV Name                /dev/VGora/oradata
  VG Name                VGora
  LV UUID                nia1PK-7JJ2-jg5T-uN4X-ggYH-R0mS-oqCooY
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                80.00 GB
  Current LE             20479
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:4

$ sudo /sbin/fdisk -l /dev/sdb

Disk /dev/sdb: 85.8 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       10443    83883366   8e  Linux LVM

我找不到有关此错误的任何相关信息,也不知道如何解决此问题。

  • 我如何检查块数?
  • 如何将其更正为 ext4 的有效数字?

答案1

我认为在参数解析中检查错误会导致该消息。 RHEL 5 上的 mke2fs 版本不支持该-t type参数,因此它以某种方式将/dev/VGora/oradata路径解析为最后一个(可选)块计数参数。

无论如何,您想要执行此操作的方法是确保已e4fsprogs安装然后使用mkfs.ext4 /dev/VGora/oradatamke4fs

答案2

mkfs.ext3 -f /dev/sdb5
mkfs.ext3: invalid fragment size - /dev/sdb5

-f当我尝试没有它的工作时,它在 RHEL5 中无法工作。

mkfs.ex3 /dev/sdb5 

mkfs.ext3 /dev/sdb5
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
78856192 inodes, 157694024 blocks
7884701 blocks (5.00%) reserved for the super user

相关内容