Opened 8 years ago

Closed 6 years ago

Last modified 4 years ago

#6077 closed enhancement (obsolete)

Better support for persistent /var (on USB disk)

Reported by: mike@… Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc: mike@…


I am working with a Linksys WRT160NL and would like a persistent /var. I am using an external USB disk to implement this. I have found a few things that make this slightly difficult:

  1. Issue: /etc/init.d/boot creates several required directories in /var/. This script runs before the fstab script runs. As a result, the directories are not created on my persistent volume. Recommendation: move the creation of directories within var to a new script that executes after fstab but before services that require /var (or should I use mini_fo?).
  1. Issue: /etc/init.d/fstab runs before /etc/init.d/usb. This seems to mean that fstab's "mount -a" call will not mount USB disks because they are not yet available. Solution: run usb at priority 38 and fstab at priority 39. I also had to add a "sleep 10" to the usb script, after "/bin/mount -t usbfs none /proc/bus/usb." Bad. Mini_fo?
  1. Issue: the default /var symlink must be removed by hand if one wants to make /var a mount point. Recommendation: make the /var symlink configurable by OpenWRT's "make menuconfig."
  1. Issue: users may not want to use the default tmpfs /tmp. Recommendation: allow users to deactivate the tmpfs /tmp. Determine an init script ordering that allows /tmp to be mounted from a disk before it is required.

Attachments (0)

Change History (4)

comment:1 Changed 8 years ago by W. Michael Petullo <mike@…>

See also:

for questions regarding the timing of USB mounting within the boot sequence.

comment:2 Changed 8 years ago by W. Michael Petullo <mike@…>

I worked around issue 1 (above) by moving all my big persistent data to /mnt/sda1 and using hotplug to mount my USB device. /var now only contains little files, like OpenWRT expects. This took patching OpenLDAP and krb5. These patches have been added to OpenWRT.

OpenWRT has fixed issue 2 by adding swapon support to its hotplug scripts. I now use hotplug instead of /etc/fstab.

Issue 3 is now irrelevant (see prior 2 solutions).

Issue 4 stands, but is not an issue to me right now.

comment:3 Changed 6 years ago by nbd

  • Resolution set to obsolete
  • Status changed from new to closed

comment:4 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.