OpenWrt Forum Archive

Topic: USB issues Archer C7 v2 15.05.1

The content of this topic has been archived on 2 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have all the kmod-usb packages installed, and started this guide can't mention because it's a link.. So I guess I'll try and explain without and info to provide. I'm wanting to expand the storage as I only have 16mb when I plug in the USB it doesn't show with df, however fdisk -l command shows it
root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                   12544      2528     10016  20% /
/dev/root                 2560      2560         0 100% /rom
tmpfs                    63020       668     62352   1% /tmp
/dev/mtdblock3           12544      2528     10016  20% /overlay
overlayfs:/overlay       12544      2528     10016  20% /
tmpfs                      512         0       512   0% /dev

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1        2048 15919103 15917056  7.6G 83 Linux

I then followed this:

mkdir /mnt/sda1
Mount the drive on the mount point you just created (replace /dev/sda2 with whatever you got from the fdisk command, and /mnt/sda1 with whatever you chose as your mount point):

mount /dev/sda1 /mnt/sda1
Now copy the root filesystem from the router’s inbuilt flash to the USB drive with these commands (if you chose a name other than /mnt/sda1 in the previous step, then replace /mnt/sda1 in line 3):

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

It copied all over and I rebooted

I then did

Configure /etc/config/fstab

Open /etc/config/fstab with your favourite text editor:

nano /etc/config/fstab
If nano is not installed, you can use vi (which is installed by default, but is horrible!) or you can just install nano with:

opkg update
opkg install nano
Add the following to the file:

config mount
        option target        /
        option device        /dev/sda1
        option fstype        ext4
        option options       rw,sync
        option enabled       1
        option enabled_fsck  0

These settings stuck after another reboot

Then I'm supposed to double check with mount and df -h which both do not show dev/sda1

root@OpenWrt:~# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/mtdblock3 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                   12.3M      2.5M      9.8M  20% /
/dev/root                 2.5M      2.5M         0 100% /rom
tmpfs                    61.5M    744.0K     60.8M   1% /tmp
/dev/mtdblock3           12.3M      2.5M      9.8M  20% /overlay
overlayfs:/overlay       12.3M      2.5M      9.8M  20% /
tmpfs                   512.0K         0    512.0K   0% /dev

if I got to in WebGUI System -> Software I still see only 9.8mb 80% free

Then System -> Mount Points shows
Mounted file systems
Filesystem    Mount Point    Available    Used
rootfs
/
9.78 MB / 12.25 MB
20% (2.47 MB)
/dev/root
/rom
0.00 B / 2.50 MB
100% (2.50 MB)
tmpfs
/tmp
60.82 MB / 61.54 MB
1% (744.00 KB)
/dev/mtdblock3
/overlay
9.78 MB / 12.25 MB
20% (2.47 MB)
overlayfs:/overlay
/
9.78 MB / 12.25 MB
20% (2.47 MB)
tmpfs
/dev
512.00 KB / 512.00 KB
0% (0.00 B)

Mount Points
Mount Points define at which point a memory device will be attached to the filesystem
Enabled    Device    Mount Point    Filesystem    Options    Root    Check    

/dev/sda1 (7772 MB)
/
ext4
rw,sync
yes
no

No SWAP


So what can I do or is it working and I'm wrong? The guide said after all I did the filesystem should be running form the USB not internal mem
Packages Installed:
Can't list because it says I'm adding links....

(Last edited by cyris69 on 28 Nov 2016, 06:37)

Here is the guide over at samhobs with this "more-space-for-packages-with-extroot-on-your-openwrt-router" I can't link it but maybe a google will show up for someone.

I should be seeing something similar to this

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    3.9G    157.1M      3.6G   4% /
/dev/root                 2.0M      2.0M         0 100% /rom
tmpfs                    61.9M    932.0K     60.9M   1% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda1                 3.9G    157.1M      3.6G   4% /

