This is the README file for vmount. * What does vmount do? ====================== vmount is a utility that allows you to mount foreign filesystems in your directory hierarchy. It uses the NFS-interface to the kernel to make the files available and the Linux code for the low level filesystem access. * What filesystems can currently be accessed? ============================================= The filesystem sources are taken from the Linux 2.0.25 kernel, which supports the following filesystems for disk devices: ext the old Linux native filesystem ext2 the new Linux native filesystem xiafs another old Linux native filesystem minix the minix filesystem (Linux floppies) umsdos unix permissions on top of a FAT filesystem msdos normal FAT filesystem vfat FAT filesystem with long filenames (Win95, NT compatible) iso9660 CDROM filesystem xenix System V filesystem for XENIX (PC-Unix) sysv SCO-Unix System V filesystem format coherent System V filesystem for Coherent (PC-Unix) hpfs the OS/2 filesystem (read only) affs the Amiga Fast FileSystem ufs should be standard berkeley "fast file system" format ntfs NT-filesystem, read only (not part of the kernel but a separate module written by Martin von Loewis) I have tested (unarchiving, compiling): ext2: read and write OK. minix: read and write OK. vfat: read and write OK. ntfs: read only, seems to work OK although the implementation of the "." and ".." directory entries is not completely correct (wrong inode numbers in ls). Some directoryies generate endless loops of warning or error messages. I had to modify the ntfs module sources a bit to make things work, mostly removing #includes of non-kernel headers and removing access restrictions. iso9660: read only :-), multi session uses an ioctl() that is not available on NEXTSTEP. However, it seems to work better than NeXT's implementation with multi session disks. Sizing etc. is much faster than on NeXT's iso9660 filesystem. hpfs: I have not tested this myself, but Peter Eybert has reported that it works for read only access. * What do I need to run vmount? =============================== To run vmount: 1.) An i386 based machine (i386 is the CPU-class, not the actual processor). 2.) NEXTSTEP 3.2 or higher (I have only tested on 4.0, however). To compile from the sources: 1.) NEXTSTEP 3.3 Developer or higher. I have also tested with gcc 2.7.2 and NEXTSTEP 3.2 Developer, this works too. gcc 2.2.2, which comes with 3.2 Developer, complains about prototype mismatches for built in functions. This can probably be solved easily, but I have not tried. You should edit the Makefile to reflect the compiler you intend to use. 2.) GNU-make. Openstep 4.0 and higher comes with GNU-make, it is available under the name "gnumake". And, of course, you need the vmount distribution: vmount.0.5.I.b.gnutar.gz for the binary only distribution vmount.0.5.I.s.gnutar.gz for the vmount sources vmount-Linux-2.0.25.s.gnutar.gz for the Linux filesystem sources This directory contains the "fs" and "include" hierarchy of the Linux kernel sources. "fs" contains only the filesystem specific subdirectories. Alternatively you may unpack the original Linux kernel sources in the vmount directory. vmount-ntfs-cs.s.gnutar.gz for the modified ntfs sources You can get these files from ftp://peanuts.leo.org/pub/comp/platforms/next/Unix/disk/vmount* ftp://next-ftp.peak.org/pub/next/apps/utils/disk/vmount* and from our local machine: ftp://hal.kph.tuwien.ac.at/pub/NeXT/tools/vmount/ * How reliable is it? ===================== This depends on several factors. First, there is the NFS server code. This should be relatively stable now, although there might still be some problems with permissions (eg. the deletion phase in 'cvs release -d' fails for no apparent reason). Second, there are functions of the Linux kernel that have to be emulated. Since I don't know exactly what they should do, there might still be problems. The main functionality seems to work, however. And third, there are the filesystem modules themselves. I really don't know how stable they are, but the Linux community works with them, so they must be quite useable. I have done a lot of read/write access to ext2, vfat and minix now and have not lost any data on the disks. Nevertheless, I would not use vmount to mount a main data partition with write enabled. If you are afraid of data-loss, there are several strategies you may adapt. 1.) You may use vmount for read access only. As long as you don't pass the "-w" parameter, the device is opened read-only and no write access is attempted. There should be no danger whatsoever for your data. 2.) You may test vmount on a disk image file, on a floppy or on a removable medium. You would not place any valuable data on such a medium, of course. I still have very little experience with vmount's reliability. If you use vmount on a certain filesystem with success for some time, please tell me. * Does Workspace recognize DOS-floppies as VFAT when I have vmount? =================================================================== There is good news and bad news. First the good news: There will soon be a NEXTSTEP frontend available for vmount that integrates it into Workspace's automounter. You just insert a floppy or other removable medium and it is automatically mounted with the correct filesystem. This frontend is called "MountMe" and will be available from the archives. Now the bad news: MountMe will be a commercial product. The good news within the bad news is, however, that I plan to sell it for a very low price. * Why is there no fat vmount? ============================= vmount is based on the Linux source, which was originally written for the i386. The assembler optimized inline functions in the "linux/asm" directory are available for several other architectures, but I have no way to test such a port. On the other hand, most of the filesystems read data structures from the disk by mapping a C-structure to them directly. This results in all sorts of byte ordering problems for processors with different endianness. This problem will have to be solved for other Linux-ports, too. * How do I use vmount? ====================== vmount is a daemon that accesses the raw device and serves the kernel via the NFS interface. In order to use the mount() system call, vmount must be run as root. The general usage parameters are: [1] vmount -i or [2] vmount -i -f or [3] vmount -m -t [-p | -f] [-s] [-o] [-d] [-w] [-u ] [-g ] [-U] [-G] [-S] The first two invocations help you figure out your disk contents. The fist one is for DOS-partitioned disks, the second one for not partitioned ones (the parameter is usually 0). The first form prints the partition table to stderr and both forms print filesystem information to stdout. Example: root@zaphod# vmount -i /dev/rsd3h output to stderr: mounting read only primary 1 0x83 start/sec=0x00000020 size/sec=0x000057e0 primary 2 0x83 start/sec=0x00005800 size/sec=0x00005800 logical 5 0x83 start/sec=0x0000b020 size/sec=0x000057e0 logical 6 0x83 start/sec=0x00010820 size/sec=0x000057e0 logical 7 0x83 start/sec=0x00016020 size/sec=0x000057e0 logical 8 0x83 start/sec=0x0001b820 size/sec=0x000057e0 logical 9 0x83 start/sec=0x00021020 size/sec=0x000057e0 logical 10 0x83 start/sec=0x00026820 size/sec=0x00008fe0 output to stdout: 1/ext2: -p1 -text2 2/ext2: -p2 -text2 5/ext2: -p5 -text2 6/ext2: -p6 -text2 7/ext2: -p7 -text2 8/ext2: -p8 -text2 9/ext2: -p9 -text2 10/ext2: -p10 -text2 The first partition in this example is marked active and all partitions are of type Linux Native (0x83). All partitions are formatted with an ext2 filesystem. The filesystem information is of the format /: The mount options are the parameters that have to be passed to vmount (in addition to the raw device and optional flags) to mount the listed filesystem from the listed partition. Other example: root@zaphod# vmount -i -f0 /dev/rsd0h output to stderr: mounting read only output to stdout: 0/iso9660: -f0 -tiso9660 The third form actually mounts the filesystem. Parameter description: -v Prints the version number and exits. -m Specifies the mount point. This option is mandatory. -t The name type of the filesystem-type. Although an autodetection would be possible, you could not distinguish between the various types of FAT filesystems. You can use the -i option if you want to implement autodetection. This option is also mandatory. -p If you run vmount on a DOS-partitioned disk (which is the usual partitioning scheme on i386 based systems), you can specify the number of the partition you want to mount. The numbering scheme is now the same as in Linux: the primary partitions are numbered from 1 to 4 and all logical partitions are numbered beginning at 5. You should use the -i option to examine the partition layout of your disk. If you don't specify either -p or -f, a default of -f0 is used. -f If your disk is not partitioned in the DOS scheme or you have to access an extended partition, you can still use vmount if you can figure out the offset (in bytes) of your partition's boot sector. This option cannot be used together with -p, of course. The number can be given in decimal, octal (0 prefix) or hexadecimal (0x prefix) notation. If you want to protect the disk against accesses outside of this partition, you should use the -s option in conjunction with -f. The default value for the offset is 0. -s Size of the partition. This value is only used when an offset was specified with the -f option. It is used to check for out-of-partition accesses in the low level disk access routine. If no partition size is specified and the size can not be determined from the partition table, it is set to the maximum possible value of 4GB. -o The string passed with -o is passed on to the mount command. It's interpretation depends on the filesystem. On FAT filesystems you can set the default user and permission for accesses in this way. More documentation about this can be found in the Linux distributions. -d The number passed with this option is interpreted as bitmask for debugging prints. The following debug options are available: 0x01 debugging of the buffering code (buffers.c) 0x02 debugging of basic data access routines (missing.c) 0x04 debugging of dummy functions and regular mechanism (dummies.c) 0x08 debugging of basic file operations for NFS (file_ops.c) 0x10 debugging of NFS calls (nfs_funcs.c) 0x20 even more debugging of NFS calls (nfs_funcs.c) 0x40 debugging of uid and gid translation (id_translate.c) 0x80 debugging of the mainloop (mount.c), may be useful if vmount hangs. The number can be given in decimal, octal (0 prefix) or hexadecimal (0x prefix) notation. When debugging is active (even if the mask is 0), vmount does not put itself to background. This makes it possible to run vmount in the debugger. -u -g Normally, the uids and gids for the same user will not be the same on different OSes on a multi-boot system. These options allows you to translate uids and gids for disk accesses. Every line in the file must consist of two integer numbers, the first one giving the local id and the second one giving the id that is used on the disk for the same user or group. Example for a uid-mapping: #local disk 100 500 101 501 102 502 This mapping would be appropriate for a Linux-disk where the user-ids are allocated from 500 instead of 100 on the NeXT. -U or -U -G or -G With these options the file ownership of the filesystem is ignored and the given values are substituted instead. This is the usual way filesystems are automounted by NeXT's Workspace. -S Use small cache blocksize. This option sets the cache blocksize to 4kB instead of 64kB. This speeds up all operations on floppy disks. may be any device that supports read(), write() and lseek(), that is either a block device or a file. Examples: For running vmount on the third primary partition of your (scsi-)harddisk which is an ext2-linux partition, type: vmount -m /ext2-fs -p3 -t ext2 -w /dev/rsd0h For running it on a VFAT ZIP drive, which is the third SCSI device, type: vmount -m /vfat-fs -p4 -w -t vfat -o "uid=100,gid=21" /dev/rsd2h Type this before you insert the medium to avoid the NEXTSTEP automount. You are then asked to insert the disk, which you should do. To eject it (after stopping vmount), you can use disk -e /dev/rsd2h If you have a disk image file in 'disk-image', you can type: vmount -m /minix-fs -w -t minix disk-image If you want to mount a vfat floppy, you have to insert it first, then type: vmount -m /floppy -w -t vfat -S /dev/rfd0b (don't ask me why /dev/rfd0b, but it's the only one that works). Before you remove the floppy, you should type: disk -e /dev/rfd0b Using vmount for an iso9660 CD-ROM can be done this way: vmount -m /CDROM -f0 -t iso9660 /dev/rsd2h Again, the command must be issued without a CD inserted. * How do I unmount things mounted with vmount? ============================================== For unmounting, the program "vumount" is supplied. Its usage is: [1] vumount or [2] vumount The first form lists all directories mounted with vmount, the second one unmounts the given directory. If vumount does not work or if you don't want to use it, you can simply send the vmount daemon the hangup signal (kill -HUP ). * How do I build vmount from the sources? ========================================= 1.) Unpack the archive. You should be left with a directory named 'vmount'. This are the sources I have written. 2.) You have to get the Linux filesystem sources from somewhere. For simplicity, I provide the sources from Linux 2.0.25 in a separate archive. Unpacking this archive should generate the directories 'vmount/Linux/include' and 'vmount/Linux/fs'. 2a.) If you need the NTFS-support, you have to unpack the ntfs archive as well. 3.) Edit the file config.make for your needs. It determines the filesystem modules that are compiled in. Edit the Makefile to reflect your compiler and don't forget to set the proper options in CFLAGS. 4.) Run the script mklinks.sh from the directory 'vmount'. It sets up some links and patches the Makefile for your absolute directory path. You can run mklinks.sh at any time without doing any harm to the sources. 5.) Type 'gnumake' (GNU-make) in the 'vmount' directory. This takes several minutes. 6.) Optionally strip the programs 'vmount' and 'vumount'. * What comes next, can I help in the development? ================================================= There are some more filesystems in the Linux 2.0.25 kernel: NFS (well, we have that already...) smbfs SMB client for Windows-networks ncpfs Novell Core Protocol Smbfs would be interesting, of course, but it can't be used due to its inode numbering scheme, which is incompatible to NFS. I have written a different utility that implements an SMB client via NFS: it's called "rumba". It is available at the same sites as vmount, although in different directories. * What about the copyright? =========================== vmount comes with the GNU GPL (GNU General Public License), as it has to, because it uses code from Linux, which is GPL'd. And of course, there is ABSOLUTELY NO WARRANTY etc.... * Who's the Author? =================== That's me: Christian Starkjohann