= About volumes = AFS uses a service to lookup IP addresses of file servers using the volume name or the volume number. The volume location database is in charge of looking up the file server IP addresses. The command 'vos listvldb' acts like the 'dig' or 'nslookup' command in DNS. Mount points are actually link files that point to the original location of a file. If the cache manager starts with read only data it sticks with read only data. If the cache manager starts with read write data it sticks with read write data. = How does the client find volumes? = Show how the client finds volumes by walking each path component using fs examine, fs lsmount, and vos listvldb. Example: To show the volumes and locations of those volumes to reach /afs/acme.com/user/lily Beginning with showing volume id of root.cell $ fs examine /afs/acme.com File /afs/acme.com (536870915.1.1) contained in volume 536870915 Volume status for vid = 536870915 named root.cell Current disk quota is 5000 Current blocks used are 4 The partition has 945244 blocks available out of 946892 Finding the location of root.cell: Use the $ vos listvldb -name command $ vos listvldb -name root.cell root.cell RWrite: 536870915 number of sites -> 1 server afs02.classroom.sinenomine.net partition /vicepa RW Site Next go down the path to /afs/acme.com/user to find the volume name/number using the fs examine /afs/acme.com/user command $fs examine /afs/acme.com/user File /afs/acme.com/user (536870921.1.1) contained in volume 536870921 Volume status for vid = 536870921 named user Current disk quota is 5000 Current blocks used are 4 The partition has 945244 blocks available out of 946892 To find the location of the volume for /afs/acme.com/user (name = user and 536870921 is the volume number) use vos listvldb -name command $ vos listvldb -name user user RWrite: 536870921 number of sites -> 1 server afs02.classroom.sinenomine.net partition /vicepa RW Site For the last path for this example use the fs examine /afs/acme.com/user/lily command to find the volume name/number $ fs examine /afs/acme.com/user/lily File /afs/acme.com/user/lily (536870927.1.1) contained in volume 536870927 Volume status for vid = 536870927 named user.lily Current disk quota is 5000 Current blocks used are 2 The partition has 945244 blocks available out of 946892 To find the location of user.lily volume use the following command: $ vos listvldb -name user.lily user.lily RWrite: 536870927 number of sites -> 1 server afs02.classroom.sinenomine.net partition /vicepa RW Site Summary: /afs ---> root.afs generated by -dynroot /acme.com ---> root.cell on afs02 /vicepa /user ---> user on afs02 /vicepa /lily ---> user.lily on afs02 /vicepa Use the following command to show the mount points under /afs/acme.com/user/ $ fs lsmount /afs/acme.com/user/* '/afs/acme.com/user/goose' is a mount point for volume '#user.goose' '/afs/acme.com/user/lily' is a mount point for volume '#user.lily' All files have a three part number called an FID, pronounced like 'kid', that the cache manager uses to find the location. == Reading Data == Assume that the client knows the number for a file called "myfile". The number is 536870930.2.2. The client knows that "myfile" is located on the volume numbered 536870930 which is the first part of the FID. The volume is located at network address 10.0.10.21. That network address is really afs01, but the file is actually under /vicepa. The client will send a "FetchData" request with the FID, 536870930.2.2, to the file server running on 10.0.10.21. The file server will take in that request, read it at /vicepa, and then return the data in the file. == Writing Data == Writing data is similar to the reading data process except the data flows the other way and the "FetchData" command becomes "StoreData". == Cache Manager knows FID == 1. The cache manager looks in the CellServDB to find the address(s) of the Volume Location Database server(s), VLDB. 2. The cache manager requests the IP addresses for the volume numbered 536870930. 3. The VLDB returns the location: 10.0.10.21 4. The cache manager requests the data from server 10.0.10.21 5. The file server process reads the file in /vicepa and sends the data to the cache manager. 6. The cache manager has the data and stores it in a local file. It then hands the data over to the operating system. == Cache Manager learns FID using the Directory Number == In this case the cache manager has the FID for the directory where the file is stored, 536870930.1.1. 1. Cache manager checks CellServDB for the address(es) of the VLDB. 2. Cache manager sends a request to the VLDB for the IP address for volume 536870930. 3. VLDB says its on 10.0.10.21 4. Cache manager requests the data from 10.0.10.21 5. The file server process on 10.0.10.21 reads the file in /vicepa and returns the data to the cache manager. The data says that it contains my file at .2.2. 6. Cache manager now has the data and saves it to a local file in the cache. = About volume quotas = Default volume quotas are tiny, 5MB. Use the fs command to change the quota (requires admin access rights). == Viewing quotas == Use fs listquota /afs// to view volume quotas. Example: fs listquota /afs/acme.com/user/lily Volume Name Quota Used %Used Partition user.lily 20000 6146 31% 1% == Setting quotas == Use fs setquota /afs// -m to set volume quotas. Example: fs setquota /afs// -m 20000 Go back and check that the setquota worked by using the fs listquota above. = How to make new volumes = Use vos create and fs mkmount to create new volumes. Use the vos create -m option to set the initial quota. First get a token. Below is an example that sets the quota to 0 which will disable the quota: vos create afs01 a project.mayhem -m 0 fs mkmount /afs/yoyodyne.com/mayhem project.mayhem Then set the access rights: fs sa /afs/yoyodyne.com/mayhem/ mayhem write = How to remove volumes = fs rmmount to remove mount points. vos remove to delete the volume data. (With caution!) 1. First remove the mount points: fs lsmount /afs/yoyodyne.com/mayhem fs rmmount /afs/yoyodyne.com/mayhem ls /afs/yoyodyne.com/ 2. Now delete the data: vos remove -id project.mayhem vos listvol afs01 = How to move volumes = Use vos move to move the volume to anther fileserver or partition. 1. Check the volumes on each partition on the fileserver. Then move a volume from partition a to partition b:: vos listvol afs01 vos move -id user -fromserver afs01 -frompartition a -toserver afs01 -topartition b vos listvol afs01 2. The backup was removed, so create a new one: vos backup project vos listvol afs01 = How to dump volumes = Use vos backup to make a snapshot, and then vos dump to dump an "archive" of the volume. '''Note''': the file name for this lab is 'project.mayhem' 1. Log in as admin and collect a token. Next create a backup volume: kinit admin && aklog && tokens vos backup -id project.mayhem vos listvldb -name project.mayhem 2. Then dump the whole volume: vos dump -id project.mayhem -file /tmp/project.mayhem.dump file /tmp/project.mayhem.dump 3. Now restore the the volume: vos restore -server afs01 -partition b -name project.mayhem.2 -file /tmp/project.mayhem.dump vos listvldb -name project.mayhem.2 fs mkmount /afs/yoyodyne.com/mayhem2 project.mayhem.2 4. Remove the old dump and create a new one: rm /tmp/project.mayhem.dump vos dump -id project.mayhem.backup -file /tmp/project.mayhem.dump file /tmp/project.mayhem.dump Sine Nomine Associates Nov 2017