(Last edited by cyris69 on 28 Nov 2016, 07:57)

It didn't actually mount.  You still have the internal flash filesystems mounted at /.  Can you mount manually:
mount -t ext4 /dev/sda1 /
Also you could mount it back temporarily e.g. to /mnt/sda1 and make sure your whole system tree is really there.
I seem to remember that config/mount will not mount unless some sort of hidden key on the drive is proper.

root@OpenWrt:~# mount -t ext4 /dev/sda1 /
root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                   12544      2532     10012  20% /
/dev/root                 2560      2560         0 100% /rom
tmpfs                    63020      1016     62004   2% /tmp
/dev/mtdblock3           12544      2532     10012  20% /overlay
overlayfs:/overlay       12544      2532     10012  20% /
tmpfs                      512         0       512   0% /dev
/dev/sda1                12544      2532     10012  20% /

root@OpenWrt:~# mount -t ext4 /dev/sda1 /mnt/sda1
root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                   12544      2524     10020  20% /
/dev/root                 2560      2560         0 100% /rom
tmpfs                    63020       552     62468   1% /tmp
/dev/mtdblock3           12544      2524     10020  20% /overlay
overlayfs:/overlay       12544      2524     10020  20% /
tmpfs                      512         0       512   0% /dev
/dev/sda1              7450247     11569   7036656   0% /mnt/sda1
root@OpenWrt:~# cd /mnt/sda1
root@OpenWrt:/mnt/sda1# ls
bin         htdocs      lost found  proc        sbin        usr
dev         init        mnt         rom         sys         var
etc         lib         overlay     root        tmp         worldwideweb can use ww* as it's a link...
root@OpenWrt:/mnt/sda1#


Neither one sticks after reboot. I did also follow a similar guide here on the openwrt wiki but still no dice.
Also when does this you entered a link stuff stop.

(Last edited by cyris69 on 28 Nov 2016, 20:43)

bump

Does anyone have a solution or maybe if it's obvious one could just link me to some more info? I've been a long time DD user but have fallen in love wth open so still trying to learn how everything works.

Here is the sequence I use for extroot.

1) Create ext4 partition(s) on target flash disk. Either install cfdisk+e2fsprogs on router or do it on a PC with linux, possibly in VM.

cfdisk /dev/sdX
<create partition(s)>
mkfs.ext4 /dev/sdX1

2)

