How do I correctly migrate my var partition (or whole lvm pv) to a new (and larger) drive?
Asking here because other posts on the internet already showed me how to move the pv itself over, however it got stuck at a prompt saying "Cannot access console, root user is locked" after a what seems like having successfully moved the pv, and seeing the Vanilla boot logo on screen for a while.
#Correctly migrate var to a new drive?
17 messages · Page 1 of 1 (latest)
(related question, not an answer, sorry, but how to properly backup an entire VOS installation to be able to recover from a disaster?)
I'd guess for backup and disaster recovery purposes an entire drive clone would do the trick well enough.
Tho that might be an issue if you don't have another drive the same size (or larger) as your main one, in that case, or any for that matter, you should back up your stuff in your /home directory.
Backing up the /var folder will actually make an almost perfect backup.
If you restore this folder in a new install you will have the exact same state.
There is only one exception and that is the /etc folder. That has an A and a B state so which state will be restored depends on the the current state during backup and during restoring. Both should work though.
I would only recommend doing this in a live system, not in Vanilla itself.
The easiest method is probably:
- Create a new var partition
- Clone everything from the old one into the new one (make sure to keep users, groups and permissions of the files)
- Remove the "vos-var" label from the old partition
- Give the new partition the "vos-var" label
- done
You can probably also add a new pv to the vg, and then somehow remove the old pv, but I don't know how to from the top of my head.
(The partition doesn't have to be inside an lvm btw)
Yeah I did everything on the Vanilla live iso. Here's, in essence, what I did:
I installed Vanilla on the new drive, creating the boot master, efi, vso-root and a vso-var*. Then I resolved the duplicate labels, got rid of the var partition of the new vso-var, merged both vso-var's into the same group using vgmerge and moved the data via pvmove. Then used vgsplit to split off the old drive.
And that is how I got to the point where I get the "Cannot access console, root user is locked" in emergency mode.
*It's not possible to install Vanilla while lvms with the same labels exist as the hardcoded ones Vanilla uses exist. I just took the old drive out lol
- Clone everything from [...]
Do you mean on an lvm or file level?
Noted. Thought I'd do it proper lol
At this point the "Cannot access console, root user is locked" is the only issue I have no clue how to resolve. (So for now I just mounted var and copied everything out with cp)
Yeah, the installer should warn you that its gonna remove the old stuff though.
file level with "cp -a" or "rsync -a"
I mean the problem is that it's entering emergency mode because something is messed up.
Not being able to log into the root user is by design.
it didn't say anything about getting rid of the old volumes (on either drive, when there were duplicated vg labels that is), instead it just began and then failed the installation process. tho I get why this might be better than it sounds, just throwing out whatever data is in there would be an immense data loss.
Ah yeah, right. It will only remove lvm stuff if you install over existing PVs.
(and warn you about it)