2

I am running Linux Ubuntu via VMWare. Currently it has been allocated a space of just 20 GB. I increased the same by 1 GB, on a trial basis. The new partition is named sda3 (screen shot of sudo parted -l is attached) which shows that a space of 21 GB is available. However, when I run the pvcreate command, it fails with the error message:

pvcreate /dev/sda3
Device /dev/sda3 not found (or ignored by filtering).

I am running the pvcreate command, so that the disk analyser tool is able to detect this area in order for Linux to use it.
Note: I am following the steps listed here: http://www.ireasoning.com/articles/linux_vmware_resize_disk.php (in case required).

PartedCommand

What might be the reason pvcreate fails? Also, should the new partition be created as a LVM or just a simple linux partition if I intended to use it just for storage purposes?

Thanks!

  • Try running with the --debug flag. – Faheem Mitha Jan 17 '16 at 15:39
  • @FaheemMitha, you mean pvcreate -- debug /dev/sda3? – user118383 Jan 17 '16 at 15:45
  • Yes, pvcreate --debug /dev/sda3. – Faheem Mitha Jan 17 '16 at 16:08
  • @roaima, I am just experimenting since this is my first time. Will use a larger space (~150GB) once I am sure about what I need to do. – user118383 Jan 17 '16 at 16:12
3

Partition 3 is only 1MB long, which isn't enough to create a PV.

Empirical evidence

dd if=/dev/zero bs=1M count=1 > dd.img
loop=$(losetup  --show --find dd.img); echo "$loop"
# /dev/loop0
pvcreate "$loop"
# Device /dev/loop0 not found (or ignored by filtering).
losetup -d "$loop"
rm -f dd.img

dd if=/dev/zero bs=10M count=1 > dd.img
loop=$(losetup  --show --find dd.img); echo "$loop"
# /dev/loop0
pvcreate "$loop"
# Writing physical volume data to disk "/dev/loop0"
# Physical volume "/dev/loop0" successfully created
losetup -d "$loop"
rm -f dd.img

Discovery

Further investigation shows that at least 2MB (2048000 bytes) is required for pvcreate to succeed. It turns out that this is defined in the lvm.conf(5) file with the keyword pv_min_size, where the man page states

pv_min_size -- Minimal size (in KB) of the block device which can be used as a PV. In clustered environment all nodes have to use the same value. Any value smaller than 512KB is ignored. Up to and include version 2.02.84 the default was 512KB. From 2.02.85 onwards it was changed to 2MB to avoid floppy drives by default.

So there you have it. I've learned something today, too.

  • I am just experimenting since this is my first time. Will use a larger space (~150GB) once I am sure about what I need to do. Also, my aim is to increase the total available application space, that's all! – user118383 Jan 17 '16 at 16:13
  • 1
    @abhishek_naik If the answer is useful, upvote it. if it solves your problem, accept it. – Faheem Mitha Jan 17 '16 at 22:05
  • @roaima if what you say is correct, the error message is extremely misleading and imo should be reported as a bug. – Faheem Mitha Jan 17 '16 at 22:06
  • @FaheemMitha it's documented, and it turns out that "ignored by filtering" is actually the correct message for the context. (Misleading? Yes. A bug? Probably not.) – roaima Jan 18 '16 at 0:10
  • I believe you. :-) It looks like the error message is issued because it matches something in the filter in /etc/lvm/lvm.conf. But at a minimum it could point the user to that config file... – Faheem Mitha Jan 18 '16 at 1:23

Your Answer

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