SOLVED: How to delete LVM partitions in old HDD to be used as /home

Forum rules
Before you post please read this
Post Reply
User avatar
JesperE
Level 1
Level 1
Posts: 6
Joined: Sun Oct 13, 2013 5:53 am

SOLVED: How to delete LVM partitions in old HDD to be used as /home

Post by JesperE » Sat Jan 27, 2018 4:59 pm

I've got a new laptop with a small but fast SSD which is superb for my root partition, but way to small for my /home partition. The old laptop was therefore cannibalized for (among other things and most importantly) its large HDD, to be used as /home partition in parallel with the built in SSD as root partition (and boot and swap). Since I was in kind of a hurry when I installed Mint whatever-it-might-have-been-some-5-years-ago over the pre installed Win7 on the old HDD, it has some strange partition scheme. Now it has a complete OS on it (Mint 18 -something), in a single extended partition containing no less than three (3!) root partitions, one /home and a swap (apart for the boot partition, which was of course a small primary partition of its own, however now deleted by me) all of which is both logical partitions (since it's in an extended partition) and logical volumes with the file system extension lvm2.

The HDD mounts fine and I can access everything on it as expected, but somehow I can't erase the old partitions within the extended partition even when its unmounted. The only partition I want to have left in the old HDD is the old /home, so that I can make that the /home for the new system.

I've used Linux for quite some time and I'm fairly familiar with its workings, but I'm still just an end user and English is not my primary language (thanks Firefox for the spellchecker...). I understand English well, but I'm at loss when it comes to abbreviations, slang and jargon (hence my stiff language). Additionally I'm not at all proficient in LVM and didn't even know about its existence before I installed Mint 18 on the old computer and was prompted if I wanted to use it, and with some old partitioning problems in the back of my head I was seduced by the description "to make later changes in the partitions easier". The tools I've tried to use is system-config-lvm, Gparted and of course the command line for the snippets here. I prefer GUI's whenever possible.

Code: Select all

me@my_computer ~ $ sudo pvs
[sudo] password for me: 
  PV         VG      Fmt  Attr PSize   PFree
  /dev/sda3  mint-vg lvm2 a--  118,26g    0 
  /dev/sdb5  mint-vg lvm2 a--  698,16g    0 
me@my_computer ~ $ sudo vgs
  VG      #PV #LV #SN Attr   VSize   VFree
  mint-vg   1   3   0 wz--n- 698,16g    0 
  mint-vg   1   2   0 wz--n- 118,26g    0 
me@my_computer ~ $ sudo lvs
  LV     VG      Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  home   mint-vg -wi-a----- 630,00g                                                    
  root   mint-vg -wi-------  60,27g                                                    
  root   mint-vg -wi-ao---- 110,80g                                                    
  swap_1 mint-vg -wi-------   7,88g                                                    
  swap_1 mint-vg -wi-ao----   7,46g                                                    
me@my_computer ~ $ sudo fdisk -l
Disk /dev/sda: 119,2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 91C7342C-730B-457B-A46B-C951E3667FF7

Device       Start       End   Sectors   Size Type
/dev/sda1     2048   1050623   1048576   512M EFI System
/dev/sda2  1050624   2050047    999424   488M Linux filesystem
/dev/sda3  2050048 250068991 248018944 118,3G Linux LVM


Disk /dev/sdb: 698,7 GiB, 750156374016 bytes, 1465149168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x77f897a3

Device     Boot   Start        End    Sectors   Size Id Type
/dev/sdb2       1001470 1465147391 1464145922 698,2G  5 Extended
/dev/sdb5       1001472 1465147391 1464145920 698,2G 8e Linux LVM

Partition 2 does not start on physical sector boundary.


Disk /dev/mapper/mint--vg-root: 110,8 GiB, 118975627264 bytes, 232374272 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/mint--vg-swap_1: 7,5 GiB, 8006926336 bytes, 15638528 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/mint--vg-home: 630 GiB, 676457349120 bytes, 1321205760 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Gparted shows a single partition representing the physical volumes of the lvm, and only in the information window will it show the logical volumes. So that leaves them unmanageable through Gparted. I guess that's just how it's supposed to be, I've read that Gparted doesn't fully support LVM. To bad for me, for I have some understanding of that interface.

system-config-lvm shows all the volumes, both physical and logical, as expected, but I don't seem to be able to single them out. In the physical view I can see which volumes I wish to delete, but in that view I don't seem to be able to do just that. In the logical view I can edit the properties including deleting (presumably - there is a button for it but I havn't tried it...) but in that view I can't differentiate the root or swap in the old HDD - which i want to delete - from the ones in the new SSD - which I want to keep. (Ok, the swap is no big deal, easy enough to replace, but the root!)

I'd greatly appreciate any help!

Edit: SOLVED:

By looking closer at the numbers presented by the commands pvs and lvs and comparing them I found that I could deduce the size of the partitions I wished to delete, and those where in fact the partitions that where shown in logical view of system-config-lvm. I'm really sorry if it seems like I didn't empty all options before asking for help, but I really thought that the ones shown was some kind of conglomerate of all the physical volumes with the same name. After all, where else would the ones from sda3 go otherwise? But since it was only the ones in sdb5, I deleted them. I suppose that it was just the ones that were in an unmounted drive and therefore editable? For why else would not the ones in sda3 be visible? If someone have another suggestion, please correct me - I'm just guessing here...

Post Reply

Return to “Mounting Partitions”