1

I am running Ubuntu 19.10 on a USB with persistence and I want to backup all of my data. I have heard that there is a casper-rw file that you can backup, but I can only find a folder called casper-rw, which is empty, and another one called casper-rw1, which is where my data is stored. How can I back it up? I extracted it and made it persistent with Rufus on my Windows computer in case you needed to know

1 Answers1

0

If you created your persistent live drive with mkusb, there is a system for it described at this link.

Generally, you should boot

and then you can use for example sudo rsync ... or sudo tar ... to backup

  • the whole partition for persistence
  • or if a file for persistence
    • loop-mount it and backup on the file level
    • or copy the whole file for persistence to the backup media.

If you have both a folder called casper-rw, which is empty, and another one called casper-rw1, I think that there are two partitions for persistence. Both are automatically mounted, and the second one to be mounted was given the mountpoint /media/ubuntu/casper-rw1 (or something similar depending on the flavour of Ubuntu).

Please be aware that there can be both confusion and corruption of data, if you boot with two (or more) partitions for persistence connected. It is OK to boot into one persistent live drive, and connect another persistent live drive afterwards (when the boot process has finished and you are at the desktop).

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • I extracted it and made it persistent with Rufus on my Windows computer. I will add that to the description – TheRealTengri Apr 16 '20 at 18:23
  • If you backup to a Microsoft file system, it is best to use some archiving tool, for example sudo tar so that file permissions and ownership will be preserved in the backup. Or will you do the backup from Windows? – sudodus Apr 16 '20 at 18:26
  • Even when the drive was made with Rufus it might still work (if you run the backup in Ubuntu) to install mkusb and use its method to backup the content of the (correct) casper-rw partition. I have not tried that but I suggest that you try it (that method is using tar) – sudodus Apr 16 '20 at 18:33
  • I am going to backup from Ubuntu. So would I just do sudo tar -czvf backup.tar.gz /media/ubuntu and to restore it on a new Ubuntu would I just delete /media/ubuntu then extract backup.tar.gz file to /media? – TheRealTengri Apr 16 '20 at 18:34
  • Maybe you should not backup everything mounted on /media/ubuntu. I suggest that you backup each partition specifically, in this case your casper-rw partition, so something like /media/ubuntu/casper-rw or /media/ubuntu/casper-rw1 depending on how the relevant partition is mounted. You can make the backup independent of the mountpoint, if you change directory to the mountpoint, and use . (dot) as input for tar – sudodus Apr 16 '20 at 18:44
  • I have checked, and it is possible to use the backup and restore of mkusb also with partitions for persistence made with other tools than mkusb. Inspired by your question I have also upgraded those shellscript to match the developing version of Ubuntu (Focal Fossa) and to be more user friendly. You find them via the unstable PPA, ppa:mkusb/unstable, where they will reside for testing before migrated to the stable PPA, ppa:mkusb/ppa via the package mkusb-common. – sudodus Apr 18 '20 at 10:14