D-Link DIR-2660-A1 partition info not saved


I just recently installed this version of OpenWRT FW "openwrt-21.02.1-ramips-mt7621-dlink_dir-2660-a1-squashfs-factory" into D-Link DIR-2660-A1.

All is good but now i am facing one issue.

I have attached one USB stick with router and created 2 partitions one for swap and one for software lib. The issue is every time it reboot it disconnect mount points.

The following steps i used to configure USB disk:-

a) Attach USB disk to router
b) Login to putty
c) opkg update && opkg install block-mount kmod-usb-core kmod-usb-storage kmod-usb-uhci kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-usb-storage-uas kmod-usb-ohci-pci kmod-usb2-pci usbutils kmod-fs-ext4 e2fsprogs fdisk
d) reboot
e) Creating USB partitions
(echo n; echo p; echo 1; echo " "; echo +512M; echo t; echo 82; echo w) | fdisk /dev/sda [For SWAP]
(echo n; echo p; echo 2; echo " "; echo " "; echo w) | fdisk /dev/sda [For Software's]

f) reboot
g) Mounting and shifting default overlay to /dev/sda2
DEVICE="$(sed -n -e "/\s/overlay\s.*$/s///p" /etc/mtab)"
uci -q delete fstab.rwm
uci set fstab.rwm="mount"
uci set fstab.rwm.device="${DEVICE}"
uci set fstab.rwm.target="/rwm"
uci commit fstab
mkfs.ext4 ${DEVICE}

eval $(block info ${DEVICE} | grep -o -e "UUID=\S*")
uci -q delete fstab.overlay
uci set fstab.overlay="mount"
uci set fstab.overlay.uuid="${UUID}"
uci set fstab.overlay.target="/overlay"
uci commit fstab

mkdir -p /tmp/cproot
mount --bind /overlay /tmp/cproot
mount ${DEVICE} /mnt
tar -C /tmp/cproot -cvf - . | tar -C /mnt -xf -
umount /tmp/cproot /mnt

h) reboot
i) Mounting /dev/sda1 to swap.
mkswap /dev/sda1
uci -q delete fstab.swap
uci set fstab.swap="swap"
uci set fstab.swap.device="/dev/sda1"
uci commit fstab
/etc/init.d/fstab boot

And after boot
df -h not showing new software USB /dev/sda2 partition
free also not showing swap partition.

So from LuCiGUI manually mounted partitions and checked enable but again after boot its not showing.

Any idea how to fix ??

This is the output after reboot...

cat /etc/config/fstab

config global
option anon_swap '0'
option anon_mount '0'
option auto_swap '1'
option auto_mount '1'
option delay_root '5'
option check_fs '0'

config mount 'rwm'
option device '/dev/ubi0_1'
option target '/rwm'

config mount 'overlay'
option uuid '4dd14733-b8cd-4e13-9837-a2d3a151de4f'
option target '/overlay'

block info
/dev/mtdblock6: UUID="1635066095" VERSION="1" TYPE="ubi"
/dev/ubiblock0_0: UUID="ffa138eb-7c8a324a-a20b91d1-95c047e1" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/ubi0_1: UUID="5c3f6b10-ade0-4386-a65a-4cfc19f89899" VERSION="w5r0" MOUNT="/rwm" TYPE="ubifs"
/dev/sda1: VERSION="1" TYPE="swap"
/dev/sda2: UUID="4dd14733-b8cd-4e13-9837-a2d3a151de4f" VERSION="1.0" MOUNT="/overlay" TYPE="ext4"

total used free shared buff/cache available
Mem: 252048 35936 197996 72 18116 182448
Swap: 0 0 0

the partitions are there ? but not auto mounted ?

as a workaround, try adding the mount command(s) to you local start up script.

This I already mounted manually as well. Adding into local start up script is there by any chance of confliction of settings during reboot??

Just adding these two lines fixed the issue as of now. I just missed this two lines; my bad.

uci set fstab.@global[0].delay_root="15"
uci commit fstab

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.