2

I am trying to setup LVM for my netbook's two, small SSDs (4 & 8GB). After a lot of trial and error, I followed this walk-through: How to Set Up Multiple Hard Drives As One Volume. I have completed the steps for my 4GB volume (/dev/sda) and successfully set up a VG ("vgsystem") and LV ("lvfacade"). However, when repeating the steps for the 8GB volume (/dev/sdb1), I was unable to extend "vgsystem" to include /dev/sdb1 because I had added it to a VG ("vgsystem2") earlier. How can I remove "vgsystem2" and add /dev/sdb1 to "vgsystem"?

I appreciate the help.

Chad
  • 23
  • 1
  • 7

1 Answers1

0

vgremove vgsystem2

vgextend vgsystem /dev/sdb1

I am assuming that /dev/sba1 on the last line actually means /dev/sdb1

Edit 1

You don't need to run partprobe after the reboot. But it wouldn't hurt.

pvscan tells you that you have 2 lvm2 devices (/dev/sda1 and /dev/sdb1). In addition to that sda1 is fully used for volume group vgsystem.

Not surprisingly pvcreate fails because /dev/sda1 is already a physical volume.

Not surprisingly vgcreate fails because vgsystem already exists.

/dev/sda1 looks a bit small. Do you have /dev/sda2 or perhaps unpartitioned space on /dev/sda?

I am not sure what you are trying to achieve

If you want to remove VG vgsystem from /dev/sda1 use pvremove vgsystem

If you want your 2 devices to be treated as a single logical volume you need to expand volume group vgsystem to sdb1 and then create a logical volume:

vgextend vgsystem /dev/sdb1
lvcreate -l 100%VG -n lvsystem vgsystem

then you should be able to make a filesystem on /dev/lvsystem, mount it and use it.

Edit 2

Umm, I haven't forsaken you. Please re-read what I wrote between Edit 1 and Edit 2. Did you try running any of the commands? What was the output? What is your answer for "Do you have /dev/sda2 or perhaps unpartitioned space on /dev/sda?"?

It would be nice to know what exactly are you trying to achieve. This will help me help you.

sмurf
  • 4,680
  • I may have tried that previously, but answered the questions following the command 'yes', then 'no':

    "Do you really want to remove volume group 'vgsystem2' containing 1 logical volumes? y [ENTER] Do you really want to remove the active logical volume lvfacade? no [ENTER]. Logical volume lvfacade not removed"

    It appears that I have to remove the LV as well. If this is correct, then I'll have to start everything from scratch, right?

    – Chad Apr 30 '14 at 14:35
  • Well, your question suggests that you crated LV lvfacade in VG vgsystem. The latest error message however suggests that LV lvfacade is placed on VG vgsystem2. Could you post here the outputs of "sudo pvscan", "sudo vgscan" and "sudo lvscan" – sмurf Apr 30 '14 at 23:27
  • I ended up removing all volume groups and the logical volume last night (9:30am now). So, sudo lvscan & vgscan output "No volume groups found". pvscan ~> "No matching physical volumes found". After removing everything, I tried walking through the how-to (posted in original question) and hit a roadblock when I got here: "sudo pvcreate /dev/sda1" ~> "Device /dev/sda1 not found (or ignored by filtering).". Then, I tried "sudo vgcreate vgsystem /dev/sda1" ~> "/dev/vgsystem: already exists in filesystem New volume group name 'vgsystem' is invalid Run 'vgcreate --help' for more information." – Chad May 01 '14 at 00:20
  • Try these 2 commands:

    partprobe /dev/sda

    partprobe /dev/sdb

    They inform the kernel about any changes in the partition tables. Then start again from the pvcreate command.

    – sмurf May 01 '14 at 01:28
  • 'sudo partprobe /dev/sda' ~> "Error: Partition(s) 1 on /dev/sda have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes." 'sudo partprobe /dev/sdb' executes with no errors or messages. I'll reboot and see what happens. – Chad May 01 '14 at 03:21
  • After restarting, 'sudo pvscan' ~> "PV /dev/sda1 VG vgsystem lvm2 [252.00 MiB / 0 free] PV /dev/sdb1 lvm2 [7.51 GiB] Total: 2 [7.76 GiB] / in use: 1 [252.00 MiB] / in no VG: 1 [7.51 GiB]" – Chad May 01 '14 at 14:13
  • After 'sudo partprobe /dev/sda' and '.../sdb', I tried 'sudo pvcreate /dev/sda1' ~> "Device /dev/sda1 not found (or ignored by filtering)." (Again.) Also, 'sudo pvdisplay' executes with no comments. – Chad May 01 '14 at 15:30
  • This doesn't make sense to me: "ubuntu@ubuntu:~$ sudo vgcreate vgsystem /dev/sda1 /dev/vgsystem: already exists in filesystem New volume group name "vgsystem" is invalid Run `vgcreate --help' for more information. ubuntu@ubuntu:~$ sudo lvcreate -l100%FREE -nvolume vgsystem Volume group "vgsystem" not found" ...How can the VG already exist, yet not be found? – Chad May 01 '14 at 15:49
  • Smurf! Why have you forsaken me!?! – Chad May 17 '14 at 07:29
  • @sмurf: please, please, please use the Help link and format your answer. – 0xC0000022L May 18 '14 at 23:46
  • @Smurf: Thanks for sticking with me. I've made my way back to this issue and here are printouts for PVSCAN: PV /dev/sda1 VG vgsystem lvm2 [252.00 MiB/0 free] PV /dev/sdb1 VG vgsystem lvm2 [7.51 GiB /0 free] Total: 2 [7.76 GiB]/ in use: 2 [7.76 GiB]/in no VG: 0 [0] VGSCAN: Found volume group "vgsystem" using metadata type lvm2 and LVSCAN**: ACTIVE '/dev/vgsystem/lvsystem' [7.76 GiB] inherit So, it appears that there is unpartitioned space on /dev/sda, the 4GB drive. How can I go about tackling this issue? – Chad Jun 28 '14 at 06:08