Lvm – Completly remove Linux LVM

lvm

Is it possible to remove LVM from an existing Linux server without data loss?
For some reasons I prefer to manage the disks with gparted and I need to increase the partition size.

I read a lot about LVM and at the end I decided to stay with gparted. I feel more confident with it and using a virtualized environment (VMware based) I don’t need the LVM layer.
Unfortunately a previous server was formatted with LVM and below there is the partition table. I can go offline so my thought was to recreate the same linux server and copy all file using rsync. Is there another way?

faser@bacardi:~$ sudo fdisk -l
Disk /dev/sda: 85.9 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b665f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          32      248832   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              32       10444    83634177    5  Extended
/dev/sda5              32       10444    83634176   8e  Linux LVM

root@bacardi:~# mount
/dev/mapper/mojito-root on / type ext4 (rw,errors=remount-ro)
/dev/sda1 on /boot type ext2 (rw)

Best Answer

If you have plenty of space available, the ability to boot to some off-line media, and a good understanding of partitioning and filesystem creation, then you could probably do this.

If you can't go offline, or you don't have plenty of spare space, then you will find this pretty difficult.

I have no idea why you wouldn't want to extend your volumes using LVM though. It is very easy, and can be done on-line.

Related Topic