Koozali.org: home of the SME Server

fstab mods gone?

Offline csnaus

  • **
  • 22
  • +0/-0
fstab mods gone?
« on: June 14, 2007, 11:52:29 AM »
I've added a mount point for a USB disk to fstab but after reboot it is gone. I guess it is another wonder of SME templates in action   :)
What is the proper way of editing fstab?

Offline mmccarn

  • *
  • 2,656
  • +10/-0
fstab mods gone?
« Reply #1 on: June 14, 2007, 04:27:02 PM »
My edits have stayed in place for a while now, even surviving several 'post-upgrade' events...

However, the file does say it is templated so you may be able to
Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/fstab
pico /etc/e-smith/templates-custom/etc/fstab/99zcustom
and put your custom entries in that file.

However, /etc/e-smith/templates/etc/fstab/99writefile looks as though it tries to copy the existing contents from /etc/fstab ('@lines' seems to be filled with the existing contents of /etc/fstab by 'template-begin') - in which case creating a custom template fragment as described above would result in numerous duplicate entries (one more entry at every rebuild of /etc/fstab, I think)...

Or, 'template-begin' has code to make sure the header is *not* repeated forever -- so you could copy that file to .../templates-custom/... and add your customizations to it (in the 'my @header {...' section)... then they, too, would be repeated at each rebuild, but without duplication...

There is some sort of mounting magic (fstab-sync?) in place for usb disks - when I edited my /etc/fstab I changed the line that had been automatically generated for my disk rather than creating a new line; maybe that's important...

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: fstab mods gone?
« Reply #2 on: June 14, 2007, 06:04:11 PM »
Quote from: "csnaus"
I've added a mount point for a USB disk to fstab but after reboot it is gone. I guess it is another wonder of SME templates in action   :)


No, it's probably fstab-sync from the haldaemon package.

The templates for /etc/fstab are unusual and don't fully specify the output file. As it says at the top of the file:

 # A few entries are updated during
 # the template processing of the file and white space is removed,
 # but otherwise changes to the file are preserved.

You shouldn't need to add mount points for USB disk. The hotplug/haldaemon system will do it automatically when you plug in the device.

Offline csnaus

  • **
  • 22
  • +0/-0
Re: fstab mods gone?
« Reply #3 on: June 14, 2007, 11:32:45 PM »
Quote from: "CharlieBrady"

No, it's probably fstab-sync from the haldaemon package.

...

You shouldn't need to add mount points for USB disk. The hotplug/haldaemon system will do it automatically when you plug in the device.


Firstly, thanks for the replies to you all.

So it looks like the situation is more complex than I first thought. My USB disk does not seem to be auto-recognised on plug-in. That's why I was mucking around with fstab. I will play with it a little bit more and if the problem persists should I report it as a bug?

Offline Confucius

  • *****
  • 235
  • +0/-0
fstab mods gone?
« Reply #4 on: June 14, 2007, 11:48:37 PM »
I would 1st take a look at this thread:  http://forums.contribs.org/index.php?topic=35466.0

Offline csnaus

  • **
  • 22
  • +0/-0
fstab mods gone?
« Reply #5 on: June 15, 2007, 05:52:51 AM »
Quote from: "Confucius"
I would 1st take a look at this thread:  http://forums.contribs.org/index.php?topic=35466.0

I am aware of usbdiskmanager contrib but I hope I can do without it. I simply want to allow dar2 backup to use my usbdisk. Without mount point in fstab dar2 complains that no mount point has been found. With mount point entered manually dar2 works perfectly. That's why I edited fstab. From what CharlieBrady says, it looks like it should be happening kind of "automagically", but in my case it doesn't hence my question.