I'm unable to add a new volume (provisioned by a SAN storage) as a PhysicalVolume for the host's LVM volume. Here is the error message:
#sudo pvcreate /dev/sdc1 -v
Device /dev/sdc1 not found (or ignored by filtering).
OS: Ubuntu 14.04.2 LTS (GNU/Linux 3.16.0-30-generic x86_64)
fdisk:
#sudo fdisk /dev/sdc -l
Disk /dev/sdc: 2198.0 GB, 2197999845376 bytes
237 heads, 20 sectors/track, 905689 cylinders, total 4292968448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 1048576 bytes
Disk identifier: 0x00031fdb
Device Boot Start End Blocks Id System
/dev/sdc1 2048 4292968447 2146483200 8e Linux LVM
parted:
#sudo parted /dev/sdc
GNU Parted 2.3
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: HP MSA 2040 SAN (scsi)
Disk /dev/sdc: 2198GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 2198GB 2198GB primary lvm
filter (only uncommented lines):
filter = [ "a/.*/" ]
global_filter = [ "a|loop0|", "a|loop1|", "a|sda5|", "r|.*|" ]
partprobe:
sudo partprobe -s
/dev/sda: msdos partitions 1 2 <5>
/dev/sdb: msdos partitions 1 2
/dev/sdc: msdos partitions 1
/dev/sdd: msdos partitions 1
/dev/mapper/devstack--vg-swap_1: loop partitions 1
/dev/mapper/devstack--vg-root: loop partitions 1
What I've tried so far:
- fdisk /dev/sdc n, p, 1, ENTER 2 times, t, 8e, w
- (parted) mklabel msdos
- (parted) mklabel gpt
- (parted) mklabel loop
- zero filled the first sector of /dev/sdc
- zero filled /dev/sdc
- partprobe
- partprobe /dev/sdc
- reboot
The problem is with the
global_filter
setting inetc/lvm/lvm.conf
that was generated by the Devstack installation.I commented the line out and am now able to use
pvcreate
normally.Thanks to @MichaelHampton for pointing out.
Rather than commenting out the entire line, it is possible to add the disk partitions you want to add - in my case, I also wanted to add /dev/sdc1, so changed the line to the following:
After that, the pvcreate command worked fine. No reboot required.
Thanks for the original post and answers, though - without that information I would still be trying to figure out what was going on.
I had a similar problem on Debian 8
Difference to the Opening Post was that my global_filter was commented out on default with no content inside so I left it as is.
There are 3 volume groups on this system, 2 created with the installation. vg_data was created afterwards from sdd (same Controller as sdc below) with no errors and entire disk as RAW.
I finally went with the following steps:
I had hoped that lvm would overwrite the partition and use the disk as RAW but...
So in the end I used the partition and ...
yay vg_data was finally extended
Another possible reason: there might be a RAID superblock on the device. If so (check with
file -s /dev/sdXN
if you don't want to install mdadm just for that), zero it out withdd if=/dev/zero bs=1k count=10 of=/dev/sdXN
.No, the
--force
option topvcreate
is not sufficient. I'm going to file a bug about that.