update ubuntu lts

Discussion in 'HOWTO-Related Questions' started by kwickcut, Apr 1, 2020.

  1. kwickcut

    kwickcut Member HowtoForge Supporter

    i am currently running ubuntu 16.04 and i would like to upgrade to 18.04 or maybe 20.04. i seen that there was a how to for ubuntu 12.04 to 14.04 https://www.howtoforge.com/tutorial/ubuntu-lts-update-dist-upgrade/ and was wondering if i could use this for my server. if not is there a how to for what i am looking to do..

    thanks in advance

    kwick
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I would trust more Upgrade instructions provided by Ubuntu:
    https://help.ubuntu.com/lts/serverguide/installing-upgrading.html
    That instruction does not mention taking backups. Do not be fooled by that, make backups first.
    Note that info applies to server version of Ubuntu. On desktop search for corresponding info for Ubuntu Desktop.
     
  3. kwickcut

    kwickcut Member HowtoForge Supporter

    so i found this and it seems to be pretty straight forward

    log in then change to root
    Code:
    su -
    enter root password

    then make sure you are in root
    Code:
    cd /
    then run
    Code:
    tar cvpzf ubuntu_16.04.tgz --exclude=/proc --exclude=/lost+found --exclude=/ubuntu_16.04.tgz --exclude=/mnt --exclude=/sys / 
    would this cover the backup or would i need to do something different

    thanks again

    kwick
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Where did you find it?
    The same Ubuntu documentation site I already gave you the link to has also info on backups:
    https://help.ubuntu.com/lts/serverguide/backups.html
    When taking backups, consider how you can restore from that backup. If your want to restore a complete working system after the update completely hoses your system, that backup you found may work but it is complicated to restore. I would use Clonezilla or Ghost to make image copy of disk. Then that image can be used to restore computer to same state it was and it can boot the same way since complete disk including boot sector is backed up to the image.
    If the host is a virtual machine, they can be backed up to a image that can be restored or copied to be restored somewhere else.
    Important things to backup are those that can not be found elsewhere or are laborious to recreate. If you backup files, the operating system files can be found from the operating system installation medium. User home directories are usually important, worth backing up daily. For adminstrator, on linux the /etc contains configuration settings for software installed on the host, so are worth backing up because without those the admin has to figure out how to configure all the softwares. Depending on what the host is used for, there may be important files somewhere else, too. For example databases or database dumps.
    I prefer Debian GNU/Linux to Ubuntu, one reason being better upgrade instructions. They even have chapter about what to back up: https://www.debian.org/releases/stable/amd64/release-notes/ch-upgrading.en.html#data-backup
     
  5. kwickcut

    kwickcut Member HowtoForge Supporter

    this is the site i found the info on it seemed to be straight froward. i will look into clonezilla as well .
    https://ubuntuforums.org/showthread.php?t=35087

    thank you

    kwick
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    That forum article is from year 2005. It even tells at the beginning to instead see more recent info from help.ubuntu.com.
    If you need daily backups that can be easily restored, there is BackupPC. You would need another computer where to run BackupPC, though. https://www.howtoforge.com/linux_backuppc That tutorial does not have publication date visible, though. I suspect it is rather old, so prefer using the original BackupPC installation manual and documentation.
     
  7. kwickcut

    kwickcut Member HowtoForge Supporter

    i have followed the script and made a backup and everything worked as it should as far as i can tell.

    i entered mnt
    Code:
    cd /mnt
    then i made file backup.sh
    Code:
     touch backup.sh 
    then added directory backup
    Code:
     mkdir - make backup 
    then i ran
    Code:
     chmod u+x backup.sh 
    and then
    Code:
     ./backup.sh 
    i then checked the file and everything was backed up as the script in backup.sh stated
    Code:
    #!/bin/bash
    ####################################
    #
    # Backup to NFS mount script.
    #
    ####################################
    
    # What to backup.
    backup_files="/home /var/spool/mail /etc /root /boot /opt"
    
    # Where to backup to.
    dest="/mnt/backup"
    
    # Create archive filename.
    day=$(date +%A)
    hostname=$(hostname -s)
    archive_file="$hostname-$day.tgz"
    
    # Print start status message.
    echo "Backing up $backup_files to $dest/$archive_file"
    date
    echo
    
    # Backup the files using tar.
    tar czf $dest/$archive_file $backup_files
    
    # Print end status message.
    echo
    echo "Backup finished"
    date
    
    # Long listing of files in $dest to check file sizes.
    ls -lh $dest 
    now i have 2 questions
    1) now if i wanted to backup everything in my root what would i add to the backup.sh ?
    i have looked and could not find the install for clonezilla for ubuntu 16.04
    2) is there any howto for installing clonezilla
    i have tried several times to install and each time i get this message at the end
    Code:
      E: Sub-process /usr/bin/dpkg returned an error code (1) 
    thanks once again

    kwick
     
  8. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    1) Script already backs up /root. Or, if by root you mean the / partition, do not back up that. Or if you do, you have to exclude from the backup all the virtual files like /proc and /tmp etc. directory trees that just break you backup.
    2) Instead of blindly apt get installing stuff, read the instructions first. You would have discovered you should not install Clonezilla on your server, but instead create a bootable CD or USB stick with Clonezilla. https://clonezilla.org/
     
  9. kwickcut

    kwickcut Member HowtoForge Supporter

    thank you for all your help so far. i have downloaded and burned an iso of cloenzilla i rebooted the server selected make iso backup then selected the destination drive to save the backup to, then selected the 250 gig drive i wanted to make the iso of. it was going well and about 1 hours into the backup the time went from 2.5 hours to 18 hours then about 15 minutes later it went to 36 hours.. the speed of the backup did not change only the time did. is there something faster or differently i should be doing? i can not leave the server down for 36 hours. thanks once again

    forgot to add the backup drive is a 500 gig on board drive that i added for the sold purpose of backing the server up
    kwick
     
    Last edited: Apr 5, 2020
  10. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    How can Clonezilla be used to make iso backup? Maybe I do not understand what an iso backup is? Maybe you are using the advance options, I have never needed to use those.
    If you followed the Clonezilla instructions https://clonezilla.org/clonezilla-live-doc.php you get to step 11 and then it starts to announce increasingly long completion times? That has not happened to me. But I have not made "iso backups" with Clonezilla.
    What you describe could, I guess, happen if source and target drives are mixed up. Are you sure you selected them correctly?
    I have guestimated Clonezilla completion times by taking the slower of source drive read speed and target drive write speed. Then divide used space in source drive with the speed. If your cloning takes much different time that this calculation, something is wrong.
    You could verify both drives work properly. Are there read or write errors? Did you run file system check on them before starting Clonezilla?
     
  11. nhybgtvfr

    nhybgtvfr Active Member

    ok, in your script, you list you want to backup
    Code:
    backup_files="/home /var/spool/mail /etc /root /boot /opt"
    then later you say your're backing up a 250Gb drive to a 500Gb drive.
    assuming your 250Gb drive is /dev/sda, partition /dev/sda1, why not just take a straight direct disk to disk copy of it to the 500Gb drive?

    sudo dd if=/dev/sda1 of=/backup/location/filename.img

    if you need to restore the backup, boot up into a ubuntu live cd, recreate the partition and run the dd in reverse:

    sudo dd if=/backup/location/filename.img of=/dev/sda1
     

Share This Page