[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Debian]:Ramdisk automount mit autofs executable maps



Hallo Leute!

Ich versuche seit einigen Tagen (leider ohne Erfolg :-) das Automagische
Erzeugen und mounten eines ram-disks einzurichten. Und zwar soll es mit einem
Skript erolgen, das den entsprechenden Eintrag ausgeben soll (soweit ich alles
richtig verstanden habe).
Hier ist die entsprechende Stelle in edr manpage autofs(5):
   Executable Maps
       A map can be marked as executable.  The init  script  that
       parses the auto.master map will pass this as a program map
       to the automounter.  A program map will  be  called  as  a
       script  with  the key as an argument.  The script needs to
       return one line of a map or no output at all  if  the  key
       cannot be matched.
       To  do this the automount(8) daemon has to be started with
       the program  type  insted  of  the  file  type.   This  is
       implemented in the initialization script.
       A  executable  map can return an errorcode to indicate the
       failure in addition to no output at all.  All output  sent
       to stderr is logged into the system logs.


Und hier sind meine Einträge in den autofs -Dateien:
In /etc/auto.master:
/amnt			/etc/autofs/amnt

In /etc/autofs/amnt:
misc		-fstype=autofs,rw				file:/etc/autofs/misc

In /etc/autofs/misc:
ram		-fstype=ext2,rw					program:/etc/autofs/mkautord.sh

Und hier ist was auf der Konsole rauskommt:
Feb 12 15:01:51 sikasso automount[680]: attempting to mount entry /amnt/misc/ram
Feb 12 15:01:51 sikasso automount[713]: lookup(file): looking up ram
Feb 12 15:01:51 sikasso automount[713]: lookup(file): ram -> -fstype=ext2,rw^I^I^I^I^Iprogram:/etc/autofs/mkautord.sh
Feb 12 15:01:51 sikasso automount[713]: expanded entry: -fstype=ext2,rw^I^I^I^I^Iprogram:/etc/autofs/mkautord.sh
Feb 12 15:01:51 sikasso automount[713]: parse(sun): gathered options: fstype=ext2,rw
Feb 12 15:01:51 sikasso automount[713]: parse(sun): core of entry: program:/etc/autofs/mkautord.sh
Feb 12 15:01:51 sikasso automount[713]: do_mount program:/etc/autofs/mkautord.sh /amnt/misc/ram type ext2 options rw using module ext2
Feb 12 15:01:51 sikasso automount[713]: mount(ext2): calling mkdir /amnt/misc/ram
Feb 12 15:01:51 sikasso automount[713]: mount(ext2): calling fsck.ext2 -p program:/etc/autofs/mkautord.sh
Feb 12 15:01:51 sikasso automount[713]: >> /sbin/fsck.ext2: No such file or directory while trying to open program:/etc/autofs/mkautord.sh^M
Feb 12 15:01:51 sikasso automount[713]: >> program:/etc/autofs/mkautord.sh: 
Feb 12 15:01:51 sikasso automount[713]: >> The superblock could not be read or does not describe a correct ext2
Feb 12 15:01:51 sikasso automount[713]: >> filesystem.  If the device is valid and it really contains an ext2
Feb 12 15:01:51 sikasso automount[713]: >> filesystem (and not swap or ufs or something else), then the superblock
Feb 12 15:01:51 sikasso automount[713]: >> is corrupt, and you might try running e2fsck with an alternate superblock:
Feb 12 15:01:51 sikasso automount[713]: >>     e2fsck -b 8193 <device>

Ich vermute, daß ich die manpage nicht richtig verstanden habe und daß ich
vielleeicht einige Begriffe durcheinander bringe oder falsch verstehe. Ich habe
es mit meinen Englisch-Möglichkeiten versuch und kann mir (noch) nicht erkären
warum das ing versucht "program:/etc/autofs/mkautord.sh" zu mounten und nicht
die Ausgabe des Skripts als Map-Eintrag verwendet.

Kann mir jemand helfen?

Ach übrigens, hier ist das besagte Skript:
#!/bin/sh
blocks_count=4096 # size
fstype=ext2
device=/dev/ram7
case ${fstype} in
	ext2)
		mkfs=/sbin/mke2fs
		command="${mkfs} -q -m 0 ${device} ${blocks_count}";;
esac
dd if=/dev/zero of=${device} bs=1k count=${blocks_count} 2>/dev/null
${command}
[ $? -ne 0 ] || echo "ram -fstype=${fstype},rw,user,exec,sync :${device}"

ch habe es getestet:  das mit ${command} erzeugte ramdisk läßt sich manuell
mounten, lesen und beschreiben.

-- 
   ,---._________________________________
  /                                      \   |~~\_____/~~\__  |
 | Christian.Sangohn@post.rwth-aachen.de  >---\______====== )-+
 |  ,---._______________________________/            ~~~|/~~  |
 |/                                                     ()

------------------------------------------------
Um sich aus der Liste auszutragen schicken Sie
bitte eine E-Mail an majordomo@jfl.de die im Body
"unsubscribe debian-user-de <deine emailadresse>"
enthaelt.
Bei Problemen bitte eine Mail an: Jan.Otto@jfl.de
------------------------------------------------
Anzahl der eingetragenen Mitglieder:     739


Reply to: