-1

Im trying to create a volume but get the below error.

p@prem-ubuntu:~$ df -h
Filesystem           Size  Used Avail Use% Mounted on
udev                 7.6G  4.0K  7.6G   1% /dev
tmpfs                1.6G  1.2M  1.6G   1% /run
/dev/sda1            455G   13G  419G   3% /
none                 4.0K     0  4.0K   0% /sys/fs/cgroup
none                 5.0M     0  5.0M   0% /run/lock
none                 7.6G   85M  7.5G   2% /run/shm
none                 100M   56K  100M   1% /run/user
/home/prem/.Private  455G   13G  419G   3% /home/prem
/dev/sdd1            459G   70M  435G   1% /media/prem/01468503-2551-4d1d-b994-45bf210ee2c2
/dev/sdd2            220G   60M  209G   1% /media/prem/1c6825c4-b0d7-4cf1-b589-96ca774d7fad
p@prem-ubuntu:~$ sudo vgcreate mynew_vg /dev/sdd1
  No physical volume label read from /dev/sdd1
  Can't open /dev/sdd1 exclusively.  Mounted filesystem?
  Unable to add physical volume '/dev/sdd1' to volume group 'mynew_vg'.
prem@prem-ubuntu:~$ sudo vgcreate 

mynew_vg /media/prem/01468503-2551-4d1d-b994-45bf210ee2c2
  Device /media/prem/01468503-2551-4d1d-b994-45bf210ee2c2 not found (or ignored by filtering).
  Unable to add physical volume '/media/prem/01468503-2551-4d1d-b994-45bf210ee2c2' to volume group 'mynew_vg'.

How do I create my logical volume should I use my device location or should I use my mount location? Both are failing currently.

user1050619
  • 119
  • 1
  • 6

1 Answers1

1

First, /dev/sdd1 is mounted. Why on earth would you operate on a mounted file system? The error message and df output makes that very clear - did you read it and at least try to understand what it means?

If you decide that /dev/sdd1 doesn't contain anything and can be converted to a LVM volume (this will mean data loss for everything on that volume) , then you can unmount it and mark it as a physical volume for LVM use with pvcreate.

After that, you can create your volume group.

Sven
  • 98,649
  • 14
  • 180
  • 226