# Backup with TAR or LTFS on LTO tapes



## Mussolini (Jan 2, 2013)

Hi all,

Is there someone here using LTO tapes as a backup solution on FreeBSD systems ? If so, which format is recommended ? No problem on making tar tapes on FreeBSD like on Linux systems ?
What about LTFS, anybody have some information on implementing Linear Tape File System on FreeBSD ?


Thanks in advance..


----------



## tingo (Jan 3, 2013)

I don't use LTO, but tar works on tapes - it has always worked.


----------



## vermaden (Jan 3, 2013)

@*Mussolini*

I use tar(1) with LTO3 drive/tapes on FreeBSD, works as desired. You can try bigger tar(1) --block-size option such as 8192, for better transfer rate.

As described be, FreeBSD (as usual) is not one of the supported platforms:
http://en.wikipedia.org/wiki/Linear_Tape_File_System

Maybe the _FreeBSD Foundation _could do something about it.


----------



## Mussolini (Jan 4, 2013)

Hello Vermaden, thanks for your reply.
Good to know that tar works fine and I asked about the LTFS just to be sure. I really would like to get this working on FreeBSD systems. This is really the default future of LTO tapes.

Thank you!


----------



## vermaden (Jan 4, 2013)

Mussolini said:
			
		

> Good to know that tar works fine and I asked about the LTFS just to be sure. I really would like to get this working on FreeBSD systems. This is really the default future of LTO tapes.


The LTFS is only useful on LTO5 and LTO6 (and possibly later models) as LTO4 and earlier specifications does not support partitioning, which is required by LTFS.


----------



## beppo (Oct 28, 2018)

It's an older thread but it seems that ltfs is still unsuported by FreeBSD. At least I did not find any information regarding LTFS under FreeBSD. Is this correct?

Thanks a lot!


----------



## vermaden (Oct 28, 2018)

LTFS is unsupported on FreeBSD. Linux/macOS/Windows only. Not even IBM AIX is supported.


----------



## beppo (Oct 29, 2018)

Thanks for your quick reply. I assume you mean LTFS is unsupported in your first sentence .


----------



## vermaden (Oct 29, 2018)

Yes 

Fixed.


----------



## irukandji (Sep 11, 2020)

Is this still the case in 2020? I got a HP Ultrium 3000 LTO-5 device and I would really hate to install linux just for the sake of using it...


----------



## vermaden (Sep 11, 2020)

irukandji said:


> Is this still the case in 2020? I got a HP Ultrium 3000 LTO-5 device and I would really hate to install linux just for the sake of using it...


What is the question? LTFS on FreeBSD?


----------



## irukandji (Sep 30, 2020)

vermaden said:


> What is the question? LTFS on FreeBSD?



Yes. Actually two: is HP Ultrium 3000 supported and is LTFS supported... if not i hope I will be able to make pass-trough to bhyve linux...

Just plugged in SAS 2308 and it works (btw, if someone needs them, there are new HP H220 HBAs for $25 on aliexpress), waiting for a cable to be able to test the LTO...


----------



## ralphbsz (Sep 30, 2020)

The Ultrium 3000 is an LTO-5 standard drive; those should be supported by LTFS. Whether the SAS communication works correctly with your motherboard, your SAS card, and your cabling, is an interesting question, but very likely it should. There is a pre-compiled LTFS package available for FreeBSD; how well it works, I don't know.

If the HP H220 is a rebranded LSI card, it should work; but beware of OEM cards that can't take firmware upgrades of LSI-branded firmware (those things exist, but I don't know whether HP's cards are in that category).


----------



## irukandji (Sep 30, 2020)

Well I hope that it will work, it certainly poses as SAS2308:


```
mps0: <Avago Technologies (LSI) SAS2308> port 0x3000-0x30ff mem 0xa1240000-0xa124ffff,0xa1200000-0xa123ffff irq 16 at device 0.0 on pci1
```

