SmallNetBuilder Forums
Go Back   SmallNetBuilder Forums > Wireless Networking > ASUS Wireless > Asuswrt-Merlin

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-05-2013, 01:18 PM
mmmmmm mmmmmm is offline
Member
 
Join Date: Nov 2012
Posts: 35
Thanks: 24
Thanked 3 Times in 2 Posts
mmmmmm is just starting out
Default fstab - custom

I have an USB stick that I am using to install optional packages.
My problem is that sometime gets mounted as sda1 other times as sdb1.

This is a bit of a problem and I am trying to use the fstab.add feature of Merlin's version to mount the usb stick by UUID.

I've created a /jffs/config/fstab.add file, with the content below, but it does not seem to solve my problem. I suppose that my fstab.add file is not correct.
Code:
UUID=c6062286-5f15-4aaa-a142-580f9441ce92       /mnt/sda1       ext2    default,umask=077,gid=46         0      0
Beside this, I have another USB HDD with 2 partitions that also gets switched sometimes. Since I am using this HDD for my transmission download, this is quite problematic.

The UUIDs are:
Code:
admin@RT-N66U:/tmp/etc# blkid
/dev/sdc5: LABEL="SAMSUNG" UUID="01CCAADD89839CA0"
/dev/sdc1: LABEL="SAMSUNG" UUID="01CCAADD84C35570"
/dev/sdb1: UUID="c6062286-5f15-4aaa-a142-580f9441ce92"
Please advice.

Last edited by mmmmmm; 02-05-2013 at 02:18 PM.
Reply With Quote
  #2  
Old 02-06-2013, 01:26 AM
mmmmmm mmmmmm is offline
Member
 
Join Date: Nov 2012
Posts: 35
Thanks: 24
Thanked 3 Times in 2 Posts
mmmmmm is just starting out
Default

RMerlin,

please help!

I was not able to find any tutorial on how to properly use the custom config files so maybe the information here will turn out to be useful.

Thank you.
Reply With Quote
  #3  
Old 02-06-2013, 01:41 AM
RMerlin's Avatar
RMerlin RMerlin is online now
Very Senior Member
 
Join Date: Apr 2012
Location: Canada
Posts: 9,536
Thanks: 47
Thanked 5,079 Times in 2,152 Posts
RMerlin is just starting out
Default

From the README:
Code:
The list of available config overrides:

