6

I have workin Ubuntu instance. Now I decided to refuse of LVM usage. Can I disable LVM and reformat filesystem so that regular file system will be used?

zubactik
  • 163
  • 2
    What should work is backing up the whole system and restoring it on a freshly partitioned and formatted disk. Or just backup data and reinstall without LVM, that's what I once did, but it was only a week or so after my first installation, so there was no important data on it yet. I am curious if it is possible directly, but I don't really think so... – Byte Commander Apr 21 '15 at 12:45
  • @ByteCommander, sure. I think so too. I hoped that there is some way or tool which allow me to do it as you called "directly" – zubactik Apr 21 '15 at 13:07

1 Answers1

2

That's actually easier than you'd think: If you have a spare-partition or -harddisk around that is at least the size of the logical volume that you'd like to convert to a partition, you can easily do this with dd.

Imagine that /dev/vg/volume is a logical volume that consists of only one partition, /dev/sday:

# dd if=/dev/vg/volume of=/dev/sdbx bs=8M
# dd if=/dev/sdbx of=/dev/sday bs=8M

That's it. This will back up the logical, continuous data that's hosted on the lvm to a partition. After the first dd you'll be able to mount /dev/sdbx and see how the content of /dev/vg/volume has been copied.

check the source

Maythux
  • 84,289
  • Thanks a lot! You recalled my experience when I duplicate one image on multiple disks with dd command! I forgot about it) – zubactik Apr 22 '15 at 10:55
  • @zubactik You are welcomed – Maythux Apr 22 '15 at 10:59
  • 2
    And what about whole disk? I doubt that it's as easy as you say. I have working installation of CentOS on SD-card with swap XFS and LVM partitions. How can I safely convert it to usual ext4? – Suncatcher May 10 '18 at 16:11