Sun SAM-FS / QFS Overview
This article provides a simple overview of the Sun SAM-FS / QFS product suite
If you’re installing JUST QFS (aka Sun StorEdge Performance Suite) —
If you’re installing SAM-FS or SAM-QFS (aka Sun StorEdge Utilization Suite) —
SAM-FS and SAM-QFS 3.x.x used a version 1 superblock. 4.x.x uses version 2. What’s the difference?
- QFS Shared file system
- md devices in Sun QFS
- Dual-sized DAUs on mm devices
samfsinfo to determine what version a filesystem was created with
- version 1 = 3.x
# samfsinfo <fs family name> samfsinfo: filesystem <fs family name> is mounted. name: <fs family name> version: 1 shared
- version 2 = 4.x
# samfsinfo <fs family name> samfsinfo: filesystem <fs family name> is mounted. name: <fs family name> version: 2 shared
How do I upgrade?
- pkgrm old packages,
- pkgadd new packages.
Config files should remain in their places, but remember that package names changed from when Sun Microsystems bought LSC, so paths for configuration files will change as well.
Upgrading does NOT change the file system version, just the software. If the customer wants the advantage of the version 2 superblock, they must back up, recreate the file system, and restore from backup.
Configuration - Licensing
License is located in
s4m-sam# cat /etc/opt/SUNWsamfs/LICENSE.4.0 08b7f2b480c8a7c1c09598faaa720b88 8048cd8e0001935ed02f3985feb74671
After the license is installed, you can verify it by running
sam-fsd (4.0). This command also checks syntax in your mcf file as well, so you can make sure everything’s entered correctly. Alternatively, you can use SAM-FS’s command-line utility samu. This is navigated similarly to vi, using ctrl-f forward, ctrl-b back, etc.
Once the license is installed correctly, you can view the
LICENSE.dat file to see what features are currently licensed.
# cat /etc/opt/SUNWsamfs/LICENSE.dat hostid = 80a1b2c3 expiration date = Sun Oct 3 02:54:38 2004 Remote sam server feature enabled Remote sam client feature enabled Data base feature enabled Segment feature enabled Robot type Sun StorEDGE L9/20/40/60 or HP C7200 series is present and licensed 60 lt slots present and licensed
Master Configuration File
- Must be located in
- Defines devices and family sets
- Identifies disk partitions used for SAM-FS file systems
- Identifies peripherals to be used and any library groupings
- Example in:
- Drive order in
mcffile MUST MATCH DRIVE ORDER IN LIBRARY
Each line in the
mcf has the following six fields as shown:
equipment equipment equipment family device additional identifier ordinal type set state parameters
s4m-sam# cat /etc/opt/SUNWsamfs/mcf # For additional information about the format of the mcf file, type "man mcf". # # This is the mcf file which was built up line-by-line in the # "Configure SAM-FS" step in the "SAM-FS Installation & Setup" chapter # in the SAM-FS System Administrator's Guide. You can read that step # for more information about this particular mcf. # equipment equipment equipment family device additional # identifier ordinal type set state parameters samfs1 1 ms samfs1 /dev/dsk/c1t0d0s0 11 md samfs1 on /dev/rdsk/c1t0d0s0 /dev/dsk/c1t1d0s5 12 md samfs1 on /dev/rdsk/c1t1d0s5 samfs2 2 ms samfs2 /dev/dsk/c1t1d0s0 15 md samfs2 on /dev/rdsk/c1t1d0s0 /dev/dsk/c1t0d0s1 16 md samfs2 on /dev/rdsk/c1t0d0s1 /dev/samst/c0t2d0 20 od - on /dev/samst/c1t2u0 30 rb hp30 on /var/opt/SUNWsamfs/catalog/hp30_cat /dev/samst/c1t5u0 31 od hp30 on /dev/samst/c1t6u0 32 od hp30 on /dev/rmt/0cbn 40 od - on /dev/samst/c1t3u1 50 rb ml50 on /var/opt/SUNWsamfs/catalog/ml50_cat /dev/rmt/2cbn 51 tp ml50 on
mcf fields - Equipment types
Equipment identifier &mdashl This field defines the device file name or file system name for the equipment that SAM-FS will use. For example, the equipment identifier would be
/dev/dsk/c0t0d0s7 for an entry identifying a magnetic disk partition used as part of the disk cache. The value in this field is dependent on the equipment type field.
Equipment ordinal — This field is a unique integer from 1 to 32767. The equipment ordinal affects the allocation of shared memory space. Therefore, the greater the interval between your equipment ordinals, the more space you will use in memory. Whenever possible, keep the numbers low and sequential. See the equipment type for any rules regarding equipment ordinals.
Equipment type &mdashl This field is a two-character mnemonic for the device type. However, the type field affects many of the other fields. There are following tables list the current valid equipment types. Equipment types are also listed in the mcf(4) man page.
|A Sun SAM-FS disk cache family set. There are no meta devices. Metadata resides on the data device(s). This defines the disk cache family set. The value in the equipment identifier field will be in the ‘device to mount’ field of the /etc/vfstab for mounting at boot time. The family set field, a required field for this type, groups the magnetic disks that make up the family set.
|A Sun QFS or SAM-QFS disk cache family set with one or more meta devices. Metadata resides on these meta devices. File data resides on the data device(s).
|The following equipment types are used to define the disk devices that reside within an ms or ma file system:
|A magnetic disk that is part of an ma disk cache family set. Metadata is allocated on this device. At least one mm device is required in an ma file system.
|This defines a magnetic disk that is part of a storage (disk cache) family set. The equipment identifier is a path to the block special device file name such as
/dev/dsk/c0t3d0s4. The family set field, a required field, must match a family set defined in a ms entry. The additional parameter field uses the path to the corresponding raw device file name, such as
|A magnetic disk that is part of an ma disk cache family set. This device allocates only large DAUs for file data.
|A magnetic disk that is part of an ma disk cache family set. The XXX identifies a striped group of devices. This device stores data. The allocation unit is the large DAU size multiplied by the number of members in the striped group. The XXX must be a decimal number in the range 0 < XXX < 127. These devices must be the same physical size. (NOTE: It is not possible to use the samgrowfs command to increase the size of a striped group. However, it is possible to add additional striped groups.)
The following table lists the equipment types for the SCSI robotic media loaders
|Generic SCSI library. Automatically configured by SAM-FS
|HP optical libraries
|DLT2700 tape libraries
|Sony DMS library
|DocuStore optical disk libraries
|Metrum and Mountain Gate libraries
|Ampex ACL libraries
|Ampex DST810 library
|IBM 3570 media changer
|STK 97xx series
|Plasmon D-Series DVD-RAM libraries
These are the SCSI robotic media loaders. The equipment identifier field is the samst device driver name such as
/dev/samst/c0t4u1. The family set field associates the devices with the robot. The additional parameter field defines the absolute path name of the library catalog file. The library catalog file stores information about each piece of media in the library such as
The following table lists the equipment types for the optical devices
The equipment identifier field is the path to the samst device driver name such as /dev/samst/c0t3u0. The family set field associates the device with a robot of the same family set name. A family set name of “–“ identifies manually mounted devices.The historian acts like a media changer, but since there are no devices associated with it there is no family set name. The historian keeps track of off-site media. If a historian is not configured in the mcf file, one will be created using the following defaults:historian n+1 hy - - /usr/tmp/sam_historianWhere
n is ordinal of the last piece of equipment defined in the mcf file.The following table lists the equipment types for the tape devices:The equipment identifier is the raw device name such as
/dev/rmt/0bn. Specify the device with the BSD no-rewind name (bn). If the device supports compression, then specify the device name with the compression for better tape usage, such as
/dev/rmt/0cbn. The family set field associates the device with a robot of the same family set name. If the family set name is “–“ the device is assumed to be a manually mounted device.
|12 inch WORM
|5 ¼ inch WORM
|5 ¼ erasable optical
|IBM Multi Function
|Generic optical disk. Automatically configured by SAM-FS using the SCSI vendor code
|The SAM-FS historian
|Generic tape. Automatically configured by SAM-FS using the SCSI vendor code
|Digital Linear tape drive
|Metrum VHS (RSP-2150)
|Exabyte (850x) tape
|8mm Exabyte Mammoth-2 tape
|4mm DAT tape
|Sony AIT, AIT-2, AIT-3
Family set— This optional field associates devices with other devices to create a family set. If the device is not a part of a family set, it will have a “–“ in field. The field is required for media libraries as it associates the library with the devices in the library.
Device state — This optional field gives the state of the device. Valid device states are “on”, “off”, “unavail” or “down”. A “-“ in this field indicates no entry. The device state field defaults to “on”.
Additional parameters — This optional field has many different purposes. If a media loader/changer is being defined, the additional parameters field gives the name of the catalog file for that family set. If the entry is defining a disk partition, the additional parameters field is the name of the raw disk device such as
mcf configuration - Identifying the correct samsg device
When the system boots, it places messages in the file
/var/adm/messages, including the Solaris hardware path to each peripheral. At each reboot, the system adds more information to this file. The system also logs information to this file when certain conditions occur.
Each peripheral will have three lines of information in the
/var/adm/messages file. These lines are identified by a
samst XXX: designator. The following is a sample samst output from
/var/adm/messages (the date and time have been removed from the beginning of each line in order to fit it in this manual):
lab20 unix: samst112: Vendor/Product ID = HP C1107A lab20 unix: samst112 at QLGC, isp0: target 0 lun 0 lab20 unix: samst112 is /iommu@f,e0000000/sbus@f,e0001000/QLGC,isp@3,10000/samst@0,0
The first line lists the vendor information (here, HP C1107A). The second line lists the controller number (in this example, isp0), the target number and logical unit number (target0 lun0).
The third line gives the hardware path name to the peripheral. Think of this as the path of devices that leads the CPU to that peripheral. That path has symbolic links to other device driver names. The same hardware path is stored in a directory called
/devices. The device path information is useful for locating the exact piece of equipment you are trying to configure and associating it with the
/dev/samst device name. The
/dev/samst device name identifies the device driver that SAM-FS will use to communicate with the device. It identifies the device by the controller number, target number and logical unit number. By getting the hardware path name from /var/adm/messages, you can do a long listing (ls -l) in the /dev/samst directory and identify which device corresponds with the equipment you wish to configure.
For tape drives, you must identify the raw device name found in the directory
/dev/rmt. Again, using
/var/adm/messages as your guide, you should be able to find the
/dev/rmt entry that corresponds to the device you are configuring.
A family set organizes and groups devices together by one family name. In the example used in this presentation, there are four family sets. The first two family sets organize and group the disk partitions together to form the file systems for SAM-FS to use as disk cache. The third family set will group the HP robot with the optical drives that it manages, and the fourth for the magnetic tape library
/opt/LSCsamfs/examples/defaults.conf file contains default settings for certain default values in SAM-FS. Read the defaults.conf(4) man page and examine this file to determine which defaults you should change. Copy the example defaults.conf to
/etc/opt/LSCsamfs/defaults.conf. Edit the file to set appropriate site defaults.
The syntax of the file appears as follows:
timeout = 120 labels = barcodes stages = 8096 idle_unload = 60 stale_time = 20 lt_blksize = 256 sg_blksize = 256 se_blksize = 256 d2_blksize = 1024 debug = labeling canceled moves devlog = 101 time stage_ck
defaults.conf - Fields
|The amount of time, in seconds, SAM-FS will wait for direct access to removable media. The default is 600 seconds. A value of zero disables this feature.
|If a tape library has a barcode reader, SAM-FS can set the tape label equal to the first or last characters of the barcode (uppercased). The default is labels = barcodes.
|The number of stage requests that can be outstanding at one time. Each entry takes about 104 bytes of shared memory. The default is 1024 stages.
|The amount of time, in seconds, that a drive in an automated library may be idle before the media in that drive is rewound and unloaded. The default is 600 seconds. A value of zero disables this feature.
|The amount of time, in minutes, that a request to mount media into a drive will be left in the mount request queue. If the media is not loaded into a drive in this amount of time, the requesting process will be sent an error and the request will be removed from the queue. The default is 30 minutes.
|The block size that SAM-FS uses to write to tape. The value for block size can be one of 16, 32, 64, 128, 256, 512, 1024, or 2048. This value can be overridden when manually labeling tapes. Check the defaults.conf man page for a list of the released default block sizes.
|Can be used to set the default debug flags used by SAM-FS daemons for logging messages. The default is logging.
|Can be used to manipulate the device log events for logging messages for tape and optical drives and automated libraries.
How do I create a SAM-FS file system?
The primary difference to be aware of here is that
sammkfs is run on the family set name configured in the mcf file, as there’s no real device path for this virtual device. Example:
s4m-sam# sammkfs samfs1 Creating a new file system prevents use with SAM-FS 3.5.0 or earlier Use the -P option on sammkfs to create a 3.5.0 compatible file system Do you wish to continue? [y/N] y Building 'samfs1' will destroy the contents of devices: /dev/dsk/c0t1d0s0 Do you wish to continue? [y/N] y total data kilobytes = 4196080 total data kilobytes free = 4195632
There are also a few special options to be aware of that are specific to SAM-FS. These include:
|Disk allocation unit size (number of 1kb blocks to be allocated for a file). This needs to be calculated based on the customer’s situation.
|Number of inodes. This is an option that customers SHOULD not be using. SAM-FS can have an extremely large number of files by default, so this will severely limit them, and it cannot be changed, even when the file system size is grown.
|Specifies that the previous version of sammkfs be used (version 1 superblock).
|Specifies that the file system is shared
|Writes config info to standard output, but does not write to the file system. You can use this option to report info on an existing file system (must be unmounted first)
s4m-sam# sammkfs -V samfs1 Creating a new file system prevents use with SAM-FS 3.5.0 or earlier Use the -P option on sammkfs to create a 3.5.0 compatible file system Do you wish to continue? [y/N] y Building 'samfs1' will destroy the contents of devices: /dev/dsk/c0t1d0s0 Do you wish to continue? [y/N] y name: samfs1 version: 2 time: Tue Jan 14 16:20:15 2003 count: 1 capacity: 004006f0 DAU: 16 space: 004006f0 ord eq capacity space device 0 21 004006f0 004006f0 /dev/dsk/c0t1d0s0
sammkfs - data alignment
Data alignment refers to matching the allocation unit of the RAID controller with the allocation_unit of the file system. A mismatched alignment causes a read-modify-write operation for I/O that is less than the block size. The optimal alignment formula is as follows:
<allocation_unit> = <RAID_stripe_width> * <number_of_data_disks>
For example, if a RAID-5 unit has a total of 8 disks with 1 of the 8 being the parity disk, the number of data disks is 7. If the RAID stripe width is 64 kilobytes, then the optimal allocation_unit is 64 * 7 = 448.
How do I back up SAM-FS file systems?
samfsdump dumps the file control structure data, but NOT the
.inodes file. This is backed up separately, using dd. Typically, a cron job is set up to do this automatically, and will be done more frequently than the samfsdumps, as it takes less time.
samfsdump can back up 100,000 files a minute, because it’s not backing up the full files, just control data. This means that restore time is also VERY fast. The only disadvantage is that no files will be resident in disk cache upon restore, so everything that needs to be accessed will have to be staged from archive. An alternative option is to use the –u option on samfsdump.
Note: Be aware, however, that samfsdump will also NOT back up any files that have not been archived yet, so the customer will need to have a good archive of everything, or have those individual files backed up somewhere else.
** DO NOT ** for any reason, back up SAM-FS file systems with Solstice Backup, EMC NetWorker, Veritas NetBackup, etc. These applications do not understand SAM-FS file system structure, so if you try to do it, you’ll end up staging every file in the file system, you’ll max out your disk cache, etc.