Backup Dos
How to save space before you back up#
Clear trash and caches
- at
~/.cache/chromium/Default - at
~/.ros - 'pip3 cache purge'
- Lastly, at
~/.local/share/Trash/expunged/*
- at
To check large files and directories
sudo du -Sh | sort -rh | head -20To clear unallocated disk space to zero, use
zerofreeutility (apt install)boot into single user mode
sudo init 1(init level 3 may not work. If no keyboard response, try switch to init 3 first and then into init 1 state, after a fresh reboot)remount the filesystem to readonly (if failed, reboot the system and try again)
mount -o remount,ro /dev/mmcblk0p1- If the mounting is busy try stop services as followed
killall dhclient(this should make things work already)systemctl stop rsyslogsystemctl stop network-manager- if still, run
systemctl statusto identify further things to stop
perform zerofree command
zerofree -v /dev/mmcblk0p1regarding the meaning of the zerofree output:
So after some detailed analysis it would look like those numbers are as follows:- number of nonzero blocks encountered- number of free blocks within the filesystem- total number of blocks within the filesystempoweroffand start backup in recovery mode
Backup the Image File#
In the Linux_for_Tegra/ folder, perform backup of the APP partition
sudo ./flash.sh -r -k APP -G backup.img jetson-tx2 mmcblk0p1
Creating Compressed File (tar.xz)#
sudo XZ_OPT=-T0 tar -Jcvf xxx.tar.xz Linux_for_Tegra
sudois used to be able to access all files-T0is to enable multi-threading (tar -Jcvf file.tar.xz /pathis too slow, as it is single threaded)
References: Official Flashing Guide