1. Download our Official Android App: Forums for Android!

General Backing up Linux Partitions

Discussion in 'Android Lounge' started by Bg260, Jul 1, 2016.

  1. Bg260

    Bg260  
    VIP Member Thread Starter
    Rank:
     #32
    Points:
    763
    Posts:
    3,538
    Joined:
    Apr 30, 2016

    Apr 30, 2016
    3,538
    3,667
    763
    Male
    Freelance Entrepreneur
    Lincoln
    Some of you may know that I am relatively new to Linux. Like all good beginners, I have managed to "personalize" my operating system to the point of breaking, a few times now. From research, the recommended fix is to do a clean install. This is not a big deal as I keep my personal data safe on a non-Linux partition at least for now. I am curious though, After a fresh install, I thought I could copy and paste my root partition to a safe place. In the event I over-tweak again, I could just copy over the offending directory as a pseudo-factory reset. I tried but not all files will copy even as root. I figure its either due to the file being in use or some sort of encryption. My questions are.

    !. Will a restore like this even work?
    2. If yes, Can I copy everything while in a live session?
    3. Is there an easier way?

    I'm used to Android and having a Nandroid back-up is nice for peace of mind.
     

    Advertisement

  2. svim

    svim Android Expert
    Rank:
     #42
    Points:
    608
    Posts:
    3,981
    Joined:
    Dec 19, 2013

    Dec 19, 2013
    3,981
    3,012
    608
    Illinois
    How are you doing this partition copying? If you were using a GUI file manager (indicated by when you stated, "...copy and paste my root partition...) and the resulting backup was missing files it sounds like the file manager wasn't set to view hidden files? Generally using a file manager to clone a system partition generally isn't a workable solution.

    A more reliable way would be to clone your root partition using a terminal. At that point you can use the 'dd' command, here's a nice summation on using dd. There are options that apply to different situations, pick the one that suits your needs.
    https://wiki.archlinux.org/index.php/disk_cloning
    An advantage when using something like dd is if it encounters an error you'll be able to just read the messages -- i.e. if some files are corrupt or skipped, their names will be listed and you'll have documentation to investigate the matter.

    If you prefer some kind of graphical interface, I like 'Clonezilla'. Create a Clonezilla CD or bootable flash drive and when you boot up into the Clonezilla you can clone partitions or entire drives (even dual-boot drives with multiple format partitions), or make disk image files.
    http://clonezilla.org/
     
    scary alien and Bg260 like this.
  3. Bg260

    Bg260  
    VIP Member Thread Starter
    Rank:
     #32
    Points:
    763
    Posts:
    3,538
    Joined:
    Apr 30, 2016

    Apr 30, 2016
    3,538
    3,667
    763
    Male
    Freelance Entrepreneur
    Lincoln
    Great, I appreciate it. I was using Nemo to copy and paste. I am starting to learn that what cannot be done with GUI can always be done with CLI. Problem is that's how I seem to get in trouble. Pasting some errant command line I find on the internet without fully understanding what it does. I will have to be more careful. For the time being, I will just clone the partition while I learn. Thanks.
     
  4. svim

    svim Android Expert
    Rank:
     #42
    Points:
    608
    Posts:
    3,981
    Joined:
    Dec 19, 2013

    Dec 19, 2013
    3,981
    3,012
    608
    Illinois
    Yeah, unfortunately just copying random commands off the Internet has become more of an issue the past few years, we just can't ignore there's always an a-hole out there who has no guilt at screwing over others. Posted articles generally aren't too bad, it's the reader comments that can often be littered with some pretty nasty stuff. If you do run across some command string online that makes you think twice about, there's always the man (manual) pages that are integral in any Linux distro that you can refer to for confirmation. Open a terminal and if you type in 'man dd' you'll get a description plus all the extra, conditional flags for the dd command.

    You might also want to look into the rsync command. (type 'man rsync' will give you a flood of relevant info)
    http://www.tecmint.com/rsync-local-remote-file-synchronization-commands/

    Or, again if some kind of GUI is preferable, take a look at Grsync.
    https://en.wikipedia.org/wiki/Grsync
     
    scary alien likes this.
  5. Bg260

    Bg260  
    VIP Member Thread Starter
    Rank:
     #32
    Points:
    763
    Posts:
    3,538
    Joined:
    Apr 30, 2016

    Apr 30, 2016
    3,538
    3,667
    763
    Male
    Freelance Entrepreneur
    Lincoln
    Hit the nail on the head there. Backtracking to find what went wrong is difficult too. I've literally got over 100 bookmarked pages. Trying to find 1 comment in that. What a headache.
     
  6. svim

    svim Android Expert
    Rank:
     #42
    Points:
    608
    Posts:
    3,981
    Joined:
    Dec 19, 2013

    Dec 19, 2013
    3,981
    3,012
    608
    Illinois
    If you're trying to diagnose some inadvertent goof-up you might have made (as we all do), some programs might include a menu selection to access its log file so that might be the first thing to check.
    But again, using a terminal has its advantages. Your command history can always be revealed just by typing the up and down arrows on your keyboard.
    - You can also just type in 'history' to see a listing of the last 500 commands you've typed in.
    - If there's a specific command string you can kinda, sorta recall but not fully, hit the Ctrl and r keys and the prompt should change to
    (reverse-i-search)`':
    Type in the first few letters of the command and hopefully you'll find what you're looking for without having to scroll through a long listing.
     
    scary alien likes this.
  7. Bg260

    Bg260  
    VIP Member Thread Starter
    Rank:
     #32
    Points:
    763
    Posts:
    3,538
    Joined:
    Apr 30, 2016

    Apr 30, 2016
    3,538
    3,667
    763
    Male
    Freelance Entrepreneur
    Lincoln
    You have been extremely helpful. The control + r is turning out to be very useful. Thanks @svim .
     

Share This Page

Loading...