Backing up Linux to a Windows file system for later restoration

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I need to backup / copy the files of my Linux installation to an external drive, so that I can restore them onto the new, larger disk.



The destination disk for the restoration is twice as large, and will have larger partitions, ext4 and linux-swap. Imaging the entire disk or its first partition is not really a good option, because both require later re-partitioning I'd like to avoid.



I am backing up to an exFAT-formatted drive, there are some issues with copying an ext4 Linux installation to exFAT though



  • may destroy important hard links and fast* symbolic links from the ext4 file system (will break Linux)


  • won't preserve file ownership / permissions and setuid bits (will break Linux)


  • won't preserve capabilities (will break Linux)


  • won't preserve files extended attributes (xattrs) as well, as I believe many files have important information there (I don't care about Unix ACLs as I don't think I have any files using them)


If I copied the files directly to NTFS, FAT32, exFAT, etc, much of this metadata would be destroyed.



I don't care about compression since the original disk is smaller than my backup drive, but (GNU) tar seems to preserve only permissions/ownership (with -p and extract with --same-owner), links and xattrs, but file capability support is needed to backup modern Linux.



It seems the other main options are a CloneZilla Live system, and cpio which seems to create tar archives.



So the main options are



  1. CloneZilla or just imaging the parition


  2. tar itself, which may break things


  3. cpio, which may be limited by the tar archive format?

*80,000 of the 83,000 symlinks are fast symlinks, and I'd like to preserve their fast-ness if possible










share|improve this question























  • this would be easier to read if you cited at least one example why you think tar is shaky! current versions support xattrs, but it looks like as of 2016 it did not support "file capabilities". bugzilla.redhat.com/show_bug.cgi?id=771927
    – sourcejedi
    1 hour ago










  • You say you cannot mount an external ext4 if you are not root. I don't understand. Why do you want to mount an external ext4, without being root? You need to be root to copy the files and set their ownership etc. correctly.
    – sourcejedi
    1 hour ago











  • If you want a nice GUI to be able to mount ext4, which will prompt for sudo password as needed, GNOME Disks is pretty awesome. The package name should be gnome-disk-utility, in case you do not already have it installed.
    – sourcejedi
    1 hour ago










  • @sourcejedi comment #1: i found a post yesterday (can't find it now, maybe on AU) mentioning how GNU tar "may or may not" properly archive permissions / ownership but i can't find it now, but i guess the -p and --same-owner options do the standard Unix permissions alright
    – cat
    19 mins ago










  • @sourcejedi comment #2: the point is to have my "external USB disk for backup" formatted as ext4, so that I can directly copy my Linux system to it, and copy from it (those as root), and then also use it as a general purpose USB for other non-backup files as a regular user
    – cat
    17 mins ago














up vote
0
down vote

favorite












I need to backup / copy the files of my Linux installation to an external drive, so that I can restore them onto the new, larger disk.



The destination disk for the restoration is twice as large, and will have larger partitions, ext4 and linux-swap. Imaging the entire disk or its first partition is not really a good option, because both require later re-partitioning I'd like to avoid.



I am backing up to an exFAT-formatted drive, there are some issues with copying an ext4 Linux installation to exFAT though



  • may destroy important hard links and fast* symbolic links from the ext4 file system (will break Linux)


  • won't preserve file ownership / permissions and setuid bits (will break Linux)


  • won't preserve capabilities (will break Linux)


  • won't preserve files extended attributes (xattrs) as well, as I believe many files have important information there (I don't care about Unix ACLs as I don't think I have any files using them)


If I copied the files directly to NTFS, FAT32, exFAT, etc, much of this metadata would be destroyed.



I don't care about compression since the original disk is smaller than my backup drive, but (GNU) tar seems to preserve only permissions/ownership (with -p and extract with --same-owner), links and xattrs, but file capability support is needed to backup modern Linux.



It seems the other main options are a CloneZilla Live system, and cpio which seems to create tar archives.



So the main options are



  1. CloneZilla or just imaging the parition


  2. tar itself, which may break things


  3. cpio, which may be limited by the tar archive format?

*80,000 of the 83,000 symlinks are fast symlinks, and I'd like to preserve their fast-ness if possible