Thank you very much for your answer, well just to find some cabling and I will try and surely report it back, with LTO-9 on the way, the LTO-5 are becoming cheap and I hope it will be helpful for someone else.


----------



## vermaden (Oct 1, 2020)

ralphbsz said:


> There is a pre-compiled LTFS package available for FreeBSD; how well it works, I don't know.



Link please. Thanks.


----------



## irukandji (Oct 1, 2020)

pkg install ltfs


----------



## vermaden (Oct 1, 2020)

irukandji said:


> pkg install ltfs


I did not thought that this would be THAT easy.
Thank You 

Pity I do not have LTO drive to test it anymore


----------



## irukandji (Nov 7, 2020)

Ok, I have finally managed all the hardware details (HP H200, SAS wiring), looks like ultrium 3000 is responding, but the LTFS is saying "Cannot open device: failed backend open call."


```
18885 LTFS14000I LTFS starting, LTFS version 2.4.2.0 (10418), log level 2.
18885 LTFS14058I LTFS Format Specification version 2.4.0.
18885 LTFS14104I Launched by "ltfs".
18885 LTFS14105I This binary is built for FreeBSD.
18885 LTFS14106I GCC version is 4.2.1 Compatible FreeBSD Clang 8.0.1 (tags/RELEASE_801/final 366581).
18885 LTFS17087I Kernel version: FreeBSD 12.2-RELEASE r366954 GENERIC
.
18885 LTFS14063I Sync type is "time", Sync time is 300 sec.
18885 LTFS17085I Plugin: Loading "cam" tape backend.
18885 LTFS17085I Plugin: Loading "unified" iosched backend.
18885 LTFS14095I Set the tape device write-anywhere mode to avoid cartridge ejection.
18885 LTFS31223I Opening a device through CAM driver (/dev/sa0)
18885 LTFS31228I Product ID is 'Ultrium 5-SCSI'
18885 LTFS31229I Vendor ID is HP
18885 LTFS31230I Unsupported Drive 'Ultrium 5-SCSI  Z64D'
18885 LTFS12012E Cannot open device: failed backend open call.
18885 LTFS10004E Cannot open device '/dev/sa0'.
```

I have downloaded sources and will build my own binaries. The ltfs version in 12.2 repo is from 14.04.2020 and as such is quite new... on the other side there is a merge: https://github.com/LinearTapeFileSystem/ltfs/pull/204 which claims support for HP tapes which is dated 14.07.2020 and as such is not part of freebsd package... might work... will report back.


----------



## irukandji (Nov 8, 2020)

Ok, fyi, this wont fly. LTFS didnt use their compatibility layer on freebsd cam part and even using it there is no supporting code for HP tape drives. Only IBM. I could go porting HP LTFS implementation that is open source but this rabbit hole is just too deep for hobby project.

For anyone searching an answer if LTFS is supported for NON IBM tapes on FreeBSD: No it is not.


----------



## Jerome4 (Nov 26, 2020)

The version in ports says it's for IBM/Dell drives only.

The HP implementation of LTFS is open source. You can download it from HP but you need to register.
//support.hpe.com/hpesc/public/km/product/1009214665/Product#t=DriversandSoftware

As noted, they don't support FreeBSD, not sure how difficult it would be to port. It needs to run through FUSE. But worst case scenario you may be able to passthru to a Bhyve guest running RHEL or Windows.

I'd be interested to know if you get this working.


Have you tried trying to use your drive normally first without LTFS?


----------



## irukandji (Nov 27, 2020)

I am using tar. Anyway, I have just sent original developer (that offered to port it to freebsd if I can test it for him - if anyone wants to help, pm me) the email with my changes on ltfs compatibility level for freebsd, I hope we will get the port


----------



## colo97 (May 17, 2021)

Hi, any news on LTFS for HP drives in FreeBSD ? I have compiled LTFS from HP sources on Debian 10 buster, it works with HP LTO-5 drive, but only when calling by sg_device name not by default /dev/[n]st0 device name. I am new to BSD so I cannot compile it, things are quite different from linux


----------

