Okay, we will use the simplest case of archiving. Itīs disk archiving. In this configuration SamFS doesnīt use a tape drive for storing data, it simply uses filesystems, or to be more precise, it useses a directory in a filesystem to store itīs data.
Prerequisites
Okay, iīve created two iSCSI-base diskpool at the start to use them as disk archives. Now i will put some further seperation in them by creating directories in it.
# mkdir /samfs_archive_1/dir1
# mkdir /samfs_archive_1/dir2
# mkdir /samfs_archive_2/dir2
# mkdir /samfs_archive_2/dir1
Configuring the archiver
So, we have to start to configure the archive medias. Every archive media has itīs
VSN. VSN is a shorthand for Volume Serial Name. The VSN identifies a media of your archive. In this case we assign the VSN
disk01 with the directory
/samfs_archive_1/dir1/
disk01 /samfs_archive_1/dir1/
disk02 /samfs_archive_1/dir2/
disk03 /samfs_archive_2/dir1/
disk04 /samfs_archive_2/dir2/
Now we have usable devices for archiving. But have to configure the archiving as the next step. In this step we define the policies for archiving, control the behaviour of he archiver and associate VSNs with archive sets. All this configuration takes place in the file
/etc/opt/SUNWsamfs/archiver.cmd.
Okay, lets create such a config file for our environment.
logfile = /var/opt/SUNWsamfs/archiver/log
interval = 2m
Okay, this is easy: The archiver should log itīs work into the file
/var/opt/SUNWsamfs/archiver/log. This file is really interesting. I will show you a nifty trick with it later in this tutorial.
The
interval directive was responsible for defining the interval between the starts of a process for finding new or updated files (
sam-arfind). This behaviour didnīt scaled very well with millions of files in a directory.
Today the default is different. The file system itself knows what files have been updated and SamFS stores this information in a list. Today this setting has a similar effect, but with other methods: Itīs the default setting for the archive aging. It defines the amount of time between the first file added to the todo list for the archiver and the start of the archive. Thus the archiving would start two minutes after adding the first file to the list.
Now we define the archiving policy for the filesystem:
fs = samfs1
arset0 .
1 30s
2 1200s
What does this mean?
arset0 is a name of a so called archive set. The contents of this set are defined later-on. The
. stands for "every file in the filesystem". Okay, now we tell SamFS to make a first copy to the archiveset
arset0.1 after 30 seconds. The second copy is made to the archiveset
arset0.1 after 1200 seconds (20 minutes). We have just used the name of some archive sets, now we have to declare them:
vsns
arset0.1 dk disk01
arset0.2 dk disk03
samfs1.1 dk disk02
endvsns
Okay, The translation is quite simple: The archiveset
arset0.1 consists is a disk based set and consists out of the VSN
disk01. The same for the archive set
arset0.2. But wait, we didnīt used an archiveset
samfs1.1 so far. Well, you havenīt defined it explicitly. But itīs implicit when you have an archiver configuration for an filesystem. Itīs the default archive set. You can use it for regular archiving, but as we havenīt defined a policy to do so, this archive set is used for storing the meta data of your filesystem. So the assoscation of a VSN to this archive set is mandatory.
So we end up with the follwing
archiver.cmd
logfile = /var/opt/SUNWsamfs/archiver/log
interval = 2m
fs = samfs1
arset0 .
1 30s
2 1200s
vsns
arset0.1 dk disk01
arset0.2 dk disk03
samfs1.1 dk disk02
endvsns
Okay, weīve finalized our configuration: Now we have to check the configuration:
bash-3.00# archiver -lv
Reading '/etc/opt/SUNWsamfs/archiver.cmd'.
1: logfile = /var/opt/SUNWsamfs/archiver/log
2: interval = 2m
3:
4: fs = samfs1
5: arset0 .
6: 1 30s
7: 2 1200s
8:
9: vsns
10: arset0.1 dk disk01
11: arset0.2 dk disk03
12: samfs1.1 dk disk02
13: endvsns
No media available for default assignment
Notify file: /etc/opt/SUNWsamfs/scripts/archiver.sh
Read timeout: 60
Request timeout: 15m
Stage timeout: 15m
Archive media:
media:dk bufsize: 4 archmax: 512.0M Write timeout: 15m
Archive libraries:
Device: disk archive_drives: 3
Dictionary:
dk.disk01 capacity: 2.0G space: 1.9G
dk.disk02 capacity: 2.0G space: 1.9G
dk.disk03 capacity: 2.0G space: 1.9G
dk.disk04 capacity: 0 space: 0
Archive file selections:
Filesystem samfs1 Examine: noscan Interval: 2m
archivemeta: on scanlistsquash: off setarchdone: off
Logfile: /var/opt/SUNWsamfs/archiver/log
samfs1 Metadata
copy: 1 arch_age: 4m
arset0 path: .
copy: 1 arch_age: 30
copy: 2 arch_age: 20m
Archive sets:
[...]
arset0.1
media: dk
Volumes:
disk01 (/samfs_archive_1/dir1/)
Total space available: 1.9G
arset0.2
media: dk
Volumes:
disk03 (/samfs_archive_2/dir1/)
Total space available: 1.9G
samfs1.1
media: dk
Volumes:
disk02 (/samfs_archive_1/dir2/)
Total space available: 1.9G
bash-3.00#
Now we tell SamFS to reread itīs config-files
bash-3.00# samd config
Configuring SAM-FS
bash-3.00#
And now we have a running archiver. So ... letīs have some fun with it. Copy some files in it. I tend do test it by makeing a recursive copy of the
/var/sadm/pkg directory.
Now letīs look onto our archival disks:
bash-3.00# ls -l /samfs_archive_1/dir1
total 40734
-rw------- 1 root root 56 Mar 23 19:39 diskvols.seqnum
-rw------- 1 root root 19608576 Mar 23 17:43 f0
-rw------- 1 root root 1049088 Mar 23 19:39 f1
bash-3.00# ls -l /samfs_archive_1/dir2
total 13593
-rw------- 1 root root 56 Mar 23 19:42 diskvols.seqnum
-rw------- 1 root root 6891520 Mar 23 17:42 f0
-rw------- 1 root root 4608 Mar 23 19:42 f1
bash-3.00# ls -l /samfs_archive_2/dir1
total 40736
-rw------- 1 root root 56 Mar 23 19:58 diskvols.seqnum
-rw------- 1 root root 19608576 Mar 23 17:43 f0
-rw------- 1 root root 1049088 Mar 23 19:58 f1
You see, your archival media starts to populate. But where are your files, and whatīs up with this
f1. Well, they are written in a very specific, very secret and very closed format: These files are simple tar files. SamFS uses the standard tar format to write the archive file.You can look in it with the standard tar or the tar of SamFS:
bash-3.00# star tfv f1
-rw------T root/root 1048576 2008-03-23 19:28 testfile3
Please notice, that this isnīt a version of Joerg Schillings star despite of the name.
Part 1: Introduction.html Part 2: The theory of Hierarchical Storage Management Part 3: The Jargon of SamFS Part 4: Installation of the packages Part 5: Configuring a SamFS filesystem Part 6: Configuring disk archiving Part 7: Working with SamFS Pa
Tracked: Mar 25, 09:51