What's new

How make swap on asuswrt merlin?

  • 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!

It is interesting, because following the detailed instructions from here I obtained swap file and everything seems working, but fdisk -l shows FAT16 system at my USB stick :)
But mount command correctly displays ext2.
Fdisk bug?
 
Last edited:
It is interesting, because following the detailed instructions from here I obtained swap file and everything seems working, but fdisk -l shows FAT16 system at my USB stick :)
But mount command correctly displays ext2.
Fdisk bug?
Interesting. Could you post the complete output from 'fdisk -l'? I suspect you still have the remnants of the original FAT16 MBR or partition table still on that stick.

I recall seeing in a post someone recommending using the 'dd' command starting with sector 0 for some number of bytes (500?) to explicitly erase the existing partition table, then proceeding to set up their EXT2 partition on the flash drive, but I can't find it again (at least not quickly). I've not run into any problems like that, so I didn't pursue it.
 
Here we go:
gjf@Router:/tmp/home/root# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=127744k,nr_inodes=31936,mode=755)
proc on /proc type proc (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
usbfs on /proc/bus/usb type usbfs (rw,relatime)
/dev/sda1 on /tmp/mnt/sda1 type ext2 (rw,nodev,relatime,errors=continue,user_xattr)
/dev/sdb1 on /tmp/mnt/VERBATIM_HD type tntfs (rw,nodev,relatime,uid=0,gid=0,umask=00,nls=utf8,min_prealloc_size=64k,max_prealloc_size=128M,readahead=1M,user_xattr,case_sensitive,nocache,fail_safe,hidden=show,dotfile=show,errors=continue,mft_zone_multiplier=1)
/dev/sdb2 on /tmp/mnt/Someware type ext3 (rw,nodev,relatime,errors=continue,user_xattr,barrier=0,data=ordered)

gjf@Router:/tmp/home/root# fdisk -l
Disk /dev/mtdblock0: 0 MB, 524288 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/mtdblock0 doesn't contain a valid partition table
Disk /dev/mtdblock1: 1 MB, 1572864 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/mtdblock1 doesn't contain a valid partition table
Disk /dev/mtdblock2: 65 MB, 65011712 bytes
255 heads, 63 sectors/track, 7 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/mtdblock2 doesn't contain a valid partition table
Disk /dev/mtdblock3: 63 MB, 63319040 bytes
255 heads, 63 sectors/track, 7 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/mtdblock3 doesn't contain a valid partition table
Disk /dev/mtdblock4: 65 MB, 65798144 bytes
255 heads, 63 sectors/track, 7 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/mtdblock4 doesn't contain a valid partition table
Disk /dev/mtdblock5: 1 MB, 1310720 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/mtdblock5 doesn't contain a valid partition table
Disk /dev/sda: 1003 MB, 1003487232 bytes
16 heads, 32 sectors/track, 3828 cylinders
Units = cylinders of 512 * 512 = 262144 bytes
Device Boot Start End Blocks Id System
/dev/sda1 16 3828 975936 6 FAT16
Disk /dev/sdb: 1000.2 GB, 1000204883968 bytes
133 heads, 16 sectors/track, 918009 cylinders
Units = cylinders of 2128 * 512 = 1089536 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 913082 971517952 7 HPFS/NTFS
/dev/sdb2 913082 918008 5240832 83 Linux
 
I see it, and I agree with you, but I don't have an explanation. I still suspect there are remnants of its previous life. Perhaps format it on another device, using something like MiniTool Partition Wizard? Or search out the proper command to explicitly erase the partition table (dd ...). Or just ignore it, if its working OK for you.;)

I think you'd be hard pressed to convince anyone there's a bug in fdisk, or at least one worth fixing. That's an old, very basic command.
 
Hey abugray,

Its there in the wiki page https://github.com/RMerl/asuswrt-merlin/wiki

Assuming you have 1 hdd 1 partition whith no lable and mounted. I am using a swapfile. ssh to router


dd if=/dev/zero of=/tmp/mnt/sda1/swapfile bs=1024 count=512000

mkswap /tmp/mnt/sda1/swapfile

swapon /tmp/mnt/sda1/swapfile

echo '
#!/bin/sh
#
# Turn On Usage Of Swapfile
if [ -f "/tmp/mnt/sda1/swapfile" ];then
swapon /tmp/mnt/sda1/swapfile
echo "Turning Swapfile On"
fi
' >> /jffs/scripts/post-mount

chmod a+rx /jffs/scripts/*


HTH
 
I see it, and I agree with you, but I don't have an explanation. I still suspect there are remnants of its previous life. Perhaps format it on another device, using something like MiniTool Partition Wizard? Or search out the proper command to explicitly erase the partition table (dd ...). Or just ignore it, if its working OK for you.;)

I think you'd be hard pressed to convince anyone there's a bug in fdisk, or at least one worth fixing. That's an old, very basic command.
Nah, it's not possible: I formatted everything within ASUS console. And yes - dd command was the same.
Really - it works and I don't care ;)
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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