[Solved] LEDE snapshot extroot problem

I usually use OpenWRT CC image. I tried snapshot once but I can't mount extroot in my TP-Link TL-3420v2.

But I can mount usb disk in CC version by using those commands.

mkdir /mnt/rdata
mount /dev/sda1 /mnt/rdata
mkdir /mnt/samba
chmod -R 777 /mnt/samba
mount /dev/sda3 /mnt/samba

mkdir -p /tmp/cproot
mount --bind / /tmp/cproot
tar -C /tmp/cproot -cvf - . | tar -C /mnt/rdata -xf -
umount /tmp/cproot

Here I partitioned my 8GB SD card with card reader as /dev/sda1 (For Router Root) /dev/sda2 (1G For swap) and /dev/sda3 (For SMB)

So here is fstab config
cat >> /etc/config/fstab << EOF
config 'mount'
option target /
option device /dev/sda1
option fstype ext4
option options rw,sync
option enabled 1
option enabled_fsck 0
config 'swap'
option device '/dev/sda2'
option enabled '1'
config 'mount'
option target /mnt/samba
option device /dev/sda3
option fstype ext4
option options rw,sync
option enabled 1
option enabled_fsck 1
EOF

But no luck. Here is df -h after using extroot

root@TL-MR3420:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.3M      2.3M         0 100% /rom
tmpfs                    13.6M     84.0K     13.5M   1% /tmp
/dev/sda1               954.7M      6.5M    893.0M   1% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@TL-MR3420:~#

and block info

root@TL-MR3420:~# block info
/dev/mtdblock2: UUID="f6a676b6-74d77741-637cbebe-b9fcab68" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock3: TYPE="jffs2"
/dev/sda1: UUID="e2593c47-f2cf-d201-c011-3c47f2cfd201" LABEL="rdata" VERSION="1.0" MOUNT="/" TYPE="ext4"
/dev/sda2: VERSION="1" TYPE="swap"
/dev/sda3: UUID="37ef2383-f2cf-d201-104e-2383f2cfd201" LABEL="samba" VERSION="1.0" TYPE="ext4"
root@TL-MR3420:~#

my question is is there any difference to mount USB disk in snapshot image? Since the same configuration working ok with OpenWRT and LEDE Trunk images.

Hope someone will look this issue.

Did you make sure that you had all packages installed, like:

opkg update && opkg install block-mount kmod-fs-ext4 kmod-usb-storage e2fsprogs kmod-usb-ohci kmod-usb-uhci fdisk

Maybe you'll be too tight on flash space. In the Wiki it suggest to use "F2fs" when you only have 4 MB of flash, because ext4 tools takes too much space.

Here is image build command -

make -j4 image PROFILE=TLMR3420 PACKAGES=\
  "-libiwinfo-lua -liblua -libubus-lua -libuci-lua -lua \
   -luci -luci-app-firewall -luci-base -luci-lib-ip \
   -luci-lib-nixio -luci-mod-admin-full -luci-proto-ipv6 \
   -luci-proto-ppp -luci-theme-bootstrap -uhttpd -uhttpd-mod-ubus \
    kmod-fs-ext4 kmod-usb-storage kmod-scsi-core block-mount \
    kmod-lib-crc32c kmod-crypto-crc32c"

As I said with that command Trunk build works fine, only snapshot build got problem.

Issue fixed. Following

https://wiki.openwrt.org/doc/howto/extroot

But it didn't extend /dev/root space.