share|improve this question























  • this would be easier to read if you cited at least one example why you think tar is shaky! current versions support xattrs, but it looks like as of 2016 it did not support "file capabilities". bugzilla.redhat.com/show_bug.cgi?id=771927
    – sourcejedi
    1 hour ago










  • You say you cannot mount an external ext4 if you are not root. I don't understand. Why do you want to mount an external ext4, without being root? You need to be root to copy the files and set their ownership etc. correctly.
    – sourcejedi
    1 hour ago











  • If you want a nice GUI to be able to mount ext4, which will prompt for sudo password as needed, GNOME Disks is pretty awesome. The package name should be gnome-disk-utility, in case you do not already have it installed.
    – sourcejedi
    1 hour ago










  • @sourcejedi comment #1: i found a post yesterday (can't find it now, maybe on AU) mentioning how GNU tar "may or may not" properly archive permissions / ownership but i can't find it now, but i guess the -p and --same-owner options do the standard Unix permissions alright
    – cat
    19 mins ago










  • @sourcejedi comment #2: the point is to have my "external USB disk for backup" formatted as ext4, so that I can directly copy my Linux system to it, and copy from it (those as root), and then also use it as a general purpose USB for other non-backup files as a regular user
    – cat
    17 mins ago












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I need to backup / copy the files of my Linux installation to an external drive, so that I can restore them onto the new, larger disk.



The destination disk for the restoration is twice as large, and will have larger partitions, ext4 and linux-swap. Imaging the entire disk or its first partition is not really a good option, because both require later re-partitioning I'd like to avoid.



I am backing up to an exFAT-formatted drive, there are some issues with copying an ext4 Linux installation to exFAT though



  • may destroy important hard links and fast* symbolic links from the ext4 file system (will break Linux)


  • won't preserve file ownership / permissions and setuid bits (will break Linux)


  • won't preserve capabilities (will break Linux)


  • won't preserve files extended attributes (xattrs) as well, as I believe many files have important information there (I don't care about Unix ACLs as I don't think I have any files using them)


If I copied the files directly to NTFS, FAT32, exFAT, etc, much of this metadata would be destroyed.



I don't care about compression since the original disk is smaller than my backup drive, but (GNU) tar seems to preserve only permissions/ownership (with -p and extract with --same-owner), links and xattrs, but file capability support is needed to backup modern Linux.



It seems the other main options are a CloneZilla Live system, and cpio which seems to create tar archives.



So the main options are



  1. CloneZilla or just imaging the parition


  2. tar itself, which may break things


  3. cpio, which may be limited by the tar archive format?

*80,000 of the 83,000 symlinks are fast symlinks, and I'd like to preserve their fast-ness if possible










share|improve this question















I need to backup / copy the files of my Linux installation to an external drive, so that I can restore them onto the new, larger disk.



The destination disk for the restoration is twice as large, and will have larger partitions, ext4 and linux-swap. Imaging the entire disk or its first partition is not really a good option, because both require later re-partitioning I'd like to avoid.



I am backing up to an exFAT-formatted drive, there are some issues with copying an ext4 Linux installation to exFAT though



  • may destroy important hard links and fast* symbolic links from the ext4 file system (will break Linux)


  • won't preserve file ownership / permissions and setuid bits (will break Linux)


  • won't preserve capabilities (will break Linux)


  • won't preserve files extended attributes (xattrs) as well, as I believe many files have important information there (I don't care about Unix ACLs as I don't think I have any files using them)


If I copied the files directly to NTFS, FAT32, exFAT, etc, much of this metadata would be destroyed.



I don't care about compression since the original disk is smaller than my backup drive, but (GNU) tar seems to preserve only permissions/ownership (with -p and extract with --same-owner), links and xattrs, but file capability support is needed to backup modern Linux.



It seems the other main options are a CloneZilla Live system, and cpio which seems to create tar archives.



So the main options are



  1. CloneZilla or just imaging the parition


  2. tar itself, which may break things


  3. cpio, which may be limited by the tar archive format?

*80,000 of the 83,000 symlinks are fast symlinks, and I'd like to preserve their fast-ness if possible







linux backup ext4 cpio exfat






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 9 mins ago

























asked 3 hours ago









cat

1,63621135




