Error regarding blockdev /dev/sdb1 "BLKRRPART: Invalid argument"

I had to extend an LV on an enterprise server that belongs to sdb1, I added/allocated the space I needed from the storage array.

I rescanned the ports of SAN and then I wanted to blockdev --rereadpt /dev/sdb1 before continuing with lvextend command and then resize2fs command.

But I got:

BLKRRPART: Invalid argument

My idea is that I have to blockdev the /dev/sdb and not the /dev/sdb1 but I am not sure.

Do you have any idea?

Output info from fdisk -l:

Disk /dev/sdb: 21.5 GB, 21474836480 bytes
64 heads, 32 sectors/track, 20480 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3d4c6a02
Device Boot Start End Blocks Id System
/dev/sdb1 1 20480 20971504 8e Linux LVM

2 Answers

--rereadpt command is for rereading partition table. Partitions don’t have partition table, only disks have. So you should run this command:

blockdev --rereadpt /dev/sda
1

You real problem is not that you need to reread the partition table (although you failed to do it correctly anyway; see the other answer), but before you lvextend, you need to:

  1. Resize sdb1; if you do it with fdisk /dev/sdb, it's practically delete and recreate the partition entry with a new end (and only new end; i.e. make sure it has the same start)
  2. Update the size of the PV/VG with pvresize

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like