mkdir /tmp/root /tmp/target
mount --bind / /tmp/root
mount /dev/sda1 /tmp/target
# absolutely dont need tar here. cp -a works perfectly
rm -rf /tmp/target/*
cp -a /tmp/root/* /tmp/target

3)

blkid /dev/sda1

copy UUID
4)
Alter /etc/config/fstab and paste there actual uuid :

config mount
        option target   /
        option uuid     'cc1d4afd-87ba-45bd-b223-3f149f0975a2'
        option fstype   ext4
        option options  rw,noatime,nodiratime
        option enabled  1
        option enabled_fsck 1

5)

cp /etc/config/fstab /tmp/target/etc/config

6) reboot

Root should be mounted as /dev/sda1

/dev/root on /rom type squashfs (ro,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/sda1 on / type ext4 (rw,noatime,nodiratime,data=ordered)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)

(Last edited by bolvan on 2 Dec 2016, 19:59)

Here is an image of my Mount Point Page
puu.sh/sB3DF/12148245c2.png

Mount Points
Mount Points define at which point a memory device will be attached to the filesystem
Enabled    Device    Mount Point    Filesystem    Options    Root    Check     

UUID: e3f93cfe-7d48-d201-00f1-34fe7d48d201 (/dev/sda1, 7775 MB)
/
ext4
rw,sync
yes
no

I formatted my flash drive again using minitools to ext4 and it shows that when I was trying to format from the router.

Here is the UBS:

root@OpenWrt:~# blkid /dev/sda1
/dev/sda1: UUID="e3f93cfe-7d48-d201-00f1-34fe7d48d201" TYPE="ext4" PARTUUID="7f19b530-01"

Mount shows after reboot:

root@OpenWrt:~# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/mtdblock3 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)

df shows after reboot:

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                   12.3M      3.0M      9.3M  24% /
/dev/root                 2.5M      2.5M         0 100% /rom
tmpfs                    61.5M    848.0K     60.7M   1% /tmp
/dev/mtdblock3           12.3M      3.0M      9.3M  24% /overlay
overlayfs:/overlay       12.3M      3.0M      9.3M  24% /
tmpfs                   512.0K         0    512.0K   0% /dev

So for whatever reason the USB shows up in Mount Point webpage but nowhere else unless manually mounted with a mount cmd. So even after attempting your process I still can't get it to work.

(Last edited by cyris69 on 1 Dec 2016, 23:43)

Have you cloned / to /dev/sda1 as I described ?
See logread and find there errors from blockmount. It complains to syslog

bolvan wrote:

Have you cloned / to /dev/sda1 as I described ?
See logread and find there errors from blockmount. It complains to syslog

Recorded myself doing it https://youtu.be/_J1sc84Kp00

My mistake. I mistyped file name.
Its not "stab", its "fstab". /etc/config/fstab
Dont remove everything from there, only replace "config mount" section
This procedure I done many times and it always worked.

(Last edited by bolvan on 2 Dec 2016, 20:02)

bolvan wrote:

My mistake. I mistyped file name.
Its not "stab", its "fstab". /etc/config/fstab
Dont remove everything from there, only replace "config mount" section
This procedure I done many times and it always worked.

Just stuck at this spot

root@OpenWrt:~# cp /etc/config/fstab /tmp/target/etc/config
cp: can't create '/tmp/target/etc/config': No such file or directory

Is your USB actually (temporarily) mounted at /tmp/target?  ls it-- you should have a duplicate of the whole tree there except of course for the one file you just changed.  So directory /tmp/target/etc/config will become just /etc/config when the USB is mounted at root.

I suggest you also re-install block-mount.  It seems you have everything configured but block-mount is not mounting at bootup.

And look for a hidden file (ls -a) with a UUID in it in the root of the USB.  If it is there, delete it.  This is to check that you haven't moved the USB to a different router, or upgraded OpenWRT.  In those cases, that file won't match and it will refuse to mount.

(Last edited by mk24 on 2 Dec 2016, 22:16)

Honestly, I'm fairly novice with linux OS's. I've done my time with using them for networking classes years ago in college but never really much around the home. So the ins-and-outs elude me when it comes to working with this router for more advanced features. No matter what I have attempted so far from formatting to following guides and instruction to the T has yielded me frustrated and even more confused. I am very grateful for all of you who are trying to help me get this solved. I will still work on it and look here for help.

I have re-installed block-mount and attempted to do it all over again but have not gotten any different results. I'm curious as to why the mount point GUI on the web interface can't just do this step? It tells you to do what we are doing but a bit simpler however that doesn't work.

http://i.imgur.com/I5iDIAv.png


When i try and mount /dev/sda1 it says "/dev/mtdblock3" is already mounted. So I'm not sure what to try next.

Not possible to double mount at single point. Cant have mounted both mtd and sda at the same time.
Root must be mounted during startup. Not possible to remount root at later time. Mount scripts check extroot for validity and refuse to mount if its treated as invalid.
If you copied files right and fstab contain correct uuid value then it should mount.
Mount sda, do "ls" and check you see there "bin", "usr", ...
"cp: can't create '/tmp/target/etc/config': No such file or directory"
This tells you have not copied it right because target/etc dir is absent.
Or at the time of execution target was not mounted.

After reboot syslog can help finding the problem.

(Last edited by bolvan on 3 Dec 2016, 10:10)

The discussion might have continued from here.