Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
toh:linksys:whw03_v1 [2024/05/15 09:59] – [Repartitioning] lanchontoh:linksys:whw03_v1 [2024/07/17 06:09] – [Repartitioning] lanchon
Line 182: Line 182:
 WARNING: VERIFY THAT YOUR GPT HASH IS THE SAME AS MINE! DO NOT PROCEED OTHERWISE! WARNING: VERIFY THAT YOUR GPT HASH IS THE SAME AS MINE! DO NOT PROCEED OTHERWISE!
  
-- Backup you current configuration.+- Backup your current configuration.
  
 - Install these packages: gdisk sgdisk blkdiscard  - Install these packages: gdisk sgdisk blkdiscard 
Line 192: Line 192:
 IMPORTANT: DO NOT PROCEED WITHOUT DOING THE 2 SYSUPGRADES! For the procedure to succeed, the installed commands need to be in rootfs, not rootfs_data, as rootfs_data will have to be unmounted. IMPORTANT: DO NOT PROCEED WITHOUT DOING THE 2 SYSUPGRADES! For the procedure to succeed, the installed commands need to be in rootfs, not rootfs_data, as rootfs_data will have to be unmounted.
  
-- Make backups of the GPT (partition table) and relevant stock partitions:+- Make backups of the GPT (partition table):
  
 <code> <code>
Line 208: Line 208:
 33+0 records in 33+0 records in
 33+0 records out 33+0 records out
 +</code>
  
 +- Make backups of the stock partitions:
 +
 +NOTE: The last partition (mmcblk0p19 "syscfg") has some configuration info used by stock firmware.
 +It is 3.4 GiB in size, with an ext4 filesystem that only contains about 250 KiB of files (when i looked).
 +However this filesystem is not trimmed, and as time goes on it accumulates stale data in unused areas.
 +If the backup commands below fail with /tmp running out of space, this stale data is the culprit.
 +
 +You then have 3 options:
 +
 +1) If one backup fits in /tmp, scp the first backup (see next step), remove it from /tmp, then do the second backup.
 +
 +2) Else pipe the backups over SSH (see below). Note that this might not work from a Windows PC due to character translations (but you could work some magic with base64 or similar).
 +
 +3) Or mount and fstrim the partition to remove the stale data (requires the "fstrim" package).
 +
 +<code>
 # now you can backup the complete eMMC (GPTs and all partitions): # now you can backup the complete eMMC (GPTs and all partitions):
  
Line 216: Line 233:
  
 root@OpenWrt:/# gzip -c /dev/mmcblk0p19 >/tmp/lanchon/mmcblk0p19-syscfg.img.gz root@OpenWrt:/# gzip -c /dev/mmcblk0p19 >/tmp/lanchon/mmcblk0p19-syscfg.img.gz
 +
 +# or if you ran out of space in /tmp, you can pipe the backups over SSH from your Linux PC:
 +
 +you@your-pc:~$ ssh root@192.168.1.1 "gzip -c /dev/mmcblk0" >mmcblk0-emmc.img.gz
 +you@your-pc:~$ ssh root@192.168.1.1 "gzip -c /dev/mmcblk0p19" >mmcblk0p19-syscfg.img.gz
 +
 +# and test your backups after piping them, especially if done from a Windows PC:
 +
 +you@your-pc:~$ gzip -t mmcblk0*.img.gz
 </code> </code>
  
-- Using SCP from you PC, bring all backup files to your PC and store them safely:+- Using SCP from your PC, bring all backup files to your PC and store them safely:
  
 <code> <code>
-you@your-pc:~$ scp root@192.168.1.1/tmp/lanchon/* .+you@your-pc:~$ scp root@192.168.1.1:/tmp/lanchon/* .
 </code> </code>
  
  • Last modified: 2024/07/17 08:31
  • by lanchon