User:Void/Recovery

Reference for some tools used in recovery

LVM

 * use  to activate and   to deactivate.


 * almost never works, but can be worth a try (leaves a copy of broken metadata we can work with to repair later with other tools)
 * replace damaged metadata of  with


 * do not activate LVM after creation
 * do not zero out LVM
 * create with 2GB allocated
 * thin
 * create with name repaired
 * specify volume group at end

Dumps a repaired XML of the metadata.

Puts repaired metadata on  lvm.

When repairing metadata, first create repaired LVM activated, dump good metadata to LVM, then disable LVM, before running  to put the metadata in the pool.

Overlays
I love me some good overlays

run by itself give a list of loopback devices and where they are pointing
 * find next device
 * create read only
 * when used with, output the name of the selected loopback device
 * point loopback device at this file (or device)


 * show active device mappers. Can specify a name to filter by.
 * this is funky, as we will need to pipe in some table information.

You might for example do,

In both examples,  must be , and   is the block size of the device (can fetch with   or  ).

is the device your overlay is reading from at the bottom (basically).

is the offset in blocks from the start of your device to start reading from.

is the device that gets written to when doing a snapshot, generally a loopback device pointing to an overlay file.

stands for ersistent or  ot.

means block size (in KB?) for changes to get written to the overlay device. IDK how this works generally just use  or something.

creates a 10GB file called overlay without needing to write anything (instantly allocated in file system)

The steps you would take to create an overlay for a device would be:

If you want to ensure it is read-only:  then replace   with returned loopback interface.

The device you want will then be in. To reset your changes:

If you need to access a partition in a loopback device and are having trouble, first find the size and offset of the partition using  and leave these as block sizes.