[Daniel O'Connor, 2004-06-30] | On Wed, 30 Jun 2004 01:11, Paul Mather wrote: | > having an empty or missing /compat/linux/etc/mtab file. Creating a | > proper mtab file solves these problems. One way to do this is via | > something like the following: | > | > sed 's/ufs/ext2/' < /etc/fstab > /compat/linux/etc/mtab | > | > That way, the Linux TSM "sees" your UFS partitions and will | > backup/restore to them. | | I wonder if it could work with an LD_PRELOAD or some other linker trickery.. LD_PRELOADing ought to work. The attached file is an example library. Compile with "gcc -o libmtab.so -shared -fpic libmtab.c" to test (you'll probably have to add "-ldl" to compile it on Linux, if you want to test TSM). This is just a proof-of-concept; you'd probably want to substitue the system() call with something sane, make sure you only s/ufs/ext2/ in the third column, etc. Example: # cat /etc/mtab cat: /etc/mtab: No such file or directory # export LD_PRELOAD=$PWD/libmtab.so # cat /etc/mtab /dev/ad0s1a / ext2 rw 1 1 /dev/ad0s1b none swap sw 0 0 /dev/ad0s1b /tmp mfs rw,-s=1046528 0 0 /dev/ad0s1e /var ext2 rw 1 2 /dev/ad0s1f /usr ext2 rw 1 2 /dev/acd0c /cdrom cd9660 ro,nosuid,nodev,noauto 0 0 /dev/ad0s2a /work ext2 rw 1 1 To be complete, the library should also work with relative pathnames. Implementing that is left as an exercise for the reader. The example library doesn't do that: # cd /etc; cat mtab cat: mtab: No such file or directory -- Per Kristian Hove <Per.Hove_at_math.ntnu.no> Chief engineer Dept. of Mathematical Sciences Norwegian University of Science and Technology
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:59 UTC