What's new

swap file creation

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

pigcanswim

Occasional Visitor
I had issues with my old swap file where it does not mount properly (stays unmounted).
Wondered if it was my USB drive that had issues, took it out and plug into my pc and USB was detected.
Reinserted into router but still unmounted.
Decided to redo a swapfile so i took it out reformat(exfat32) on windows and brought it back to the router to reconfig the swap.
After creating swap successfully, swap was detected however my ram usage at this point was around 90%.
Did a router reboot and USB was unmounted again

amtm dcl shows:
Sun Feb 9 13:33:38 MYT 2020 Waited 9s for NTP to sync date
Sun Feb 9 13:33:38 MYT 2020 Probing 'ext4' on device /dev/sda1
Running disk check v2.8, with command 'e2fsck -p' on /dev/sda1
swap: clean, 11/491520 files, 67943/1964276 blocks
Sun Feb 9 13:33:46 MYT 2020 Disk check done on /dev/sda1
Sun Feb 9 06:26:11 UTC 2020 Waited 12s for NTP to sync date
Sun Feb 9 14:26:11 MYT 2020 Probing 'unknown' on device /dev/sda
Sun Feb 9 14:26:11 MYT 2020 /dev/sda Unknown filesystem (e.g. exFAT) or no pak
---------------------------------------------------

Not entirely sure why it was probing ext4 before reboot but unknown after reboot. Am I doing something wrong?

note: I did not really have an issue until recently where my ram usage is getting high and thats when i found out my USB is unmounted. I had quite a few scripts installed but previously before I noticed these problems.
Right now with my swap 'unusable' my diversion is gone meaning some other scripts are disabled. Reason for doing this is to get diversion back up and running.
 
Last edited:
I had issues with my old swap file where it does not mount properly (stays unmounted).
Wondered if it was my USB drive that had issues, took it out and plug into my pc and USB was detected.
Reinserted into router but still unmounted.
Decided to redo a swapfile so i took it out reformat(exfat32) on windows and brought it back to the router to reconfig the swap.
After creating swap successfully, swap was detected however my ram usage at this point was around 90%.
Did a router reboot and USB was unmounted again

amtm fdl shows:
Sun Feb 9 13:33:38 MYT 2020 Waited 9s for NTP to sync date
Sun Feb 9 13:33:38 MYT 2020 Probing 'ext4' on device /dev/sda1
Running disk check v2.8, with command 'e2fsck -p' on /dev/sda1
swap: clean, 11/491520 files, 67943/1964276 blocks
Sun Feb 9 13:33:46 MYT 2020 Disk check done on /dev/sda1
Sun Feb 9 06:26:11 UTC 2020 Waited 12s for NTP to sync date
Sun Feb 9 14:26:11 MYT 2020 Probing 'unknown' on device /dev/sda
Sun Feb 9 14:26:11 MYT 2020 /dev/sda Unknown filesystem (e.g. exFAT) or no pak
---------------------------------------------------

Not entirely sure why it was probing ext4 before reboot but unknown after reboot. Am I doing something wrong?

note: I did not really have an issue until recently where my ram usage is getting high and thats when i found out my USB is unmounted. I had quite a few scripts installed but previously before I noticed these problems.
Right now with my swap 'unusable' my diversion is gone meaning some other scripts are disabled. Reason for doing this is to get diversion back up and running.
Did you format the disk with amtm after having a go with it in Windows?
Looks like the partition table contains inconclusive info.
 
Yes I formated it again with amtm fd and did a sw on ext4. I supposed thats why the router detected ext4 after creating but once I did a reboot it could not detect it anymore
 
I suggest reformatting again, omitting the Windows sidestep.
 
I recommend you trying @L&LD guide
amtm Step-by-Step https://www.snbforums.com/threads/amtm-step-by-step-install-guide-l-ld.56237/#post-483421

this can insure you use amtm to properly format and setup a swap on your device.

Particularly this part
Prepare the USB Drive for the swap file, Entware, and scripts.
  • If your USB drive is used, make sure to save all files off of it first
  • Format it in your computer with the NTFS file format
  • Insert the USB drive into a router USB port
  • Use your PuTTY skills above to SSH into the router
  • ENTER "AMTM" *omit old step*
  • Using amtm's 'fd' command, format the USB drive to Ext4 with journaling and
  • Make sure to also Label the drive too. The router will reboot.
    • Note: MIPS routers are limited to ext2 and ext3
  • Create a swap file using amtm's 'sw' command. I recommend the 2GB size
    • Be patient while this file is created. It will be worth it
  • Using amtm's 'dc' command, enable the disk checker utility
  • Reboot the router and make sure to check the disk checker log to ensure the USB drive 'passes'
 
1)reformat my USB and router reboot
2)unable to do any swap file as router is unable to detect the USB as ext4.
Sun Feb 9 16:16:18 MYT 2020 Waited 10s for NTP to sync date
Sun Feb 9 16:16:18 MYT 2020 Probing 'unknown' on device /dev/sda
Sun Feb 9 16:16:18 MYT 2020 /dev/sda Unknown filesystem (e.g. exFAT) or no partition table (e.g. blank media) - skipping check

3)2nd attempt at formatting USB drive
Formatting disk as "ext4", enabling journalling
mke2fs 1.42.13 (17-May-2015)
Creating filesystem with 1964276 4k blocks and 491520 inodes
Filesystem UUID:
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:done

---dcl---
Sun Feb 9 16:23:34 MYT 2020 Waited 14s for NTP to sync date
Sun Feb 9 16:23:34 MYT 2020 Probing 'ext4' on device /dev/sda1
Running disk check v2.8, with command 'e2fsck -p' on /dev/sda1
swap: clean, 11/491520 files, 67943/1964276 blocks
Sun Feb 9 16:23:34 MYT 2020 Disk check done on /dev/sda1

--sw--
No compatible device available to create
a swap file

On my router main page it says USB is unmounted.

4)rebooted router to see if it's detected.
5) still listed as unmounted
--dcl--
Sun Feb 9 16:28:26 MYT 2020 Waited 10s for NTP to sync date
Sun Feb 9 16:28:26 MYT 2020 Probing 'ext4' on device /dev/sda1
Running disk check v2.8, with command 'e2fsck -p' on /dev/sda1
swap: clean, 11/491520 files, 67943/1964276 blocks
Sun Feb 9 16:28:26 MYT 2020 Disk check done on /dev/sda1
 
1)reformat my USB and router reboot
2)unable to do any swap file as router is unable to detect the USB as ext4.
Sun Feb 9 16:16:18 MYT 2020 Waited 10s for NTP to sync date
Sun Feb 9 16:16:18 MYT 2020 Probing 'unknown' on device /dev/sda
Sun Feb 9 16:16:18 MYT 2020 /dev/sda Unknown filesystem (e.g. exFAT) or no partition table (e.g. blank media) - skipping check

3)2nd attempt at formatting USB drive
Formatting disk as "ext4", enabling journalling
mke2fs 1.42.13 (17-May-2015)
Creating filesystem with 1964276 4k blocks and 491520 inodes
Filesystem UUID:
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:done

---dcl---
Sun Feb 9 16:23:34 MYT 2020 Waited 14s for NTP to sync date
Sun Feb 9 16:23:34 MYT 2020 Probing 'ext4' on device /dev/sda1
Running disk check v2.8, with command 'e2fsck -p' on /dev/sda1
swap: clean, 11/491520 files, 67943/1964276 blocks
Sun Feb 9 16:23:34 MYT 2020 Disk check done on /dev/sda1

--sw--
No compatible device available to create
a swap file

On my router main page it says USB is unmounted.

4)rebooted router to see if it's detected.
5) still listed as unmounted
--dcl--
Sun Feb 9 16:28:26 MYT 2020 Waited 10s for NTP to sync date
Sun Feb 9 16:28:26 MYT 2020 Probing 'ext4' on device /dev/sda1
Running disk check v2.8, with command 'e2fsck -p' on /dev/sda1
swap: clean, 11/491520 files, 67943/1964276 blocks
Sun Feb 9 16:28:26 MYT 2020 Disk check done on /dev/sda1

did you try formatting it to a NTFS device on computer first then try ext4 formating on router.
 
No, why would that help?

Remove device through the router UI and unplug, wait until things settle down on that page, then plug it back in.
I was referring to if there was something wrong with the formatting as far as the mbr is concerned, somethings the router format doesn't always properly address.
 
