前几天买了磁带机放数据库备份,原来的格式难于管理,把磁带格式成文件系统来管理。

  LTFS(线性磁带文件系统)是为线性磁带开放(LTO)存储技术添加索引的文件系统规范。

  LTFS将LTO-5磁带分为两个部分,即两个分区。分区0存储目录结构和指针,分区1存储数据本身,这样可以使磁带驱动器快速定位所需数据。在磁带上应用文件系统使得用户能够像硬盘一样组织和查询磁带内容,改善磁带上的数据访问时间。LTFS技术能够使用户往磁带上拖放文件变得像在磁盘上一样简单。

  IBM在2010年推出了LTFS格式,能够支持磁带归档需求。随后惠普公司的LTO联盟、IBM和希捷公司正式采用了这个LTFS格式规范,该规范定义了磁带上的数据和元数据是如何存储在一个分层目录结构上的。用户在下载该软件之前要确保操作系统能够识别LTFS。

LTFS安装

1. RPM安装

[root@db-backup ~]# yum install rhel6-qtmltfs-2.1.1-1.x86_64.rpm

 

2. 创建LTFS文件系统

[root@db-backup ~]# mkltfs -d /dev/st0

LTFS15000I Starting mkltfs, QUANTUMLTFS Standalone version 2.1.1, log level 2

LTFS15041I Launched by "mkltfs -d /dev/st0"

LTFS15042I This binary is built for Linux (x86_64)

LTFS15043I GCC version is 4.4.7 20120313 (Red Hat 4.4.7-4)

LTFS17087I Kernel version: Linux version 2.6.32-279.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64

LTFS17089I Distribution: CentOS release 6.3 (Final)

LTFS17089I Distribution: CentOS release 6.3 (Final)

LTFS17089I Distribution: CentOS release 6.3 (Final)

LTFS15003I Formatting device '/dev/st0'

LTFS15004I LTFS volume blocksize: 524288

LTFS15005I Index partition placement policy: None



LTFS17085I Plugin: Loading "ltotape" driver

LTFS20013I Drive type is ULTRIUM-HH6, serial number is 1068024823, firmware revision is D8E5

LTFS17160I Maximum device block size is 1048576

LTFS15049I Checking the medium

LTFS15010I Creating data partition b on SCSI partition 1

LTFS15011I Creating index partition a on SCSI partition 0

LTFS17165I Resetting the medium's capacity proportion

LTFS11097I Partitioning the medium

LTFS11100I Writing label to partition b

LTFS11278I Writing index to partition b

LTFS11100I Writing label to partition a

LTFS11278I Writing index to partition a

LTFS15013I Volume UUID is: 5d12d3c7-6667-4fd3-aea0-c6312f1f0cef



LTFS15019I Volume capacity is 2408 GB

LTFS15024I Medium formatted successfully

3. 检查LTFS文件系统

[root@db-backup ~]# ltfsck  /dev/nst0

LTFS16000I Starting ltfsck, QUANTUMLTFS Standalone version 2.1.1, log level 2

LTFS16088I Launched by "ltfsck /dev/nst0"

LTFS16089I This binary is built for Linux (x86_64)

LTFS16090I GCC version is 4.4.7 20120313 (Red Hat 4.4.7-4)

LTFS17087I Kernel version: Linux version 2.6.32-279.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64

LTFS17089I Distribution: CentOS release 6.3 (Final)

LTFS17089I Distribution: CentOS release 6.3 (Final)

LTFS17089I Distribution: CentOS release 6.3 (Final)

LTFS17085I Plugin: Loading "ltotape" driver

LTFS20013I Drive type is ULTRIUM-HH6, serial number is 1068024823, firmware revision is D8E5

LTFS17160I Maximum device block size is 1048576

LTFS16014I Checking LTFS file system on '/dev/nst0'

LTFS16023I LTFS volume information:

LTFS16024I Volser (bar code) :      

LTFS16025I Volume UUID     : cd2aea33-abd8-475a-9500-62164c194dc3

LTFS16026I Format time     : 2014-05-16 15:05:49.637843234 CST

LTFS16027I Block size      : 524288

LTFS16028I Compression     : Enabled

LTFS16029I Index partition : ID = a, SCSI Partition = 0

LTFS16030I Data partition  : ID = b, SCSI Partition = 1



LTFS11005I Mounting the volume

LTFS11026I Performing a full medium consistency check

LTFS11233I Updating MAM coherency data

LTFS10023I LTFS volume information:

LTFS10031I Volume Name     : LTFS VOLUME

LTFS10024I Volser(Barcode) :      

LTFS10025I Volume UUID     : cd2aea33-abd8-475a-9500-62164c194dc3

LTFS10026I Format Time     : 2014-05-16 15:05:49.637843234 CST

LTFS10027I Block Size      : 524288

LTFS10028I Compression     : Enabled

LTFS10029I Index Partition : ID = a, SCSI Partition = 0, Total Capacity = 35060 MiB, Available Space = 35053 MiB

LTFS10030I Data Partition  : ID = b, SCSI Partition = 1, Total Capacity = 2296532 MiB, Available Space = 2296532 MiB



LTFS11034I Volume unmounted successfully

LTFS16022I Volume is consistent





4. MOUNT LTFS文件系统

[root@db-backup ~]#mkdir /tape_filesystem/

[root@db-backup ~]# ltfs /tape_filesystem/

LTFS14000I Starting ltfs, QUANTUMLTFS Standalone version 2.1.1, log level 2

LTFS14058I LTFS Format Specification version 2.1.0

LTFS14104I Launched by "ltfs /tape_filesystem/"

LTFS14105I This binary is built for Linux (x86_64)

LTFS14106I GCC version is 4.4.7 20120313 (Red Hat 4.4.7-4)

LTFS17087I Kernel version: Linux version 2.6.32-279.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64

LTFS17089I Distribution: CentOS release 6.3 (Final)

LTFS17089I Distribution: CentOS release 6.3 (Final)

LTFS17089I Distribution: CentOS release 6.3 (Final)

LTFS14063I Sync type is "time", Sync time is 300 sec

LTFS17085I Plugin: Loading "ltotape" driver

LTFS17085I Plugin: Loading "unified" iosched

LTFS20013I Drive type is ULTRIUM-HH6, serial number is 1068024823, firmware revision is D8E5

LTFS17160I Maximum device block size is 1048576

LTFS11005I Mounting the volume

LTFS10023I LTFS volume information:

LTFS10031I Volume Name     : LTFS VOLUME

LTFS10024I Volser(Barcode) :      

LTFS10025I Volume UUID     : cd2aea33-abd8-475a-9500-62164c194dc3

LTFS10026I Format Time     : 2014-05-16 15:05:49.637843234 CST

LTFS10027I Block Size      : 524288

LTFS10028I Compression     : Enabled

LTFS10029I Index Partition : ID = a, SCSI Partition = 0, Total Capacity = 35060 MiB, Available Space = 35053 MiB

LTFS10030I Data Partition  : ID = b, SCSI Partition = 1, Total Capacity = 2296532 MiB, Available Space = 2296532 MiB



LTFS14111I Initial setup completed successfully

LTFS14112I Invoke 'mount' command to check the result of final setup

LTFS14113I Specified mount point is listed if succeeded

[root@db-backup ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/vg_root-LogVol00

                      909G  647G  216G  75% /

tmpfs                  16G     0   16G   0% /dev/shm

/dev/sda1             194M   27M  158M  15% /boot

ltfs:/dev/nst0        2.2T     0  2.2T   0% /tape_filesystem

成功挂载,可以像文件系统一样来管理磁带机了。