Hi, I have the QNAP TS-219PII running Debian 10 and tried this script. I run into an error during the dry-run, when resizing the NAS Config. It seems its 97% full so it can't be made smaller. How can this be fixed? I see that other QNAP 219PII have been able to resize.
The full dry-run log:
[Check of the QNAP model and see if supported]
kirkwood-qnap: machine: QNAP TS219 family
DTB file: kirkwood-ts219-6282.dtb
Checking: flashcp -V
Checking: flash_erase --version
Using 'u-boot-tools' package
[find on which MTD device partitions are currently mounted]
spi0.0
[Dump current U-boot config']
Current U-boot bootcmd:
uart1 0x68;cp.l 0xf8200000 0x800000 0x80000;cp.l 0xf8400000 0xa00000 0x240000;bootm 0x800000
Current U-boot bootargs:
console=ttyS0,115200 root=/dev/ram initrd=0xa00000,0x900000 ramdisk=34816
run e2fsck twice. the First may return an error status even if FS is corrected
e2fsck -f -p -v $loopdev || true
if ! e2fsck -f -p -v $loopdev; then
echo "e2fsck failed. 'NAS config' resize not possible automatically"
losetup -d $loopdev
exit 1
fi
if ! resize2fs $loopdev 128; then
echo "resize2fs failed. 'NAS config' resize not possible automatically"
losetup -d $loopdev
exit 1
fi
losetup -d $loopdev
' returned non-zero exit status 1.
Hi, I have the QNAP TS-219PII running Debian 10 and tried this script. I run into an error during the dry-run, when resizing the NAS Config. It seems its 97% full so it can't be made smaller. How can this be fixed? I see that other QNAP 219PII have been able to resize.
The full dry-run log:
[Check of the QNAP model and see if supported] kirkwood-qnap: machine: QNAP TS219 family DTB file: kirkwood-ts219-6282.dtb Checking: flashcp -V Checking: flash_erase --version Using 'u-boot-tools' package
[find on which MTD device partitions are currently mounted] spi0.0
[Dump current U-boot config'] Current U-boot bootcmd: uart1 0x68;cp.l 0xf8200000 0x800000 0x80000;cp.l 0xf8400000 0xa00000 0x240000;bootm 0x800000 Current U-boot bootargs: console=ttyS0,115200 root=/dev/ram initrd=0xa00000,0x900000 ramdisk=34816
[Prepare new 'bootcmd'] Old: uart1 0x68;cp.l 0xf8200000 0x800000 0x80000;cp.l 0xf8400000 0xa00000 0x240000;bootm 0x800000 New: uart1 0x68;cp.l 0xf8100000 0x800000 0xc0000;cp.l 0xf8400000 0xb00000 0x300000;bootm 0x800000;echo Kernel_legacy layout fallback;bootm 0x900000
[Prepare new 'bootargs'] Old: console=ttyS0,115200 root=/dev/ram initrd=0xa00000,0x900000 ramdisk=34816 New: console=ttyS0,115200 root=/dev/ram initrd=0xb00000,0xc00000 ramdisk=34816 cmdlinepart.mtdparts=spi0.0:512k@0(uboot)ro,3M@0x100000(Kernel),12M@0x400000(RootFS1),2M@0x200000(Kernel_legacy),256k@0x80000(U-Boot_Config),256k@0xc0000(NAS_Config) mtdparts=spi0.0:512k@0(uboot)ro,3M@0x100000(Kernel),12M@0x400000(RootFS1),2M@0x200000(Kernel_legacy),256k@0x80000(U-Boot_Config),256k@0xc0000(NAS_Config)
[Prepare fw_setenv script (/tmp/fw_setenv.script)]
[Dump current 'NAS config' and 'Kernel' images]
cat /dev/mtd5 [Resize 'NAS config' dump from 1280KB to 256KB.]
modprobe loop
losetup --show -f /tmp/mtd_nas_config.dump
loopdev=/dev/loop1
e2fsck -f -p -v /dev/loop1
e2fsck -f -p -v /dev/loop1
resize2fs /dev/loop1 128 resize2fs 1.44.5 (15-Dec-2018) resize2fs: New size smaller than minimum (1000)
echo resize2fs failed. 'NAS config' resize not possible automatically resize2fs failed. 'NAS config' resize not possible automatically
losetup -d /dev/loop1
exit 1 Traceback (most recent call last): File "./qnap_mtd_resize.py", line 446, in
subprocess.check_call(cmd, shell=True)
File "/usr/lib/python3.7/subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '
set -e
set -x
modprobe loop
loopdev=$(losetup --show -f /tmp/mtd_nas_config.dump)
run e2fsck twice. the First may return an error status even if FS is corrected
e2fsck -f -p -v $loopdev || true if ! e2fsck -f -p -v $loopdev; then echo "e2fsck failed. 'NAS config' resize not possible automatically" losetup -d $loopdev exit 1 fi
if ! resize2fs $loopdev 128; then echo "resize2fs failed. 'NAS config' resize not possible automatically" losetup -d $loopdev exit 1 fi losetup -d $loopdev ' returned non-zero exit status 1.