1,63621135











  • this would be easier to read if you cited at least one example why you think tar is shaky! current versions support xattrs, but it looks like as of 2016 it did not support "file capabilities". bugzilla.redhat.com/show_bug.cgi?id=771927
    – sourcejedi
    1 hour ago










  • You say you cannot mount an external ext4 if you are not root. I don't understand. Why do you want to mount an external ext4, without being root? You need to be root to copy the files and set their ownership etc. correctly.
    – sourcejedi
    1 hour ago











  • If you want a nice GUI to be able to mount ext4, which will prompt for sudo password as needed, GNOME Disks is pretty awesome. The package name should be gnome-disk-utility, in case you do not already have it installed.
    – sourcejedi
    1 hour ago










  • @sourcejedi comment #1: i found a post yesterday (can't find it now, maybe on AU) mentioning how GNU tar "may or may not" properly archive permissions / ownership but i can't find it now, but i guess the -p and --same-owner options do the standard Unix permissions alright
    – cat
    19 mins ago










  • @sourcejedi comment #2: the point is to have my "external USB disk for backup" formatted as ext4, so that I can directly copy my Linux system to it, and copy from it (those as root), and then also use it as a general purpose USB for other non-backup files as a regular user
    – cat
    17 mins ago
















  • this would be easier to read if you cited at least one example why you think tar is shaky! current versions support xattrs, but it looks like as of 2016 it did not support "file capabilities". bugzilla.redhat.com/show_bug.cgi?id=771927
    – sourcejedi
    1 hour ago










  • You say you cannot mount an external ext4 if you are not root. I don't understand. Why do you want to mount an external ext4, without being root? You need to be root to copy the files and set their ownership etc. correctly.
    – sourcejedi
    1 hour ago











  • If you want a nice GUI to be able to mount ext4, which will prompt for sudo password as needed, GNOME Disks is pretty awesome. The package name should be gnome-disk-utility, in case you do not already have it installed.
    – sourcejedi
    1 hour ago










  • @sourcejedi comment #1: i found a post yesterday (can't find it now, maybe on AU) mentioning how GNU tar "may or may not" properly archive permissions / ownership but i can't find it now, but i guess the -p and --same-owner options do the standard Unix permissions alright
    – cat
    19 mins ago










  • @sourcejedi comment #2: the point is to have my "external USB disk for backup" formatted as ext4, so that I can directly copy my Linux system to it, and copy from it (those as root), and then also use it as a general purpose USB for other non-backup files as a regular user
    – cat
    17 mins ago















this would be easier to read if you cited at least one example why you think tar is shaky! current versions support xattrs, but it looks like as of 2016 it did not support "file capabilities". bugzilla.redhat.com/show_bug.cgi?id=771927
– sourcejedi
1 hour ago




this would be easier to read if you cited at least one example why you think tar is shaky! current versions support xattrs, but it looks like as of 2016 it did not support "file capabilities". bugzilla.redhat.com/show_bug.cgi?id=771927
– sourcejedi
1 hour ago












You say you cannot mount an external ext4 if you are not root. I don't understand. Why do you want to mount an external ext4, without being root? You need to be root to copy the files and set their ownership etc. correctly.
– sourcejedi
1 hour ago





You say you cannot mount an external ext4 if you are not root. I don't understand. Why do you want to mount an external ext4, without being root? You need to be root to copy the files and set their ownership etc. correctly.
– sourcejedi
1 hour ago













If you want a nice GUI to be able to mount ext4, which will prompt for sudo password as needed, GNOME Disks is pretty awesome. The package name should be gnome-disk-utility, in case you do not already have it installed.
– sourcejedi
1 hour ago




If you want a nice GUI to be able to mount ext4, which will prompt for sudo password as needed, GNOME Disks is pretty awesome. The package name should be gnome-disk-utility, in case you do not already have it installed.
– sourcejedi
1 hour ago












@sourcejedi comment #1: i found a post yesterday (can't find it now, maybe on AU) mentioning how GNU tar "may or may not" properly archive permissions / ownership but i can't find it now, but i guess the -p and --same-owner options do the standard Unix permissions alright
– cat
19 mins ago




@sourcejedi comment #1: i found a post yesterday (can't find it now, maybe on AU) mentioning how GNU tar "may or may not" properly archive permissions / ownership but i can't find it now, but i guess the -p and --same-owner options do the standard Unix permissions alright
– cat
19 mins ago












@sourcejedi comment #2: the point is to have my "external USB disk for backup" formatted as ext4, so that I can directly copy my Linux system to it, and copy from it (those as root), and then also use it as a general purpose USB for other non-backup files as a regular user
– cat
17 mins ago




