Beiträge von Methanoid

    Done. Wasn't difficult and didnt need the backup partition AND snapshot I took just in case. In short:


    Boot Gparted Live CD

    Shrink sda2 down from 1Gb to 200MB [ was using under 100MB so reclaimed that space)

    Resize/move sda3 to make space to create sda4 for backup [ wasn't needed, just resize to gain the 800MB from above]


    Boot Ubuntu 20.04 LiveCD

    At installer Ctrl-Alt-F2-F6 to drop to tty

    sudo -s


    -------not needed--------

    mkdir /home/old

    mkdir /home/new

    mount /dev/sda3 /home/old

    mount /dev/sda4 /home/new

    rsync -avxHAX --progress /home/old/ /home/new/

    -------not needed--------


    apt update && install fstransform

    fstransform /dev/sda3 btrfs --force-untested-file-systems

    blkid /dev/sda3 [get UUID for fstab]

    nano /etc/fstab

    [fix root entry ] UUID=xxxxxxxxxxxxxxxxx / btrfs compress=zstd 0 0

    mount /dev/sda3 /mnt

    mount --bind /dev /mnt/dev

    mount --bind /proc /mnt/proc

    mount --bind /sys /mnt/sys

    chroot /mnt

    mount /dev/sda2 /boot

    update-initramfs -u

    update-grub

    reboot


    All should be done, but then


    btrfs filesystem defragment -r -v -czstd / [FORCES RECOMPRESSION]

    The end of standard support of Ubuntu 18.04.6 LTS will be in June of 2023, so in about 3 months (!) ( https://wiki.ubuntu.com/Releases )


    "Extended Security Maintenance" will be available until April 2028, but you will need a subscription for this. Not having such a subscription will be the same as using an unpatched system for months and years on the internet. A system which will be taken over.


    Ubuntu 22.04.2 will have standard support until April 2027. So if you want to have BTRFS and at the same time secure your server, this would be the right opportunity to backup and reinstall.


    Interesting but not relevant when my application does NOT run on 22.04 or 20.04... :(

    Not sure if it's feasible to do the conversion on an existing system.


    As far as clean installs go, you can mount the Ubuntu live ISO and go through the installation on your own, there you can also create your custom partition layout.


    Could I not boot the installation ISO and then use that to do the modification to my existing install with the fstransform tool and (presumably) editting the fstab after that ?? Seems theoretically possible but I'd not be confident and dont want to trash a system I use daily!

    Anyone know how to convert EXT4 in Ubuntu 18.04 to something like BTRFS so I can have file compression on the OS files? Anyway to do with a live system too?


    Would make sense if the Netcup installed images had this set by default really....


    SE = Special Edition. Will come with better specs. My last VPS 2000 SE came with 480Gb SSD so if it is anything LESS than that I may as well not bother and keep with existing deal as its same price now. I'm hoping its a 640Gb SSD

    Nope, complete failure... If I boot new server into Gparted it reports corrupted GPT table...


    I have wasted more than enough time on this.. (surprised Netcup dont provide a migration guide themselves)


    I'm rebuilding new server and copy across odd files as needed. It's tedious but it *will* work

    Thanks AGAIN guys. The resize worked fine with Gparted overnight. And I can access system fine. Rebooted both into Rescue system and running DD now.


    FYI, 1Gb isnt accepted as block size neither is 1G (it stopped after about 5M). Basically all large sizes gave incomplete reads.


    dd if=/dev/sda bs=1M count=200000 status=progress | ssh root@aaa.bbb.ccc.ddd dd of=/dev/sda bs=1M count=200000


    Seems to be working (I've got about 180GB to copy).


    ThomasChr so where do I get these badges then? :) Seriously though, I'll be happy if it works!


    EDIT: Barfs, with several possibilities... Incomplete reads (can be over-ridden) but more importantly stops after about 3GB (first 2 partitions, isnt doing the important one!)


    UPDATE: dd if=/dev/sda bs=2M status=progress | ssh root@1aaa.bbb.ccc.ddd dd of=/dev/sda bs=2M Seems to get past the 3GB mark, but without count I will just have to manually stop it once its done comfortably past 180GB....


    That SHOULD work???

    ThomasChr  7c00 I am really grateful for your time and patience - THANK YOU


    I have managed to resize Old server partition back to original size AND repair the damaged inodes etc with GRML liveCD and e2fsck.ext4

    https://linuxexpresso.wordpres…xt4-superblock-in-ubuntu/ helped


    I can now boot my OLD server.


    Now if I want to try again the DD route (as I am finding the re-install tedious and forget some of the tricks used when I built server in 1st place)...


    (1) Resize with Gparted (NOT parted) and test the Old server boots and still works fine with smaller partition size. Let's say I make it 100GB


    (2) Login to Old server and copy with DD to new server @ IP aaa.bbb.ccc.ddd


    dd if=/dev/sda bs=1Gb count=101 status=progress | ssh root@aaa.bbb.ccc.ddd dd of=/dev/sda bs=1Gb count=101


    (3) Resize New Server /dev/sda3 to max size using Gparted


    (4) My domain points to old IP so fix that to new IP.


    Anything else? I think it best I confirm BEFORE i do..... ;)

    I've given up... I'm just building the new server from scratch but any clever ideas that would help me resuirrect old one would at least let me get access back to configs and check and make sure I dont get anything wrong on new one.


    So I just want to be able to get the /dev/sda3 back and accessible by SSH

    Thanks 7c00 but clearly I have mucked something up. It's ALL a complete mess now...


    My old server (resized partition to bring the contents under 480GB) is broken. It boots from Grub but reports file system errors and says to run fsck on /dev/sda3


    I run fsck /dev/sda3 and that says superblock checksum does not match superblock, tries backup blocks and then reports errors eg Error writing block 80740353 (Invalid argument) Ignore Error (y/n). No doesnt fix it and neither does Yes....


    Now I have NO working servers...

    Thanks, well I am assuming (probably killing years of work) that its /dev/sda rather than /dev/vda since there is no such device on my server


    And we are finally off (after typing correct root password MANY times only to be told it was wrong.. I bypassed that by using VNC to set a new plain text simple password)... and we're running in Putty+SSH rather than VNC which was a nightmare....


    Then presumably I just need to adjust my DNS/MX records or whatever point my domain to this server and i should be good...!

    Thanks... well I failed already as I cannot type | in the damn VNC screen window.. and can't login to old server with SSH as its in Rescue mode and root password (given by Netcup controlpanel) does not work. It ISNT straightforward


    EDIT: Right resized, found | on the # key where ~ is the shifted character... Great!? Now try again

    I just upgraded from a 2018 or 19 offer to a 2020 offer.... All better than previous (current) server except less storage.


    I dont want to have to set up everything from scratch again so whats the best way to clone my Ubuntu 18.04.5 LTS system to the new box and then retire my old server? Assume low level of knowledge of Linux please when advising me!! ;)


    Thanks