Hi,
Just wanted to ask if it is possible to clone an installed system on EXT4 to another partition formatted in btrfs.
I suppose you could rsync
the files across. Personally I’d get a list of user installed packages and reinstall them on a new install. If you have customized config files in /etc
copy them across too along with whatever is in your home folder.
You are right. This must be the most straightforward approach. I am in the process of “shuffling” around my disks/systems and I thought I will redo everything in btrfs. Mostly because of its snapshot capability, giving me some peace of mind. Thanks for the reply! I appreciate it.
There is a way to convert an ext4 partition to btrfs with an inbuilt utility, I haven’t tried it myself but it seems pretty straight forward. Might be an option if you don’t plan on keeping the ext4 after you’ve moved over to btrfs.
When I was messing with this stuff I broke it down into 3 things:
- System updates: don’t care, pacman is fast and simple.
- Applications: can be re-installed, making a list for pacman to use is easy.
- Desktop config - this is all in ~ so simply backup hidden files ie .kde .config .local. Any backup software will do but kde kup is nice.
- What’s left? logins and resets for things like Steam, and these are always flaky, best to begin again.
My conclusion was I would either fsarchiver the whole thing or start from scratch as above, there is no point to a middle ground, re-installing with foresight is simply too practical.
No, I won’t be keeping the EXT4. So this seems definitely interesting.
I tried btrfs-convert twice and it failed both times, I wasn’t doing anything edge-case.
The most important to move over is the content of my home and also all the dot files and folders. I’ve got some custom configs as well so I guess I just could back up the whole /etc as well and copy over to the new install. The rest, as you say, is easy to reinstall.
Then reinstall it is!
Thank you both, @alenbasic and @robgriff444!
It’s definitely better to include what you need rather than exclude what you don’t, but I’ve never done a whole /etc as I have never needed to.
Ok. I could just backup those files I know I have modified in /etc. They aren’t that many.
By the way, regarding making a list of installed packages, should I be looking into:
https://wiki.archlinux.org/index.php/Pacman/Tips_and_tricks#List_of_installed_packages
Yeah that’s the thing, but I never used it because for years now (coz Linux isn’t finished yet lol) I create an installation document where I record everything I do on a 1st install, including the names of every package I install.
So I can easily do everything again if I have to re-install (without having to try and find everything on google).
I would never do this. It’s one thing doing this with secondary drives / partition, a installed OS to a different file system simply no.
Yes. I have multiple systems spread across a couple of SSDs.
I relocated a number of these encrypted systems to a new SSD recently, and cloned a system too. Re-installing is not necessary at all.
The same process should allow you to clone your existing system to a different partition and file system.
This is not a cut and paste tutorial, read it and understand how it would apply to your situation.
If your system is not encrypted then just obviously ignore the cryptsetup bits.
You must ensure your new btrfs partition is correctly configured and mounted before rsyncing your ext4 system to it.
Will you have a separate efi partition for you system? If so create it with the appropriate flags before chrooting and installing grub.
If you are unsure probably best to do a couple of test runs in Virtualbox, to iron out any kinks before going bare metal.
NOTE : This applies to cloning a system on the same physical machine, where drivers and driver config would the same. Cloning a system to a different physical machine is probably more trouble than its worth.
Thanks @otherbarry for taking your time to reply! Great post! I’ll read through the thread you have linked to . I’ll get a new disk soon. So I’m quite excited to make this one way or another.
Thanks again
This is something I keep telling myself that I should be doing before every new install and yet …
It is a very good advice. I just need to put it in practice. Maybe this time is the right time.
I also use a dropbox folder for this stuff and I have symlinked files such as ~.bash_aliases to the ones on dropbox - I try to set it up so nothing is lost, data or knowledge (TBH partly because I have memory problems).
All my installation files are on dropbox so on any new install I just install dropbox and then I have access to my symlinked files and instruction document to copy / paste instructions from.
If it seems a bit much to achieve, just create the file and add something you’ve just done, and that can give you a sense of direction. You can then adjust and add bit by bit and after a while it will have a life of it’s own.
I can send you mine if you think it could be helpful.
I’ll having a new disk and whether I will clone my current installation or just go for a fresh install, I will put this into practice.
Thanks for your kindness and all the great tips!