USB Drive problems

Apprentice

Occasional Visitor
Just set up an AX88U with Merlin + bells and various whistles, went away for a week and a lot of it appears to have crashed! Trying to rebuild, but one problem is the USB disk (Brand new Scandisk 3.0 128gb, 126 ext4 data, 2gB swap) has become unmounted (tho I still have access amtm which I find strange)

Googling for a way to remount the disk but have found nothing - can anybody please help?

Also googling for general instructions for setting up a usb drive and have found very little, and nothing in the wiki - any resources around?

Many thanks!
 

bennor

Very Senior Member
If all you have on the USB drive is the swap file, just put the USB drive into a computer and reformat the partition for NTFS or FAT32. Then put that USB drive back into the router and run AMTM and start the USB drive format for EXT4 and swap file creation from scratch. AMTM resides within the router and it's firmware not on the USB drive. Certain scripts one installs using AMTM/Entware do reside on the USB drive.
 

Apprentice

Occasional Visitor
If all you have on the USB drive is the swap file, just put the USB drive into a computer and reformat the partition for NTFS or FAT32
Thanks very much for the fast reply. Do you think the reason it became unstable is cos I used ext4 and that NTFS is better, or do you think there is something else going on?
 

Apprentice

Occasional Visitor
Ok sorry, have now read you post properly. Formatted the drive in Gparted, but will try your suggestion and see if doing it on the router natively helps!
 

Tech9

Part of the Furniture
do you think there is something else going on?

USB sticks are unreliable. Use a small SSD in external USB enclosure instead. Multiple threads around discussing this very same subject.
 

bennor

Very Senior Member
Thanks very much for the fast reply. Do you think the reason it became unstable is cos I used ext4 and that NTFS is better, or do you think there is something else going on?
EXT4 is apparently the recommended format when it comes to setting up a USB drive for scripts and a swap file when using Asus-Merlin. If the router crashes it could have corrupted the USB drive (especially if it was writing to that drive when it crashed). Generally suggesting one reformat to NTFS is just so the router can mount and read the drive, from there one can reformat/partition the drive as needed for their swap file and third party scripts using AMTM.

Edit to add: Some/many will recommend not using USB flash drives, use SSD drives instead. There is much debate in numerous other threads on SSD or Flash drive (or even SD/microSD card) usage. Others run flash drives without issue. Generally it helps to use a good quality flash drive or SSD drive (with a ASMedia chipset USB hard drive enclosure - UGreen enclosures seems to be recommended).
 
Last edited:

Tech9

Part of the Furniture
Some will recommend not using USB flash drives.

USB sticks are storage devices. Not designed for continuous read/write operations. Many just overheat and fail over time.
 

bennor

Very Senior Member
Thanks very much guys. Do you have an specific make/model recommendations. i won't hold you responsible if it fails ;-)
If you go with SSD you have plenty of options. It depend on how large an SSD you need. Easiest and likely cheapest is just get a small 120GB SSD internal SATA drive and put it into a UGreen external USB enclosure. It is recommended to use a UGreen enclosure which uses the ASMedia chipset since others indicate that chipset plays nice with Asus Merlin firmware.
 

Tech9

Part of the Furniture
Do you have an specific make/model recommendations.

No, search the threads around for ideas. My Asus routers are used for fun only.
 

EmeraldDeer

Very Senior Member
I use a Samsung T5. The current model is a T7 but perhaps equivalent reliability is available from competitors at a lower price.

Whether you use an SSD or thumb drive, I would recommend:
  • An Entware partition of 8 GB
  • Journaled ext4
  • Configure the filesystem to fsck nearly every reboot
By default fsck will not run for months, and when it does on a large filesystem, it will not complete on time for a successful reboot. In normal operation, you cannot unmount the Entware partition and fsck manually.

Code:
# tune2fs -l /dev/sda1

# tune2fs -c 1 -i 1d /dev/sda1

tune2fs 1.45.6 (20-Mar-2020)

Setting maximal mount count to 1

Setting interval between checks to 86400 seconds

# tune2fs -l /dev/sda1
 

EmeraldDeer

Very Senior Member
If using the Format disk utility in amtm:
  • Select two (or three) partitions
  • First partition should be 8192 MB
 

EmeraldDeer

Very Senior Member
I used to have entries in /etc/fstab which would successfully remount my Entware and SMB filesystems with "mount -a", but when I do that nowadays, both filesystems become unmounted! I have not figured this out yet, so I just reboot instead.

Update: According to https://www.snbforums.com/threads/a...ow-available-for-all-models.79450/post-771663
/jffs/configs/fstab is no longer copied to /etc/fstab on HND routers as of 386.7. Instead, /rom/etc/fstab is used but not sure yet how to edit it, perhaps one cannot.

Update2: I created a script mount.sh in /jffs/configs to mount the USB filesystems. The contents are:
Code:
mount -t ext4 /dev/sda1 /tmp/mnt/ent -o rw,nodev,relatime,data=ordered,user_xattr
mount -t ext4 /dev/sda2 /tmp/mnt/smb -o rw,nodev,relatime,data=ordered,user_xattr
Edit the filesystem mount points.
If already mounted, you will safely receive a message that the device is busy.
 
Last edited:

Apprentice

Occasional Visitor
Whether you use an SSD or thumb drive, I would recommend:
Thanks very much for all your feedback @EmeraldDeer ! Have done a long fast drive today, and my brain is a little fried so will come back to this tomorrow fresh with an SSD in hand!!

But am getting a little concerned this stuff is not robust. Is there a bullet proof minimum config that would be less prone to crashing, that would accommodate my bottom line must haves skynet and pixelserv?

All comments gratefully received.
 

EmeraldDeer

Very Senior Member
The approach above is solid. If you continue to have issues afterwards, then some other factor would be involved.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top