I was referring to if there was something wrong with the formatting as far as the mbr is concerned, somethings the router format doesn't always properly address.

I did a reformat from the router to ntfs and there was an error(which the router fixed).
I proceed with creating ext4 and swapfile afterwards and installed diversion as well.
Pixelserv was however not enabled after the install was completed so I did a reboot.
USB turns out unmounted again
Its back to unknown format again.
Sun Feb 9 17:19:17 MYT 2020 Waited 12s for NTP to sync date
Sun Feb 9 17:19:17 MYT 2020 Probing 'unknown' on device /dev/sda
Sun Feb 9 17:19:17 MYT 2020 /dev/sda Unknown filesystem (e.g. exFAT) or no partition table (e.g. blank media) - skipping check
 
Set that device aside for other uses. It might not work well in Asuswrt-Merlin (not his fault).
 
I tried another USB but its the same as this one. After reboots my router is unable to mount my other USB drive as well. Should I do a reformat on my jffs and reinstall the things/scripts I have?

edit. Sorry, after letting the drive settle down it seems its now detected and is working however my tools page is saying no swap file configured instead of the 2gb that I set on my USB. I don't remember it being like that previously when it was working.
HcNufen.png
 
Last edited:
I tried another USB but its the same as this one. After reboots my router is unable to mount my other USB drive as well. Should I do a reformat on my jffs and reinstall the things/scripts I have?
No, not yet. What does the routers Syslog say regarding that device, so far you only posted the amtm dcl.
The firmware does it's checks first, then hands over to amtm's disk-check briefly.
 
No, not yet. What does the routers Syslog say regarding that device, so far you only posted the amtm dcl.
The firmware does it's checks first, then hands over to amtm's disk-check briefly.
It seems the drive is now detected but my swap file is missing so I'm now attempting to make another swapfile.
 
Still waiting for relevant Syslog entries, it would also say why the swap was not enabled.
 
the logs I found regarding swap.
May 5 13:07:06 hotplug: USB ext4 fs at /dev/sda1 mounted on /tmp/mnt/swap
May 5 13:07:06 usb: USB ext4 fs at /dev/sda1 mounted on /tmp/mnt/swap.
May 5 13:07:06 kernel: EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: user_xattr
May 5 13:07:06 custom_script: Running /jffs/scripts/post-mount (args: /tmp/mnt/swap)
May 5 13:07:06 Diversion: Starting Entware and Diversion services on /tmp/mnt/swap

another line
Feb 9 18:45:38 kernel: Adding 2097148k swap on /tmp/mnt/swap/myswap.swp. Priority:-1 extents:4 across:2244604k

but theres no more logfile regarding swap after the one above
 
the logs I found regarding swap.
May 5 13:07:06 hotplug: USB ext4 fs at /dev/sda1 mounted on /tmp/mnt/swap
May 5 13:07:06 usb: USB ext4 fs at /dev/sda1 mounted on /tmp/mnt/swap.
May 5 13:07:06 kernel: EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: user_xattr
May 5 13:07:06 custom_script: Running /jffs/scripts/post-mount (args: /tmp/mnt/swap)
May 5 13:07:06 Diversion: Starting Entware and Diversion services on /tmp/mnt/swap
hmmmmm

do you have anything else running in post-mount by chance? just a thought. or have you installed skynet? do you have any other logs before and after?
 
hmmmmm

do you have anything else running in post-mount by chance? just a thought. or have you installed skynet? do you have any other logs before and after?
I'm not sure. I did not manually insert anything into my post-mount. If there is it would have been the scripts that I have doing that, but I don't think there's any script that clashes with swapon?

I tried to cd into post-mount but it failed.
 
I'm not sure. I did not manually insert anything into my post-mount. If there is it would have been the scripts that I have doing that, but I don't think there's any script that clashes with swapon?

I tried to cd into post-mount but it failed.
if you have scripts that take too long or cause delays or processing issues, it could be causing problems, you should try disabling any of your "scripts" if any are listed in post-mount by simply ## commenting them out, so diversion can have priority, just for testing.
 
if you have scripts that take too long or cause delays or processing issues, it could be causing problems, you should try disabling any of your "scripts" if any are listed in post-mount by simply ## commenting them out, so diversion can have priority, just for testing.
My bad. I did not notice you asking but yes, I have skynet installed. Do i remove it?
 

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