OpenWrt Forum Archive

Topic: noatime

The content of this topic has been archived on 26 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

HI,
i have installed openwrt on alix board, but i don't understand how can preserve my Compact Flash.

i edited the file /lib/preinit/10_check_for_mtd    so:

....

mount_no_mtd() {
    mtd unlock rootfs
    mount -o remount,rw,noatime /dev/root /
}
....

i have added noatime option.

Now my mount list is:


root@OpenWrt:/lib/preinit# mount

rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw,noatime)
none on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime)
tmpfs on /dev type tmpfs (rw,relatime,size=512k)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
none on /proc/bus/usb type usbfs (rw,relatime)

root@OpenWrt:/lib/preinit#

is sufficient to preserve the compact flash?

or should I do for all?

The files to edit are always in preinit directory?


I can not find correct information on how to set noatime in openwrt.
Many posts say to change the fstab file, but it seems that openwrt is not true.

Help me please?

Thanks

in /etc/config/ i haven't the file fstab.

i must create it?

can you to do a example for my configuration?

thank you

Install the block-mount package: opkg update; opkg install block-mount

Then you will have the fstab UCI configuration file.

(Last edited by Dogge on 19 Apr 2010, 21:20)

thank you very much, now i have the file.
i added option noatime in fstab so:

This is my file:

config global automount
        option from_fstab 1
        option anon_mount 1

config global autoswap
        option from_fstab 1
        option anon_swap 0config mount
        option target   /home
        option device   /dev/sda1
        option fstype   ext3
        option options  rw,sync,noatime

        option enabled  0
        option enabled_fsck 0

config mount
        option target   /home
        option device   /dev/sda1
        option fstype   ext3
        option options  rw,sync,noatime

        option enabled  0
        option enabled_fsck 0

config swap
        option device   /dev/sda2
        option enabled  0


When i reboot i see this:

root@OpenWrt:/etc/config# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw,relatime)
none on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime)
tmpfs on /dev type tmpfs (rw,relatime,size=512k)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
none on /proc/bus/usb type usbfs (rw,relatime)
root@OpenWrt:/etc/config#



Why i don't see noatime in fs partition?

edit:
i must write so???

config mount
        option target   /
        option device   /dev/sda1
        option fstype   ext2
        option options  rw,sync,noatime

        option enabled  0
        option enabled_fsck 0


thank you

(Last edited by jekyll on 19 Apr 2010, 21:46)

You have to enable the mount section.

uci set fstab.@mount[0].enabled=1
uci commit fstab
/etc/init.d/fstab restart
mount

(Last edited by Dogge on 19 Apr 2010, 21:47)

i must send this comands after i edited the file?

But what is the correct configuration file?

thank you again

No. With these commands you change the /etc/config/fstab file directly via the command line and don't have to edit it.

These commands changes the value of the enabled option in the mount section to 1. Writes the fstab config file to the flash and restarts fstab service.

To print the file run: 'uci export fstab' and paste it here.

(Last edited by Dogge on 19 Apr 2010, 21:52)

this is my output:


config 'global' 'automount'
        option 'from_fstab' '1'
        option 'anon_mount' '1'

config 'global' 'autoswap'
        option 'from_fstab' '1'
        option 'anon_swap' '0'

config 'mount'
        option 'target' '/home'
        option 'device' '/dev/sda1'
        option 'fstype' 'ext3'
        option 'options' 'rw,sync,noatime'
        option 'enabled_fsck' '0'
        option 'enabled' '1'

config 'swap'
        option 'device' '/dev/sda2'
        option 'enabled' '0'


I don't understand how i can mount all this with noatime option:

root@OpenWrt:/etc/config# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw,relatime)
none on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime)
tmpfs on /dev type tmpfs (rw,relatime,size=512k)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
none on /proc/bus/usb type usbfs (rw,relatime)
root@OpenWrt:/etc/config#

can you make a example with this mount point?

thank you

I am out of ideas...

??????

i think this procedure is no correct for me:

this is my output:

config 'global' 'automount'
        option 'from_fstab' '1'
        option 'anon_mount' '1'



config 'global' 'automount'
        option 'from_fstab' '1'
        option 'anon_mount' '1'

config 'global' 'autoswap'
        option 'from_fstab' '1'
        option 'anon_swap' '0'

config 'mount'
        option 'target' '/'
        option 'device' '/dev/root'
        option 'fstype' 'ext3'
        option 'options' 'rw,noatime'
        option 'enabled_fsck' '0'
        option 'enabled' '1'

config 'swap'
        option 'device' '/dev/sda2'
        option 'enabled' '0'



this is the output of mount:

root@OpenWrt:~# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw,relatime)
none on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime)
tmpfs on /dev type tmpfs (rw,relatime,size=512k)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
none on /proc/bus/usb type usbfs (rw,relatime)
root@OpenWrt:~# mount

i think that root directory is already mount when fstab start and i can't mount / directory.

Can you help me?

i want mount all mount points with noatime option.

thank you.

(Last edited by jekyll on 20 Apr 2010, 07:48)

i'm very noob on this, can someone clarify this?? i also would like to mount everithing with noatime if it's possible..

is this ok?? i edited fstab WITHOUT the flash disk inserted..

root@OpenWrt:~# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /dev type tmpfs (rw,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,noatime,mode=600)
/dev/sda1 on /overlay type ext2 (rw,sync,noatime,user_xattr,barrier=1)
overlayfs:/overlay on / type overlayfs (rw,relatime,lowerdir=/,upperdir=/overlay)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
none on /proc/bus/usb type usbfs (rw,relatime)

(Last edited by nebbia88 on 26 Jul 2012, 12:41)

The discussion might have continued from here.