* dnsmasq.conf
* vsftpd.conf
* pptpd.conf
* dhcp6s.conf
* hosts (for /etc/hosts)
* smb.conf
* minidlna.conf
* profile (shell profile, only profile.add suypported)
* upnp (for miniupnpd)
* radvd.conf
* fstab (only fstab supported, remember to create mount point
        through init-start first if it doesn't exist!)
There is no support for fstab.add, only a full replacement in the form of fstab. The reason is that the firmware does not create an fstab file, so there is nothing to append to.
__________________
Asuswrt-Merlin: Customized firmware for Asus routers
Github: github.com/RMerl - Twitter: RMerlinDev
See the sticky post for more info.
Reply With Quote
The Following User Says Thank You to RMerlin For This Useful Post:
  #4  
Old 02-06-2013, 01:45 AM
mmmmmm mmmmmm is offline
Member
 
Join Date: Nov 2012
Posts: 35
Thanks: 24
Thanked 3 Times in 2 Posts
mmmmmm is just starting out
Default

Quote:
Originally Posted by RMerlin View Post
From the README:
Sorry about that. I read the readme but it was not that clear to me. My bad.
So the init-start is the way to go.


Thank you very much.

PS. I will post my finding once I get my setup working.
Reply With Quote
  #5  
Old 02-06-2013, 09:23 AM
mmmmmm mmmmmm is offline
Member
 
Join Date: Nov 2012
Posts: 35
Thanks: 24
Thanked 3 Times in 2 Posts
mmmmmm is just starting out
Default

Here is are my working scripts.

1. Get the UUIDs, current mount points, mount options of the connected USB devices:
Code:
# more /etc/mtab 
rootfs / rootfs rw 0 0
..............................
/dev/sda1 /tmp/mnt/sda1 ext2 rw,nodev,noatime 0 0
/dev/sdc1 /tmp/mnt/samsungp ufsd rw,nodev,noatime,nls=utf8,fmask=0,dmask=0,force 0 0
/dev/sdc5 /tmp/mnt/samsungo ufsd rw,nodev,noatime,nls=utf8,fmask=0,dmask=0,force 0 0
Code:
# blkid
/dev/sdc5: LABEL="SAMSUNG" UUID="01CCAADD89839CA0"
/dev/sdc1: LABEL="SAMSUNG" UUID="01CCAADD84C35570"
/dev/sda1: UUID="c6062286-5f15-4aaa-a142-580f9441ce92"
2. Create /jffs/scripts/init-start script:
Code:
# more /jffs/scripts/init-start 
#!/bin/sh

mkdir -p /tmp/mnt/sda1
echo  "UUID=c6062286-5f15-4aaa-a142-580f9441ce92        /tmp/mnt/sda1   ext2    rw,nodev,noatime        0       0" > /etc/fstab

mkdir -p /tmp/mnt/samsungo
echo  "UUID=01CCAADD89839CA0    /tmp/mnt/samsungo       ufsd    rw,nodev,noatime,nls=utf8,fmask=0,dmask=0,force 0       0" >> /etc/fstab

mkdir -p /tmp/mnt/samsungp
echo  "UUID=01CCAADD84C35570    /tmp/mnt/samsungp       ufsd    rw,nodev,noatime,nls=utf8,fmask=0,dmask=0,force 0       0" >> /etc/fstab
A reboot or a 'mount -a' should mount the drives as configured in the fstab file.

Beside the mount point switching issue, due to the fact that my HDD is NTFS formatted, I was experiencing some problems with transmission daemon not being able to find the download directory on the drive. I decided to delay the transmission daemon starting and I did the following:

1. Remove the x permission of the "/opt/etc/init.d/S88transmission" script.
2. Create /jffs/post-mount script:
Code:
# more /jffs/scripts/post-mount 
#!/bin/sh

sleep 1

transmission_file=`find /opt/etc/init.d/ -name *transmission*`
chmod 777 $transmission_file
$transmission_file start
chmod -x $transmission_file
Reply With Quote
The Following 2 Users Say Thank You to mmmmmm For This Useful Post:
  #6  
Old 02-08-2013, 06:25 AM
Serpent Serpent is offline
New Member
 
Join Date: Jul 2012
Posts: 20
Thanks: 10
Thanked 7 Times in 5 Posts
Serpent is just starting out
Default

Nice work, mmmmmm!

But you can also use the fstab file from /jffs/config/, writting in it:
Code:
UUID=c6062286-5f15-4aaa-a142-580f9441ce92        /tmp/mnt/sda1   ext2    rw,nodev,noatime        0       0

UUID=01CCAADD89839CA0    /tmp/mnt/samsungo       ufsd    rw,nodev,noatime,nls=utf8,fmask=0,dmask=0,force 0       0

UUID=01CCAADD84C35570    /tmp/mnt/samsungp       ufsd    rw,nodev,noatime,nls=utf8,fmask=0,dmask=0,force 0       0
Leave in init-start only the mkdir lines and a "mount -a" line (maybe isn't required, but doesn't harm...).

I think it's worth to add also a swap space, using this line in init-start:
Code:
swapon UUID="swap_partition_UUID"
Reply With Quote
The Following User Says Thank You to Serpent For This Useful Post:
  #7  
Old 02-08-2013, 07:49 AM
mmmmmm mmmmmm is offline
Member
 
Join Date: Nov 2012
Posts: 35
Thanks: 24
Thanked 3 Times in 2 Posts
mmmmmm is just starting out
Default

Quote:
Originally Posted by Serpent View Post
Nice work, mmmmmm!

But you can also use the fstab file from /jffs/config/, writting in it:

Leave in init-start only the mkdir lines and a "mount -a" line (maybe isn't required, but doesn't harm...).

I think it's worth to add also a swap space, using this line in init-start:
Code:
swapon UUID="swap_partition_UUID"
Thank you Serpent for sharing this.
I will do the changes as you suggested as it makes more sense.

I was not aware about the swapon instruction.
I think it is a nice feature. Is there a way to set the size of the swap?

Thanks again.
Reply With Quote
  #8  
Old 02-08-2013, 02:21 PM
Serpent Serpent is offline
New Member
 
Join Date: Jul 2012
Posts: 20
Thanks: 10
Thanked 7 Times in 5 Posts
Serpent is just starting out
Default

Swap is indeed a very useful feature, especially when you are transferring large quantities of data, like me.

Usually you will use a whole partition of a hard disk for swapping. However, with the 2.6 Linux kernel, swap files are almost as fast as swap partitions, although I recommend using a swap partition.

The beginning(first cylinders) of a HDD is the best place for a swap space, on any OS. So you need to make a partition of 256 or 512 MB and leave it raw(not formated).
After that run the mkswap command:
Code:
mkswap /dev/sdx1
Find the UUID of that swap partition with blkid and test it:
Code:
swapon UUID="swap_partition_UUID"
Verify it with free command.

If is working add the command swapon to init-start.
Reply With Quote
The Following 3 Users Say Thank You to Serpent For This Useful Post:
  #9  
Old 02-12-2013, 04:33 PM
huotg01's Avatar
huotg01 huotg01 is offline
Senior Member
 
Join Date: Feb 2013
Posts: 133
Thanks: 64
Thanked 10 Times in 9 Posts
huotg01 is just starting out
Default

Quote:
Originally Posted by Serpent View Post
Swap is indeed a very useful feature, especially when you are transferring large quantities of data, like me.
This is something new for me (swapping in the context of a router). Could you give a little bit more information about how useful it is and why ?

Thanks,

GH
Reply With Quote
  #10  
Old 02-12-2013, 05:13 PM
joegreat's Avatar
joegreat joegreat is offline
Very Senior Member
 
Join Date: Jan 2013
Location: Vienna, Austria
Posts: 458
Thanks: 572
Thanked 123 Times in 101 Posts
joegreat is just starting out
Wink Swap file is very usefull!

Quote:
Originally Posted by huotg01 View Post
This is something new for me (swapping in the context of a router). Could you give a little bit more information about how useful it is and why ?
Hi,

Well, if you run Transmission (or any other memory heavy piece of software) then it can easily run out of memory.

Here my memory stat:
Code:
chief@RT-N66U:/# free
             total         used         free       shared      buffers
Mem:        239868       185944        53924            0        34884
-/+ buffers:             151060        88808
Swap:        64252         2160        62092
As you can see from above, ~2MB are swapped out to disk.

If the swap is not used, it does no harm.
But if the kernel runs out of memory, you better have a swap avaliable, or you run into serious troubles!

There are two situations, where Linux kernels get into panic mode: Out of memory and out of space on the root filesystem.

With kind regards
Joe

Last edited by joegreat; 02-12-2013 at 05:22 PM.
Reply With Quote
The Following 2 Users Say Thank You to joegreat For This Useful Post:
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -4. The time now is 07:40 PM.


Top 10 Stats
Top Posters* Top Thanked
RMerlin  333
sm00thpapa  226
stevech  190
azazel1024  148
KGB7  133
htismaqe  89
philmiami  83
jim769  79
AcostaJA  69
ColinTaylor  59
RMerlin  5078
stevech  315
ryzhov_al  249
TeHashX  209
RogerSC  187
L&LD  186
joegreat  123
jlake  121
sinshiva  111
sfx2000  111
Most Viewed Threads* Hottest Threads*
Old ASUS RT-N66U...  23502
Old NETGEAR...  12923
Old 3.0.0.4.376.1...  6711
Old Switched...  6688
Old NEW RT-AC68R...  6372
Old ASUS...  5799
Old ASUS RTAC68U...  3462
Old Netgear...  3223
Old N66U daily...  2828
Old ASUS...  2670
Old ASUS RT-N66U...  169
Old NETGEAR...  161
Old Switched...  57
Old NEW RT-AC68R...  56
Old ASUS...  51
Old N66U daily...  47
Old Netgear...  41
Old Which router...  41
Old ASUS RTAC68U...  41
Old TP-Link...  38


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2006-2014 Pudai LLC All Rights Reserved.