This section describes how a session with two bs2fs file systems typically runs.
First the system administrator configures the bs2fs container and mounts it. Then the system administrator mounts two bs2fs file systems for a user ID. Subsequently the user can work with the files of the bs2fs file systems. Finally the system administrator unmounts the bs2fs file systems again.
Configuring and mounting the bs2fs container using the POSIX installation program
The append function of the POSIX installation program (Administrate POSIX filesystems) is used to create a new ufs file system with the bs2fscontainer option and to mount it immediately using Automount=Y
. Creating a new ufs file system or overwriting an existing ufs file system with the bs2fscontainer option causes this file system to be assigned the property bs2fs container, which is required to permit the ufs file system to be used as a bs2fs container.
Definition of BS2000 Container File BS2000 filename: :V70A:$SYSROOT.FS.BS2FSCONTAINER BS2000 filesize: 1000000 PAM-Pages POSIX filesystem? (y/n): Y A new BS2000 container file has been created ============================================================================= Definition of POSIX filesystem Size of filesystem: 100000 PAM-Pages Journaling? (y/n): N POSIX mountpoint: /bs2fscont Automount? (y/n): Y Mountoptions: bs2fscontainer Overwrite existing filesystem? (y/n): POSIX filesystem marker (y/n): Y No filesystem in BS2000 container yet ============================================================================= Save definitions: ENTER Help : F1 terminate: F2
After the container has been mounted successfsully and the installation program has been terminated, two bs2fsd copy daemons are started automatically.
# ps -efT|grep bs2fsd ROOT 163 74MR 1 0 15:29:55 ? 0:00 [bs2fsd] ROOT 162 74MQ 1 0 15:29:55 ? 0:00 [bs2fsd]
At this time the bs2fs container still has no content:
# ls -l /bs2fscont Total 0 #
Alternative: mounting the bs2fs container using the mount command
Once a bs2fs container file system has been created with the POSIX installation program (property bs2fs container, see above), it can also be mounted using the mount command by specifying the –o bs2fscontainer option, e.g.
# mount –F ufs –o bs2fscontainer /bs2fscont
Two copy daemons are also started automatically in this case.
Supplementary information on mounting the bs2fs container:
The ufs file system which functions as a bs2fs container is expected to be an empty file system. If it is not empty, its contents are deleted by the -o bs2fscontainer option when it is mounted.
The contents are deleted in all mount operations: mount command, automount in the case of POSIX startup, automount by the installation program.
The property bs2fs container was introduced as a safety measure to prevent a ufs file system from being emptied inadvertently when it is mounted as a bs2fs container.
Mounting bs2fs file systems
After the bs2fs container has been mounted and the copy daemons have been stated, bs2fs file systems can be mounted. As with nfs file systems, this is not done using the POSIX installation program, but with the mount command.
The following files under the user ID BACH
and with the catalog ID :V70A:
should be made available in bs2fs file systems:
All files whose names match the pattern
ASS.*.S
should be made available under/home/bach/bs2.1
All files whose names match the pattern
PLAMLIB*
should be made available under/home/bach/bs2.2
Two bs2fs file systems are therefore required, and these can be set using the following commands:
# mount –F bs2fs –o ftyp=text ':v70a:$bach.ass.*.s' /home/bach/bs2.1 # mount –F bs2fs –o ftyp=text ':v70a:$bach.plamlib*' /home/bach/bs2.2
The mount command automatically extends the /etc/mnttab file by the following entries:
|
|
|
|
|
The bs2fs container now contains directories (which are still empty) which are to accommodate copies of the two bs2fs file systems' BS2000 files. Pure information functions such as the ls command do not initiate copying. Only when an open() is applied to a bs2fs file does the bs2fsd daemon become active. Details on the structure of the bs2fs container are provided in "Overview of the mount and unmount operations".
# ls -l /bs2fscont Total 16 drwx--x--x 2 SYSROOT SYSROOT 2048 Nov 27 11:40 V70A.BACH.1 drwx--x--x 2 SYSROOT SYSROOT 2048 Nov 27 11:41 V70A.BACH.2 #
The protection bit attributes of the bs2fs container are automatically set by the mount operation in such a manner that the container's contents are not visible to nonprivileged users (drwx--x--x
).
Working with bs2fs file systems
After the two bs2fs file systems have been mounted, the result of the mount operations can be checked.
Display the content of the file system mounted under /home/bach/bs2.1
:
# ls -l /home/bach/bs2.1 Total 3620 -rwx------ 1 BACH OS315 12288 Nov 22 14:54 ass.consio.s -rwx------ 1 BACH OS315 18432 Nov 22 14:54 ass.lock.s -rwx------ 1 BACH OS315 6144 Nov 22 14:54 ass.lockadm.s -rwx------ 1 BACH OS315 18432 Nov 22 14:55 ass.lockwrk.s -rwx------ 1 BACH OS315 2048 Nov 22 14:55 ass.posasto.s -rwx------ 1 BACH OS315 18432 Nov 22 14:55 ass.posbs2fs.s -rwx------ 1 BACH OS315 139264 Nov 22 14:56 ass.posbs2fx.s ... -rwx------ 1 BACH OS315 69632 Nov 22 14:58 ass.posutil.s -rwx------ 1 BACH OS315 51200 Nov 22 14:59 ass.posvert.s -rwx------ 1 BACH OS315 49152 Nov 22 14:59 ass.posvmm.s -rwx------ 1 BACH OS315 2048 Nov 22 14:59 ass.pprot.s -rwx------ 1 BACH OS315 18432 Nov 22 15:00 ass.slpwkp.s -rwx------ 1 BACH OS315 32768 Nov 22 15:00 ass.ttrap.s -rwx------ 1 BACH OS315 2048 Nov 22 15:00 ass.uaddr.s #
So a number of simple BS2000 files is mounted under /home/bach/bs2.1
.
Supplementary information on the representation of the bs2fs files:
Protection bits
map either the BS2000 standard attributes (USER-ACCESS, ACCESS) or the BACL properties. In our case, for example, the standard attributes USER-ACCESS=*USER-ONLY and ACCESS=*WRITE.
Owner (USER)
is always the ID of the bs2fs mount.
Group (GROUP)
is always the POSIX group of the owner ID. However, this group assignment is not relevant for bs2fs accesses. The BS2000 group assignments with / without SECOS apply. See chapter 3 for details.
File size
of unopened files is a multiple of 2048 occupied PAM pages. The smallest file according to the ls command is therefore 2048 bytes in size.
File name:
Names are displayed in lowercase notation. This also applies for library and element names. The reference to bs2fs objects with shell commands or C program interfaces, on the other hand, can be in either uppercase or lowercase.
Exception: lowercase notation is required in wildcard constructs in the shell and with the find command.
Now display the content of the second file system mounted under /home/bach/bs2.2
:
# ls -l /home/bach/bs2.2 Total 5224 drwx------ 2 BACH OS315 1562624 Nov 19 17:39 plamlib.1 drwxrwxrwx 2 BACH OS315 1112064 Nov 19 17:30 plamlib.2
This file system consists of two PLAM libraries, which can be recognized from the representation as a directory.
Display the content of the library plamlib.1:
# ls -l /home/bach/bs2.2/plamlib.1 Total 32 drwx------ 2 BACH OS315 48 Nov 19 17:39 d drwx------ 2 BACH OS315 48 Nov 19 17:39 j drwx------ 2 BACH OS315 48 Nov 19 17:39 l drwx------ 2 BACH OS315 48 Nov 19 17:39 m drwx------ 2 BACH OS315 48 Nov 19 17:39 p drwx------ 2 BACH OS315 4032 Nov 19 17:39 s drwx------ 2 BACH OS315 48 Nov 19 17:39 x
The library directory contains subdirectories whose names correspond to the element types (D, J, L, M, P, S, X).
Supplementary information on the library and type directories:
The directory structure and the directory attributes cannot be modified. Actions such as deleting, renaming, creating and modifying attributes are always rejected when they apply to library and type directories.
Consequently, for example, no new PLAM library can be created using mkdir.
Now display the type S elements:
# ls -l /home/bach/bs2.2/plamlib.1/s Total 6024 -rwx------ 2 BACH OS315 8192 Nov 19 17:33 acct.c -rwx------ 2 BACH OS315 8192 Nov 19 17:33 acct.c+001 -rwx------ 2 BACH OS315 51200 Nov 19 17:33 bio.c -rwx------ 2 BACH OS315 51200 Nov 19 17:33 bio.c+001 -rwx------ 2 BACH OS315 8192 Nov 19 17:33 bitmap.c -rwx------ 2 BACH OS315 8192 Nov 19 17:33 bitmap.c+001 -rwx------ 2 BACH OS315 4096 Nov 19 17:33 bitmasks.c -rwx------ 2 BACH OS315 4096 Nov 19 17:33 bitmasks.c+001 -rwx------ 2 BACH OS315 12288 Nov 19 17:34 bs.c -rwx------ 2 BACH OS315 12288 Nov 19 17:34 bs.c+001 ... -rwx------ 2 BACH OS315 14336 Nov 19 17:39 vm_pageout.c -rwx------ 2 BACH OS315 14336 Nov 19 17:39 vm_pageout.c+001 -rwx------ 2 BACH OS315 18432 Nov 19 17:39 vm_pgout.c -rwx------ 2 BACH OS315 18432 Nov 19 17:39 vm_pgout.c+001 -rwx------ 2 BACH OS315 6144 Nov 19 17:39 vm_subr.c -rwx------ 2 BACH OS315 6144 Nov 19 17:39 vm_subr.c+001 -rwx------ 2 BACH OS315 4096 Nov 19 17:39 xmmu.c -rwx------ 2 BACH OS315 4096 Nov 19 17:39 xmmu.c+001 -rwx------ 2 BACH OS315 8192 Nov 19 17:39 xsys.c -rwx------ 2 BACH OS315 8192 Nov 19 17:39 xsys.c+001 #
The library directory contains some type S elements. Each of these elements occurs in the example with just one version, '001'. As a result, two entries exist for each element: one entry for the element name without a version identifier and one with the (only) version identifier.
Explanation:
In the bs2fs file system the element with the highest version can also be addressed as an element name without a version (implemented internally as a hard link). The representation and the reference to elements with lower versions, on the other hand, always include the version. See also chapter 3.
Now you can, for example, apply POSIX commands to the files of the bs2fs file systems:
# grep ETPND /home/bach/bs2.1/*.s /home/bach/bs2.1/ass.consio.s: ETPND &MODNAME,VER=&MODVERS,PATCH=200 /home/bach/bs2.1/ass.lock.s: TITLE '&MODNAME - ETPND/XREF' /home/bach/bs2.1/ass.lock.s: ETPND &MODNAME,VER=&MODVERS,PATCH=200 # tail /home/bach/bs2.1/ass.posvert.s HDRCHECK UNIT=228,FUNCT=(187,1) @BEND @BEND @EXIT @END EJECT ******************************* ETPND ********************************** ETPND &MODNAME,VER=&MODVERS,PATCH=200 * END #
Unmounting the bs2fs file systems
If the files in the bs2fs file systems are no longer required in POSIX, the file systems concerned can be unmounted again.
Use the umount command to unmount individual bs2fs file systems, thus in this example:
umount /home/bach/bs2.1
and
umount /home/bach/bs2.2
You can use the umountall command to unmount all bs2fs file systems:
either umountall –F bs2fs
or umountall –b
After you have unmounted the file systems using umount or umountall, the corresponding entries in the /etc/mnttab will also have been deleted.
Automating the bs2fs mount operations
The following options, among others, are available to automate bs2fs mount operations:
Enter the mount commands in shell scripts and execute these scripts at any time.
Create entries in the file system table /etc/vfstab using
Automount=Y
.
The bs2fs mount operations are then executed automatically when the POSIX subsystem is started. Furthermore, the /etc/vfstab table is read out by the mountall command if no other file system table is specified.You can use the mountall command to mount all the bs2fs file systems on the basis of the entries in the /etc/vfstab table:
or
either
mountall –F bs2fsmountall –b
- Create entries in a separate file system table (similarly to /etc/vfstab). This table can then be used as an argument of the mountall command.
Example: create an entry in a mountall table (/etc/vfstab would be similar)
You can use the mount -p command to create a file which already contains a suitable line in vfstab format:
| |
You must change the automount entry from
| |
You can use the mountall command to mount all bs2fs file systems on the basis of the entries in the /etc/bs2fstab table:
|