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:42] – [Flash Layout] 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>
  
Line 551: Line 577:
  
 - Finally, you need to do a sysupgrade for the rootfs_data filesystem to grow and fill its new larger partition. So do one last Attended Sysupgrade and profit! - Finally, you need to do a sysupgrade for the rootfs_data filesystem to grow and fill its new larger partition. So do one last Attended Sysupgrade and profit!
 +
 +- You can also format the 2.4 GiB "extra" partition /dev/mmcblk0p19 (ext4 is always available in this device) and use it for general persistent storage. Note that having extremely large rootfs_data partitions is problematic, as their content need to fit the RAM of the device (512 MiB in this case) during sysupgrade. And for large partitions, it is safer and more efficient to not touch them during sysupgrades anyway. If you so choose, you can mount this "extra" space on boot as /extra or /opt or whatever. You can do this with scripts, or via LuCI by installing the block-mount package. Another recommended package is fstrim.
 ==== OEM easy installation ==== ==== OEM easy installation ====
  
  • Last modified: 2024/07/17 08:31
  • by lanchon