@sourcejedi comment #2: the point is to have my "external USB disk for backup" formatted as ext4, so that I can directly copy my Linux system to it, and copy from it (those as root), and then also use it as a general purpose USB for other non-backup files as a regular user
– cat
17 mins ago










1 Answer
1






active

oldest

votes

















up vote
0
down vote













If you really want to use a general purpose storage device without reformatting it, AND it has largefile support (not FAT, but maybe exFAT, NTFS, UDF...), the simplest way to make sure it works is to use a disk image file on it.



  1. Create a disk image file of the same size as the source filesystem.

  2. Copy your files in to it.

  3. Boot the target system with the install environment of your choice, connect the external disk.

  4. Copy the files from the disk image on to the target system.

  5. (Do whatever magic is required to make it bootable, given your target hardware).

Steps 1/2 will actually be faster if you can use a partition imager like e2image -a. This requires that the source filesystem not be mounted. I don't know what the status of e2image -a is. Unfortunately partclone (from Clonezilla) does not create mountable raw disk image files, or at least not by default.





share




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476077%2fbacking-up-linux-to-a-windows-file-system-for-later-restoration%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    If you really want to use a general purpose storage device without reformatting it, AND it has largefile support (not FAT, but maybe exFAT, NTFS, UDF...), the simplest way to make sure it works is to use a disk image file on it.



    1. Create a disk image file of the same size as the source filesystem.

    2. Copy your files in to it.

    3. Boot the target system with the install environment of your choice, connect the external disk.

    4. Copy the files from the disk image on to the target system.

    5. (Do whatever magic is required to make it bootable, given your target hardware).

    Steps 1/2 will actually be faster if you can use a partition imager like e2image -a. This requires that the source filesystem not be mounted. I don't know what the status of e2image -a is. Unfortunately partclone (from Clonezilla) does not create mountable raw disk image files, or at least not by default.





    share
























      up vote
      0
      down vote













      If you really want to use a general purpose storage device without reformatting it, AND it has largefile support (not FAT, but maybe exFAT, NTFS, UDF...), the simplest way to make sure it works is to use a disk image file on it.



      1. Create a disk image file of the same size as the source filesystem.

      2. Copy your files in to it.

      3. Boot the target system with the install environment of your choice, connect the external disk.

      4. Copy the files from the disk image on to the target system.

      5. (Do whatever magic is required to make it bootable, given your target hardware).

      Steps 1/2 will actually be faster if you can use a partition imager like e2image -a. This requires that the source filesystem not be mounted. I don't know what the status of e2image -a is. Unfortunately partclone (from Clonezilla) does not create mountable raw disk image files, or at least not by default.





      share






















        up vote
        0
        down vote










        up vote
        0
        down vote









        If you really want to use a general purpose storage device without reformatting it, AND it has largefile support (not FAT, but maybe exFAT, NTFS, UDF...), the simplest way to make sure it works is to use a disk image file on it.



        1. Create a disk image file of the same size as the source filesystem.

        2. Copy your files in to it.

        3. Boot the target system with the install environment of your choice, connect the external disk.

        4. Copy the files from the disk image on to the target system.

        5. (Do whatever magic is required to make it bootable, given your target hardware).

        Steps 1/2 will actually be faster if you can use a partition imager like e2image -a. This requires that the source filesystem not be mounted. I don't know what the status of e2image -a is. Unfortunately partclone (from Clonezilla) does not create mountable raw disk image files, or at least not by default.





        share












        If you really want to use a general purpose storage device without reformatting it, AND it has largefile support (not FAT, but maybe exFAT, NTFS, UDF...), the simplest way to make sure it works is to use a disk image file on it.



        1. Create a disk image file of the same size as the source filesystem.

        2. Copy your files in to it.

        3. Boot the target system with the install environment of your choice, connect the external disk.

        4. Copy the files from the disk image on to the target system.

        5. (Do whatever magic is required to make it bootable, given your target hardware).

        Steps 1/2 will actually be faster if you can use a partition imager like e2image -a. This requires that the source filesystem not be mounted. I don't know what the status of e2image -a is. Unfortunately partclone (from Clonezilla) does not create mountable raw disk image files, or at least not by default.






        share











        share


        share










        answered 38 secs ago









        sourcejedi

        20.9k43089




        20.9k43089



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476077%2fbacking-up-linux-to-a-windows-file-system-for-later-restoration%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay