Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently tasked with bringing up a existing server to (at least more) professional standards - with as little disruption as possible to end-users. To have a proper rollback, I need to backup the existing server's root fs, which is currently ext4 inside a primary disk partition - not LVM, which would make the whole show a mere finger excercise. I'd like to avoid shutting down the server.

Is it even possible under these circumstances?

share|improve this question
up vote 8 down vote accepted

You don't need LVM. LVM just uses the device mapper, too. You can do that yourself. That may be a bit tricky with the root fs, though, as you probably have to modify the boot scripts.

You just need to put a DM device on top of the root device, e.g.

sectors="$(blockdev --getsz /dev/sda3)"
dmsetup create rootfs --table "0 ${sectors} linear /dev/sda3 0"

Something like this has to be put into the initrd boot scripts. Instead of /dev/sda3 you would then mount /dev/mapper/rootfs to /. Then you can make snapshots of the root fs (but have to do all the steps by hand with dmsetup; no black magic though). You just can't merge them back but that should not be a problem.

share|improve this answer
That is quite elegant. I'll read into that. Thanks. – Roman Feb 22 '13 at 13:53
If you manage to get your / mounted from /dev/mapper/rootfs (what IMHO every distro should do) then I can provide the code for snapshopt creation. I already do that: My LVs are exported to a KVM guest and appear there as regular disks. Thus I have to put DM devices on top of them. Not a big deal with non-root fs, though. – Hauke Laging Feb 22 '13 at 13:59

You can try BMR solution provided by bacula

share|improve this answer
No, I can't. This is for a completely different purpose. – Roman Feb 22 '13 at 13:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.