What's new

Asus AC87U fdisk problem

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

Ojee

Occasional Visitor
So I'm trying to install a swap file on a Sandisk Ultra 16gb usb stick, using this guide:
https://github.com/RMerl/asuswrt-merlin/wiki/Minidlna:--Common-Issues-&-Solutions

The first step of this guide is to create 2 linux partitions, using this guide:
http://www.algissalys.com/how-to/format-and-partition-usb-asuswrt-routers

However, after deleting all partitions, I press 'p' and it still shows me the two same partitions!

Number Start (sector) End (sector) Size Code Name

1 40 409639 200M 0700 EFI System Partition

2 411648 30461951 14.3G 0700 Untitled

So I'm stuck. Because when I press 'd' again, it says there are no partitions to delete?
Does anyone know what I'm doing wrong?
 
The first step of this guide is to create 2 linux partitions, using this guide:
http://www.algissalys.com/how-to/format-and-partition-usb-asuswrt-routers
Better to use a swap file and not a partition: If you use the partition it can wear-out the flash drive fast...
I create on every reboot a new swap file to have it spread over the whole flash drive - and from time to time I delete the old swap files - below my script which I launch via post-mount user script.

Code:
#!/bin/sh
#
# Write to syslog.log
/usr/bin/logger -t START_$(basename $0) "started [$@]"
#
# Create a log file for the script
SCRLOG=/tmp/$(basename $0).log
touch $SCRLOG
NOW=$(date +"%Y-%m-%d %H:%M:%S")
echo $NOW "START_$(basename $0) started [$@]" >> $SCRLOG
#
# Wait a bit to get by sure the actual date
sleep 10
#
# Get new swap file name
FNAME=/tmp/mnt/ac87u/swap$(date +%d)
echo $FNAME >> $SCRLOG
#
# Remove existing swap file (from today)
rm $FNAME >> $SCRLOG
#
# Create new file
dd if=/dev/zero of=$FNAME bs=1024 count=262144 >> $SCRLOG
#dd if=/dev/zero of=$FNAME bs=1024 count=524288 >> $SCRLOG
#
# Make the new file a swap file
mkswap $FNAME >> $SCRLOG
#
# Use new swap file
swapon $FNAME >> $SCRLOG
#
NOW=$(date +"%Y-%m-%d %H:%M:%S")
if [ "$?" -ne 0 ]
then
  echo $NOW "Error in script  execution! Script: $0" >> $SCRLOG
else
  echo $NOW "Script execution OK. Script: $0" >> $SCRLOG
fi
/usr/bin/logger -t STOP_$(basename $0) "return code $?"
exit $?
 
Ok that seems like a better idea then! How do I use the script? I'm really new to this.
 

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