Error message

  • Notice: Trying to access array offset on value of type int in element_children() (line 6543 of /home1/dewey/drupal/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6543 of /home1/dewey/drupal/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6543 of /home1/dewey/drupal/includes/common.inc).
  • Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home1/dewey/drupal/includes/common.inc).
  • Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in menu_set_active_trail() (line 2404 of /home1/dewey/drupal/includes/menu.inc).

Automount Snapshot

Summary: I present a method for transparently auto-creating lvm snapshots on use.

1) The problem

I'm using rsync to transfer a backup area to another computer. The problem is that if the backup area changes during rsync then rsync complains bitterly and returns nasty error codes making me thing it has failed.

2) The normal solution

The "normal" solution (for those who run Linux Logical Volume Manager, that is) is to create a "snapshot"
volume
.

The problem with the "normal" solution is that someone has to manage the snapshots -- and I don't like coupling the thing which performs the backup with the rest of the system. That increases system complexity.

3) My "hack"

So, I realized that I could use the automounter (autofs) to do what I needed. If the map for an automounter mount point is executable it is called as a script and can return what to link. Eureka!

So my solution was to create an automounter executable map that creates the snapshot and returns it based on the request. In other words, you add the following to your automount master file:

/mnt/path /etc/autofs/auto.snapshot-storage

now when you execute

ls /mnt/path/something

Then the text "something" is passed to /etc/autofs/auto.snapshot-storage , and that script creates a snapshot partition /dev/storage/something-snap based on the partition /dev/storage/something and returns it to be mounted.

If one previously existed that previous one gets removed.

This mount will exist as long as some process keeps /mnt/path/something open. After nothing touches it for a while (how long is controled by the regular automounter timeout) then it will automatically be unmounted. When it's next mounted it will be generated again.

Tags:

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.