linux fdisk错误,Linuxfdisk后error22:Invalidargument

在尝试使用FDISK在新的共享LUN上创建Oracle ASM的逻辑分区时遇到错误,提示分区表无效。解决方案是在FDISK完成后运行'kpartx -a'命令,将所有分区映射添加到新创建的多路径设备上,并确保在集群的所有节点上执行此操作,以便它们都能看到新创建的分区。
摘要由CSDN通过智能技术生成

解决办法 (zz)

You've created shared LUNs for ORACLE ASM and you are trying to create a

logical partition on the new LUN using FDISK -- it gives you the following

message:

WARNING: Re-reading the partition table failed with error 22: Invalid argument.

Example

[root@qarac1 ~]# fdisk /dev/mapper/

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

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): p

Disk /dev/mapper/: 156.8 GB, 156892397568 bytes

255 heads, 63 sectors/track, 19074 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-19074, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-19074, default 19074):

Using default value 19074

Command (m for help): p

Disk /dev/mapper: 156.8 GB, 156892397568 bytes

255 heads, 63 sectors/track, 19074 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/dev/mapper 1 19074 153211873+ 83 Linux

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 22: Invalid argument.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

[root@qarac1 ~]#

Solution

Run "kpartx -a" after FDISK is completed to add all partition mappings on the

newly-created multipath device -- EXAMPLE:

/sbin/kpartx -a /dev/mapper

/sbin/kpartx -l /dev/mapper

p1 : 0 306423747 /dev/mapper 63

[root@qarac1 linux]# ls -l /dev/mapper/*

brw-rw---- 1 root disk 253, 8 Jun 19 19:33 /dev/mapper/2000b080002002238

brw-rw---- 1 root disk 253, 13 Jul 10 16:19 /dev/mapper/2000b080002002238p1

NOTE: you must re-run "kpartx -a" on all nodes of the cluster for them to be

able to see the newly created partition /dev/mapper/2000b080002002235p1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值