Advice on migrating from Ubuntu server to another server OS
Hi all. I'm currently running a home server using Ubuntu OS, but I'd like to try and explore other options for operating systems to better my skills with linux/unix.
Currently I'm considering switching to Fedora server (though feedback is welcome) because I've been running it as my daily OS for a few months now and I quite like it. I'm also looking at Debian server because that's what my old professor used and he did nothing but speak its praises.
Only issue is I'm concerned about data loss from moving the installation. Currently, the server is setup to run several Docker images running my programs. While moving over the images shouldn't be difficult whatsoever, I'm afraid my storage setup might not be so easy. Currently, it's two 4TB hard drives running in a logical volume. I'd love to simply be able to move over all the files to a backup drive, but I don't have anywhere I can store >5TB of files as a backup.
I googled around, but I couldn't find too many guides on migrating logical volumes. The one or two I did find were most definitely written for someone with far more linux knowledge than I have as a relative noob, so any advice would be extremely welcome!
just_another_person
in reply to kboy101222 • • •Fedora is great if you want a faster rolling release and you're already familiar with it.
Debian is great if you want a slower release schedule but stable LTS.
Two different use-cases, but both great options.
harsh3466
in reply to kboy101222 • • •kboy101222
in reply to harsh3466 • • •harsh3466
in reply to kboy101222 • • •Okay, more details will be required, but here's what I'm thinking will work.
One of the benefits of an LVM is its pretty easy to resize it.
The outline of what you can do is this (and we can refine the steps with more details)
Right now you've got your 8TB physical volume, and within that, you should have your volume group, and within that volume group, you should have one or more logical volums that are mounted for your system. The idea is to resize the existing logical volume by shrinking it, creating addition space within the volume group that can be used to create a new logical volume. Then, that new logical volume can be used to install Fedora.
Depending on how much free space you have on the entire physical volume, you could potentially dual boot Fedora and Ubuntu. Roughly speaking, the steps would look like this:
WARNING: These steps are not exhaustive because I don't know the full details of your system. This is not meant to be a guide for you to immediately implement and follow, but to help get you down the right path DO NOT FOLLOW THESE STEPS WITHOUT FIRST FULLY UNDERSTANDING HOW THIS WILL APPLY TO YOUR UNIQUE SYSTEM SETUP.
sudo whatever-the-package-manager-install-command-is lvm2
cryptsetup open /dev/your-disk-here name-of-your-volume-group
cryptsetup open /dev/nvme0n1p2 server
(I very creatively named my server volume groupserver
)df
command to see how much space is free in your volume group. The full command you'll want to run is:sudo df -h
lvm2
tools installed. The command to shrink the logical volume looks like this:sudo lvreduce --resizefs --size -1TB /dev/your-volume-group/the-lvm-name
IMPORTANT NOTES:
/boot
existskboy101222
in reply to harsh3466 • • •Thanks a ton for the very detailed reply!
First off, do you know a good command I could run to give you a better idea of my system's LV setup?
Secondly, I was hoping to fully migrate the data on my ubuntu server to a fedora or debian server rather than leaving it on the ubuntu server
harsh3466
in reply to kboy101222 • • •Happy to help!
lsblk
will give exactly the info needed. Copy the output oflsblk
and paste it into a reply and that will be perfect. Or a screenshot. Whatever's easier for youkboy101222
in reply to harsh3466 • • •Sorry this took a while, I got distracted. Trying to also learn Dart cause why not.
Here's the output of
lsblk
harsh3466
in reply to kboy101222 • • •Perfect. So you've got separate
/boot
and/boot/efi
partitions, which means dual booting will be much easier if you want to do that.The
ubuntu--vg-ubuntu-lv
is the logical volume you'll want to resize. So now we need to see how much space is available on the volume. To get that, run the commandsudo df -h
and paste that output into a comment.From there we can figure out how much space you have and how you might want to resize the volume to prep for a new install.
What is challenging about this is that your data is under your root (
/
) mount, which is also the ubuntu os. If in the end you want to entirely remove ubuntu, it'll be a little trickier than if your data was in a separate logical volume that you mounted into your root system during boot.For example many people have a separate logical volume for
/home
, which makes it easier to switch distros while preserving your home folder with all of your user data, config files, etc...But that's getting a little ahead of ourselves. Start with
sudo df -h
for the filesystem usage info and we can go from there.kboy101222
in reply to harsh3466 • • •sudo df -h
daftwerder
in reply to kboy101222 • • •kboy101222
in reply to daftwerder • • •Nanook
in reply to kboy101222 • •boblin
in reply to kboy101222 • • •kboy101222
in reply to boblin • • •Nanook
in reply to boblin • •Shareni
in reply to kboy101222 • • •What are you hoping to explore? Distrohopping servers is pretty much pointless, especially if you're using docker.
Like you're going to use dnf to install docker instead of apt, maybe configure selinux instead of apparmor, and that's it. Definitely not worth it IMO.
Nanook
in reply to Shareni • •Fecundpossum
in reply to Shareni • • •Nanook
in reply to Fecundpossum • •LeFantome
in reply to kboy101222 • • •If you want to use it as a server, Fedora is annoying because the support lifetimes are so short.
If you want the Fedora / Red Hat experience, consider Alma Linux. Skills wise, it is like using Res Hat Enterprise Linux (RHEL) which is an in-demand skill set.
Nanook
in reply to kboy101222 • •DigitalDilemma
in reply to kboy101222 • • •For a server os, do things like consider stability and ease of upgrading between major versions.
Debian does both of those things extremely well.
If you're playing around with changing distros and your data is valuable, I'd try and find somewhere to back it up to, myself.