# How do i use my scsi tape drive (dat)

## olah

Is There some nice gtk/qt backuptool for scsi tape drives

my kernal supports it and there's no problem with it 

but i havent figured out a way to back my /home partition up

anyone got a clue  :Question: 

----------

## OdinsDream

I set up an IDE tape drive for a server recently, using gentoo. The command I placed into /etc/crontab was:

mt -f /dev/ht0 erase && tar -cvf /dev/ht0 /home /etc /root

This erases the tape, then tar's up /home, /etc, and /root, as well as anything beneath them, and puts them on the tape.

Check out info tar and man mt for more information. You'll also be able to eject the tape when it's finished.

----------

## olah

"mt" is not installed... but it seems to write my /home partition without problems.

another question

 *Quote:*   

> 
> 
> tar -cvf /dev/ht0 /home /etc /root
> 
> 

 

does it compress or do i have tu run with "-z" too?[/quote]

----------

## OdinsDream

 *olah wrote:*   

> "mt" is not installed... but it seems to write my /home partition without problems.
> 
> another question
> 
>  *Quote:*   
> ...

 [/quote]

You can install mt from portage. I believe the package is named:

mt-st

But, don't take my word for it. As far as compression goes, I think the "c" flag compresses, where z runs it again through gzip. Check info tar for more details.

----------

## MathFreak

Actually, the -c just tells tar to create an archive.  For compression, you need to specify -z (gzip), -Z (compress), or -j (bzip2).

----------

## OdinsDream

 *MathFreak wrote:*   

> Actually, the -c just tells tar to create an archive.  For compression, you need to specify -z (gzip), -Z (compress), or -j (bzip2).

 

Thanks for answering that. I couldn't recall.

----------

## olah

thanx for youre help guys

----------

## olah

and if i whant to recall my previous /hom from tape ill just type

```
tar -xvzf /dev/st0 /home
```

for example, or am i wrong?

----------

## psp

Erhm... I would not gzip to tape (tar -cvf is sufficient). This may corrupt your backup. You should check to see if hardware compression is supported for your device, and enable it with 'mt' (man mt).

Daniel Robbins has written a good article about this. Check out the article titled: "Backing up your Linux machines (tutorial)" in the Miscellaneous Resources -> IBM... section of the main Gentoo site. He suggests using star (which is quicker), but for a single machine with not much data 'tar' works sufficiently well.

```

# Basically (hardware dependant):

# --------------------------------------

# For my SCSI dat tape drive.

TAPEDEV="/dev/st0"

INCLUDEFILE="backup_these_dirs"

EXCLUDEFILE="backup.exclude"

mt -f ${TAPEDEV} compression

tar -cvf ${TAPEDEV} \

    --blocking-factor=${BLOCKSIZE} \

    --exclude-from=${EXCLUDEFILE} \

    --files-from=${INCLUDEFILE}

```

Since I'm using the /dev/st0 device, I do not need to rewind the tape. So restoring from backup is simply: tar -xvf /dev/st0.

As with all backups. Test! Test! Test! Make sure your backup _AND_ restore both work!

Hope this helps...

----------

## olah

do i really have to specify a blocksize... i dont know anything about blocksizes

btw im trying to (doh!) do like this now

```
mt -f /dev/st0 compress && tar -cvvzf /dev/st0 /home
```

----------

## psp

The blockzsize is unecessary. It is only there for optimisation. Tapes aren't like harddrives (obviously) and specifying a larger blocksize can lessen the time it takes to write to tape. I think the default block size is 32k and specifying a blocksize of 64k can speed up the dump to tape (not 2x the speed though   :Sad:  )

The most important thing is writing the backup to tape and then restoring it again.

Hope this helps...

----------

## eltech

 *olah wrote:*   

> Is There some nice gtk/qt backuptool for scsi tape drives
> 
> my kernal supports it and there's no problem with it 
> 
> but i havent figured out a way to back my /home partition up
> ...

 

Question .. how do you not have 'mt' installed yet you are able to use the command and what tape program have you installed to get your tapedrive running?

is the proram in the portage tree?

i have a tape drive an have not had time to get it to work (other problems) but it seems as though you got it working rather quick ..

i have anable tape support in my kernel .. 

thanks ..

----------

## OdinsDream

eltech, don't be fooled into thinking your tape drive requires any kind of special software to operate. I was under this impression for a few days, working with things like mondo-rescue, and others, when I realised two simple, standard programs can do everything I wanted.

You'll need tar, and possibly mt-st, in the portage tree. The latter is mainly for DAT tapes, it seems, but you might as well take a look at man mt in case you find something you'll use.

Performing a backup is a simple matter of determining which device entry corresponds to your tape drive. For figuring this out, check dmesg. I'm using ide-tape, and my device ends up being /dev/ht0, but st0 seems common, as well.

After you figure this out, refer to the commands above in this thread for more information. Backing up your home directory is as simple as:

tar -cvvf /dev/ht0 /home

----------

## eltech

 *OdinsDream wrote:*   

> eltech, don't be fooled into thinking your tape drive requires any kind of special software to operate. I was under this impression for a few days, working with things like mondo-rescue, and others, when I realised two simple, standard programs can do everything I wanted.
> 
> You'll need tar, and possibly mt-st, in the portage tree. The latter is mainly for DAT tapes, it seems, but you might as well take a look at man mt in case you find something you'll use.
> 
> Performing a backup is a simple matter of determining which device entry corresponds to your tape drive. For figuring this out, check dmesg. I'm using ide-tape, and my device ends up being /dev/ht0, but st0 seems common, as well.
> ...

 

WOW! .. dont be fooled is right.. seems very simple .. i will try to locate my drive now and work from there .. thanks .. i'll post results ..

----------

## eltech

Actually ... dosnt seem to be here ..   :Rolling Eyes:   take a look ..

```
IOS-provided physical RAM map:

 BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)

 BIOS-e820: 0000000000100000 - 000000001fff0000 (usable)

 BIOS-e820: 000000001fff0000 - 000000001fffec00 (ACPI data)

 BIOS-e820: 000000001fffec00 - 000000001ffff000 (reserved)

 BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved)

 BIOS-e820: 00000000fee00000 - 00000000fee10000 (reserved)

 BIOS-e820: 00000000fff80000 - 0000000100000000 (reserved)

511MB LOWMEM available.

found SMP MP-table at 000fe710

hm, page 000fe000 reserved twice.

hm, page 000ff000 reserved twice.

hm, page 000f0000 reserved twice.

On node 0 totalpages: 131056

zone(0): 4096 pages.

zone(1): 126960 pages.

zone(2): 0 pages.

ACPI: Searched entire block, no RSDP was found.

ACPI: RSDP located at physical address c00fdc60

RSD PTR  v0 [DELL  ]

__va_range(0xfdc74, 0x68): idx=8 mapped at ffff6000

ACPI table found: RSDT v1 [DELL   PE1600SC 0.1]

__va_range(0xfdca4, 0x24): idx=8 mapped at ffff6000

__va_range(0xfdca4, 0x74): idx=8 mapped at ffff6000

ACPI table found: FACP v1 [DELL   PE1600SC 0.1]

__va_range(0xfdd18, 0x24): idx=8 mapped at ffff6000

__va_range(0xfdd18, 0x88): idx=8 mapped at ffff6000

ACPI table found: APIC v1 [DELL   PE1600SC 0.1]

__va_range(0xfdd18, 0x88): idx=8 mapped at ffff6000

LAPIC (acpi_id[0x0001] id[0x0] enabled[1])

CPU 0 (0x0000) enabledProcessor #0 Pentium 4(tm) XEON(tm) APIC version 16

LAPIC (acpi_id[0x0002] id[0x2] enabled[0])

CPU 1 (0x0200) disabled

LAPIC (acpi_id[0x0003] id[0x1] enabled[1])

CPU 2 (0x0100) enabledProcessor #1 Pentium 4(tm) XEON(tm) APIC version 16

LAPIC (acpi_id[0x0004] id[0x3] enabled[0])

CPU 3 (0x0300) disabled

IOAPIC (id[0x2] address[0xfec00000] global_irq_base[0x0])

IOAPIC (id[0x3] address[0xfec01000] global_irq_base[0x10])

IOAPIC (id[0x4] address[0xfec02000] global_irq_base[0x20])

LAPIC_NMI (acpi_id[0x0001] polarity[0x1] trigger[0x1] lint[0x1])

LAPIC_NMI (acpi_id[0x0002] polarity[0x1] trigger[0x1] lint[0x1])

LAPIC_NMI (acpi_id[0x0003] polarity[0x1] trigger[0x1] lint[0x1])

LAPIC_NMI (acpi_id[0x0004] polarity[0x1] trigger[0x1] lint[0x1])

4 CPUs total

Local APIC address fee00000

__va_range(0xfdda0, 0x24): idx=8 mapped at ffff6000

__va_range(0xfdda0, 0x50): idx=8 mapped at ffff6000

ACPI table found: SPCR v1 [DELL   PE1600SC 0.1]

Enabling the CPU's according to the ACPI table

Intel MultiProcessor Specification v1.4

    Virtual Wire compatibility mode.

OEM ID: DELL     Product ID: PE 0135      APIC at: 0xFEE00000

I/O APIC #2 Version 17 at 0xFEC00000.

I/O APIC #3 Version 17 at 0xFEC01000.

I/O APIC #4 Version 17 at 0xFEC02000.

Enabling APIC mode: Flat.       Using 3 I/O APICs

Processors: 2

Kernel command line: root=/dev/sda3

Initializing CPU#0

Detected 2392.165 MHz processor.

Console: colour VGA+ 80x25

Calibrating delay loop... 4771.02 BogoMIPS

Memory: 514640k/524224k available (2152k kernel code, 9200k reserved, -2677k data, 132k init, 0k highmem)

Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)

Inode cache hash table entries: 32768 (order: 6, 262144 bytes)

Mount cache hash table entries: 512 (order: 0, 4096 bytes)

Buffer-cache hash table entries: 32768 (order: 5, 131072 bytes)

Page-cache hash table entries: 131072 (order: 7, 524288 bytes)

CPU: Trace cache: 12K uops, L1 D cache: 8K

CPU: L2 cache: 512K

CPU: Physical Processor ID: 0

Intel machine check architecture supported.

Intel machine check reporting enabled on CPU#0.

CPU:     After generic, caps: bfebfbff 00000000 00000000 00000000

CPU:             Common caps: bfebfbff 00000000 00000000 00000000

Enabling fast FPU save and restore... done.

Enabling unmasked SIMD FPU exception support... done.

Checking 'hlt' instruction... OK.

POSIX conformance testing by UNIFIX

CPU: Trace cache: 12K uops, L1 D cache: 8K

CPU: L2 cache: 512K

CPU: Physical Processor ID: 0

Intel machine check reporting enabled on CPU#0.

CPU:     After generic, caps: bfebfbff 00000000 00000000 00000000

CPU:             Common caps: bfebfbff 00000000 00000000 00000000

CPU0: Intel(R) Xeon(TM) CPU 2.40GHz stepping 07

per-CPU timeslice cutoff: 1462.89 usecs.

enabled ExtINT on CPU#0

ESR value before enabling vector: 00000040

ESR value after enabling vector: 00000000

Booting processor 1/1 eip 2000

Initializing CPU#1

masked ExtINT on CPU#1

ESR value before enabling vector: 00000000

ESR value after enabling vector: 00000000

Calibrating delay loop... 4771.02 BogoMIPS

CPU: Trace cache: 12K uops, L1 D cache: 8K

CPU: L2 cache: 512K

CPU: Physical Processor ID: 0

Intel machine check reporting enabled on CPU#1.

CPU:     After generic, caps: bfebfbff 00000000 00000000 00000000

CPU:             Common caps: bfebfbff 00000000 00000000 00000000

CPU1: Intel(R) Xeon(TM) CPU 2.40GHz stepping 07

Total of 2 processors activated (9542.04 BogoMIPS).

cpu_sibling_map[0] = 1

cpu_sibling_map[1] = 0

ENABLING IO-APIC IRQs

Setting 2 in the phys_id_present_map

...changing IO-APIC physical APIC ID to 2 ... ok.

Setting 3 in the phys_id_present_map

...changing IO-APIC physical APIC ID to 3 ... ok.

Setting 4 in the phys_id_present_map

...changing IO-APIC physical APIC ID to 4 ... ok.

init IO_APIC IRQs

 IO-APIC (apicid-pin) 2-0, 2-3, 2-5, 2-11, 2-13, 3-14, 3-15, 4-0, 4-1, 4-2, 4-3, 4-4, 4-5, 4-6, 4-7, 4-8, 4-9, 4-10, 4-11, 4-12, 4-1

3, 4-14, 4-15 not connected.

..TIMER: vector=0x31 pin1=2 pin2=0

..MP-BIOS bug: 8254 timer not connected to IO-APIC

...trying to set up timer (IRQ0) through the 8259A ... 

..... (found pin 0) ...works.

number of MP IRQ sources: 38.

number of IO-APIC #2 registers: 16.

number of IO-APIC #3 registers: 16.

number of IO-APIC #4 registers: 16.

testing the IO APIC.......................

IO APIC #2......

.... register #00: 02000000

.......    : physical APIC id: 02

.......    : Delivery Type: 0

.......    : LTS          : 0

.... register #01: 000F0011

.......     : max redirection entries: 000F

.......     : PRQ implemented: 0

.......     : IO APIC version: 0011

.... register #02: 02000000

.......     : arbitration: 02

.... IRQ redirection table:

 NR Log Phy Mask Trig IRR Pol Stat Dest Deli Vect:   

 00 003 03  0    0    0   0   0    1    1    31

 01 003 03  0    0    0   0   0    1    1    39

 02 000 00  1    0    0   0   0    0    0    00

 03 000 00  1    0    0   0   0    0    0    00

 04 003 03  0    0    0   0   0    1    1    41

 05 000 00  1    0    0   0   0    0    0    00

 06 003 03  0    0    0   0   0    1    1    49

 07 003 03  0    0    0   0   0    1    1    51

 08 003 03  0    0    0   0   0    1    1    59

 09 003 03  0    0    0   0   0    1    1    61

 0a 003 03  1    1    0   1   0    1    1    69

 0b 000 00  1    0    0   0   0    0    0    00

 0c 003 03  0    0    0   0   0    1    1    71

 0d 000 00  1    0    0   0   0    0    0    00

 0e 003 03  0    0    0   0   0    1    1    79

 0f 003 03  0    0    0   0   0    1    1    81

IO APIC #3......

.... register #00: 03000000

.......    : physical APIC id: 03

.......    : Delivery Type: 0

.......    : LTS          : 0

.... register #01: 000F0011

.......     : max redirection entries: 000F

.......     : PRQ implemented: 0

.......     : IO APIC version: 0011

.... register #02: 03000000

.......     : arbitration: 03

.... IRQ redirection table:

 NR Log Phy Mask Trig IRR Pol Stat Dest Deli Vect:   

 00 003 03  1    1    0   1   0    1    1    89

 01 003 03  1    1    0   1   0    1    1    91

 02 003 03  1    1    0   1   0    1    1    99

 03 003 03  1    1    0   1   0    1    1    A1

 04 003 03  1    1    0   1   0    1    1    A9

 05 003 03  1    1    0   1   0    1    1    B1

 06 003 03  1    1    0   1   0    1    1    B9

 07 003 03  1    1    0   1   0    1    1    C1

 08 003 03  1    1    0   1   0    1    1    C9

 09 003 03  1    1    0   1   0    1    1    D1

 0a 003 03  1    1    0   1   0    1    1    D9

 0b 003 03  1    1    0   1   0    1    1    E1

 0c 003 03  1    1    0   1   0    1    1    E9

 0d 003 03  1    1    0   1   0    1    1    32

 0e 000 00  1    0    0   0   0    0    0    00

 0f 000 00  1    0    0   0   0    0    0    00

IO APIC #4......

.... register #00: 04000000

.......    : physical APIC id: 04

.......    : Delivery Type: 0

.......    : LTS          : 0

.... register #01: 000F0011

.......     : max redirection entries: 000F

.......     : PRQ implemented: 0

.......     : IO APIC version: 0011

.... register #02: 04000000

.......     : arbitration: 04

.... IRQ redirection table:

 NR Log Phy Mask Trig IRR Pol Stat Dest Deli Vect:   

 00 000 00  1    0    0   0   0    0    0    00

 01 000 00  1    0    0   0   0    0    0    00

 02 000 00  1    0    0   0   0    0    0    00

 03 000 00  1    0    0   0   0    0    0    00

 04 000 00  1    0    0   0   0    0    0    00

 05 000 00  1    0    0   0   0    0    0    00

 06 000 00  1    0    0   0   0    0    0    00

 07 000 00  1    0    0   0   0    0    0    00

 08 000 00  1    0    0   0   0    0    0    00

 09 000 00  1    0    0   0   0    0    0    00

 0a 000 00  1    0    0   0   0    0    0    00

 0b 000 00  1    0    0   0   0    0    0    00

 0c 000 00  1    0    0   0   0    0    0    00

 0d 000 00  1    0    0   0   0    0    0    00

 0e 000 00  1    0    0   0   0    0    0    00

 0f 000 00  1    0    0   0   0    0    0    00

IRQ to pin mappings:

IRQ0 -> 0:0

IRQ1 -> 0:1

IRQ4 -> 0:4

IRQ6 -> 0:6

IRQ7 -> 0:7

IRQ8 -> 0:8

IRQ9 -> 0:9

IRQ10 -> 0:10

IRQ12 -> 0:12

IRQ14 -> 0:14

IRQ15 -> 0:15

IRQ16 -> 1:0

IRQ17 -> 1:1

IRQ18 -> 1:2

IRQ19 -> 1:3

IRQ20 -> 1:4

IRQ21 -> 1:5

IRQ22 -> 1:6

IRQ23 -> 1:7

IRQ24 -> 1:8

IRQ25 -> 1:9

IRQ26 -> 1:10

IRQ27 -> 1:11

IRQ28 -> 1:12

IRQ29 -> 1:13

.................................... done.

Using local APIC timer interrupts.

calibrating APIC timer ...

..... CPU clock speed is 2392.1302 MHz.

..... host bus clock speed is 132.8960 MHz.

cpu: 0, clocks: 1328960, slice: 442986

CPU0<T0:1328960,T1:885968,D:6,S:442986,C:1328960>

cpu: 1, clocks: 1328960, slice: 442986

CPU1<T0:1328960,T1:442976,D:12,S:442986,C:1328960>

checking TSC synchronization across CPUs: passed.

Waiting on wait_init_idle (map = 0x2)

All processors have done init_idle

PCI: PCI BIOS revision 2.10 entry at 0xfc6ee, last bus=2

PCI: Using configuration type 1

PCI: Probing PCI hardware

PCI: Ignoring BAR0-3 of IDE controller 00:0f.1

PCI: Discovered primary peer bus 01 [IRQ]

PCI: Discovered primary peer bus 02 [IRQ]

PCI: Using IRQ router ServerWorks [1166/0201] at 00:0f.0

PCI->APIC IRQ transform: (B0,I2,P0) -> 16

PCI->APIC IRQ transform: (B1,I2,P0) -> 17

PCI->APIC IRQ transform: (B1,I4,P0) -> 29

isapnp: Scanning for PnP cards...

isapnp: No Plug & Play device found

Linux NET4.0 for Linux 2.4

Based upon Swansea University Computer Society NET3.039

Initializing RT netlink socket

Starting kswapd

devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)

devfs: boot_options: 0x1

Installing knfsd (copyright (C) 1996 okir@monad.swb.de).

NTFS driver v1.1.22 [Flags: R/O]

Detected PS/2 Mouse Port.

Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI ISAPNP enabled

ttyS00 at 0x03f8 (irq = 4) is a 16550A

Real Time Clock Driver v1.10e

Floppy drive(s): fd0 is 1.44M

FDC 0 is a National Semiconductor PC87306

Intel(R) PRO/1000 Network Driver - version 5.0.43-k1

Copyright (c) 1999-2003 Intel Corporation.

eth0: Intel(R) PRO/1000 Network Connection

Linux agpgart interface v0.99 (c) Jeff Hartmann

agpgart: Maximum main memory to use for agp memory: 439M

agpgart: no supported devices found.

[drm] Initialized tdfx 1.0.0 20010216 on minor 0

[drm] Initialized radeon 1.1.1 20010405 on minor 1

[drm:drm_init] *ERROR* Cannot initialize the agpgart module.

Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4

ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx

hdc: SAMSUNG CD-ROM SC-148C, ATAPI CD/DVD-ROM drive

ide1 at 0x170-0x177,0x376 on irq 15

hdc: attached ide-cdrom driver.

hdc: ATAPI 48X CD-ROM drive, 128kB Cache

Uniform CD-ROM driver Revision: 3.12

SCSI subsystem driver Revision: 1.00

megaraid: v1.18f (Release Date: Tue Dec 10 09:54:39 EST 2002)

megaraid: found 0x101e:0x1960:idx 0:bus 1:slot 2:func 0

scsi0 : Found a MegaRAID controller at 0xe0823000, IRQ: 17

scsi0 : Enabling 64 bit support

megaraid: [1.74:3.27] detected 1 logical drives

megaraid: supports extended CDBs.

megaraid: channel[1] is raid.

scsi0 : LSI Logic MegaRAID 1.74 254 commands 15 targs 4 chans 7 luns

scsi0: scanning virtual channel 0 for logical drives.

  Vendor: MegaRAID  Model: LD 0 RAID5   69G  Rev: 1.74

  Type:   Direct-Access                      ANSI SCSI revision: 02

scsi0: scanning virtual channel 1 for logical drives.

scsi0: scanning virtual channel 2 for logical drives.

scsi0: scanning physical channel 0 for devices.

  Vendor: SDR       Model: GEM318P           Rev: 1   

  Type:   Processor                          ANSI SCSI revision: 02

Attached scsi disk sda at scsi0, channel 0, id 0, lun 0

SCSI device sda: 142041088 512-byte hdwr sectors (72725 MB)

Partition check:

 /dev/scsi/host0/bus0/target0/lun0: p1 p2 p3

Linux Kernel Card Services 3.1.22

  options:  [pci] [cardbus] [pm]

usb.c: registered new driver hub

host/uhci.c: USB Universal Host Controller Interface driver v1.1

Initializing USB Mass Storage driver...

usb.c: registered new driver usb-storage

USB Mass Storage support registered.

NET4: Linux TCP/IP 1.0 for NET4.0

IP Protocols: ICMP, UDP, TCP, IGMP

IP: routing cache hash table of 4096 buckets, 32Kbytes

TCP: Hash tables configured (established 32768 bind 32768)

NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.

ds: no socket drivers loaded!

kmod: failed to exec /sbin/modprobe -s -k nls_iso8859-1, errno = 2

reiserfs: checking transaction log (device 08:03) ...

reiserfs: replayed 3 transactions in 0 seconds

Using r5 hash to sort names

ReiserFS version 3.6.25

VFS: Mounted root (reiserfs filesystem) readonly.

Mounted devfs on /dev

Freeing unused kernel memory: 132k freed

Adding Swap: 1004052k swap-space (priority -1)

e1000: eth0 NIC Link is Up 100 Mbps Full Duplex
```

or did i skip past it?

I recognize a few of the items .. but i see none saying anything about the actual tape drive ..

----------

## olah

i dont know if my drive supports compression... if a use 

```
mt -f /dev/st0 compress
```

 and so on how ca i really know if compression is on? I cant run status cus the drive is bussy (should be when im writing to it), do i really have to wait for a backup to fail/succeed   :Question: 

----------

## olah

fscking sh*t 

have i done something wrong... wen i do this the tapedrive makes funny noises have i made a dumdidumdum

```
bash-2.05b# mt -t /dev/st0 erase compress && tar -cvvf /dev/st0 /apa

tar: Removing leading `/' from member names

drwxr-xr-x root/root         0 2003-08-07 21:49:17 apa/

drwxr-xr-x 501/users         0 2002-11-12 21:10:53 apa/id1/

-rw-r--r-- 501/users      1822 2002-11-12 21:10:48 apa/id1/CONFIG.CFG

-rw-r--r-- 501/users  18689235 2002-11-12 21:10:53 apa/id1/PAK0.PAK

tar: /dev/st0: Wrote only 0 of 10240 bytes

tar: Error is not recoverable: exiting now
```

its like 7.5 GB with movies and mp3:s and other stuff

----------

## psp

eltech

 *Quote:*   

> Actually ... dosnt seem to be here ..

 

Do you have the correct kernel modules loaded/compiled into the kernel.

I use a SCSI tape drive and I have to load the 'st' module before the tape drive is seen and useable.

You have to enable:

ATA/IDE/MFM/RLL support  ---> IDE, ATA and ATAPI Block devices  ---> Include IDE/ATAPI TAPE support

The module name is: ide-tape.

olah

 *Quote:*   

> have i done something wrong... 

 

You don't have to erase the tape first. You can just overwrite.

I would eject the tape, re-insert it, then rewind, then write to the tape w/o enabling compression.

i.e.

```
# I use an HP dds tape drive which I need to unlock before ejecting.

# You might not have to unlock before ejecting. In which case the 'rewoffl'

# command may work for you.

# It should be rewound already... but in case.

# Note: /dev/st0 automatically rewinds the tape when it's done.

#         /dev/nst0 does not rewind.

mt -t /dev/st0 rewind

mt -f /dev/st0 unlock

mt -f /dev/st0 eject

[re-insert tape]

# Make sure the output from the next command includes:ONLINE 

mt -f /dev/st0 status

tar -cvf /dev/st0 /home/olah

```

I suggest backing up a smallish directory, and then testing the restore. Once this is working, you should experiment with compression.

Hope this helps...

----------

## eltech

 *psp wrote:*   

> eltech
> 
>  *Quote:*   Actually ... dosnt seem to be here .. 
> 
> Do you have the correct kernel modules loaded/compiled into the kernel.
> ...

 

ahh .. i did have an ide/atapi2 support, wrong one ..

so am rebuilding my kernel now .. thanks ...

i'll post the turn out ..

seems like i hijack this thread, sorry   :Sad: 

----------

## olah

```
Attached scsi tape st0 at scsi0, channel 0, id 3, lun 0
```

this is my tape drive, if i have the wrong module it would'nt be found 

i need compression cus the directory im trying to back is 7.5GB

and my hp ddt-2 tapes says 8GB storage with compression enabled

----------

## taskara

there is an app called  "dump" and also "amanda" that may make good use of it.

but copying directly is easy enough too  :Smile: 

----------

## someguy

no offense or anything but isnt this in the wrong forum

----------

## olah

this is the networking and "security" forum... using tapedrives to backup data pretty much fits in to security

----------

## psp

Once you have 'mt' up and running you can install amanda. With amanda you can tunnel the backups, using ssh, over the network making your backups even more secure.

Not to be taken too seriously  :Wink: 

----------

## Daemonfly

I use dump on my FreeBSD test server. From what I've read, Dump backs up the entire chosen  filesystem - not a certain directory. It will work with whats listed in your fstab file. If "/home" is actually on it's own partition, etc.. then you could dump it's entirety to tape. If you have /home on it's own drive/partition but want to backup just /home/xxxx, then Dump won't work.

----------

## psp

Dump is awesome, but has one serious drawback... it is filesystem specific.

So while the interface may look similar, dump has to be written for you specific filesystem (ext2, ext3, ufs, etc.). While this is not a problem for most, I have multiple filesystems on one machine, so a multi-session dump to tape is a little more complex than using tar.

----------

## olah

Hmm... i forgott one important thing.... the tape must be in the drive for some time before i can use it....(Doh  :Exclamation:   :Exclamation:   :Exclamation:  ) seems to back my 

/home/satan/source with no problem now (700Mb) but i havent tried compression yet

----------

## ka2er

I've read this thread and the IBM doc mentionned earlier but I still failed to use my HP surestore DAT24.

Here's the error log that I've got when trying the following command :

command:

```
root@ka2er todel # star -cv bs=64k -f /dev/st0 /home/seb/script/spam.sh

a /home/seb/script/spam.sh 286 bytes, 1 tape blocks

star: 1 blocks + 0 bytes (total of 65536 bytes = 64.00k).

root@ka2er todel # star -tv bs=64k -f /dev/st0

star: Input/output error. Error reading '/dev/st0'.

star: 0 blocks + 0 bytes (total of 0 bytes = 0.00k).
```

error :

```
Aug 13 19:50:46 ka2er kernel: st0: Error with sense data: Deferred st09:00: sense key Medium Error

Aug 13 19:50:46 ka2er kernel: Additional sense indicates Sequential positioning error

Aug 13 19:50:46 ka2er kernel: st0: Error on write filemark.

Aug 13 19:54:36 ka2er kernel: st0: Error with sense data: Info fld=0x10000, Current st09:00: sense key Medium Error

Aug 13 19:54:36 ka2er kernel: Additional sense indicates Sequential positioning error

```

before I had actived the scsi2logical option by this way :

```
root@ka2er todel # mt -f /dev/st0 stoptions scsi2logical

root@ka2er todel # mt -f /dev/st0 status

SCSI 2 tape drive:

File number=0, block number=0, partition=0.

Tape block size 0 bytes. Density code 0x25 (DDS-3).

Soft error count since last status=0

General status bits on (41010000):

 BOT ONLINE IM_REP_EN

```

my scsi config :

```
root@ka2er todel # cat /usr/src/linux/.config | grep SCSI

# CONFIG_BLK_DEV_IDESCSI is not set

# SCSI support

CONFIG_SCSI=y

# SCSI support type (disk, tape, CD-ROM)

# Some SCSI devices (e.g. CD jukebox) support multiple LUNs

# CONFIG_SCSI_DEBUG_QUEUES is not set

CONFIG_SCSI_MULTI_LUN=y

CONFIG_SCSI_CONSTANTS=y

# CONFIG_SCSI_LOGGING is not set

# SCSI low-level drivers

# CONFIG_SCSI_7000FASST is not set

# CONFIG_SCSI_ACARD is not set

# CONFIG_SCSI_AHA152X is not set

# CONFIG_SCSI_AHA1542 is not set

# CONFIG_SCSI_AHA1740 is not set

# CONFIG_SCSI_AACRAID is not set

# CONFIG_SCSI_AIC7XXX is not set

# CONFIG_SCSI_AIC79XX is not set

# CONFIG_SCSI_AIC7XXX_OLD is not set

# CONFIG_SCSI_DPT_I2O is not set

# CONFIG_SCSI_ADVANSYS is not set

# CONFIG_SCSI_IN2000 is not set

# CONFIG_SCSI_AM53C974 is not set

# CONFIG_SCSI_MEGARAID is not set

# CONFIG_SCSI_BUSLOGIC is not set

# CONFIG_SCSI_CPQFCTS is not set

# CONFIG_SCSI_DMX3191D is not set

# CONFIG_SCSI_DTC3280 is not set

# CONFIG_SCSI_EATA is not set

# CONFIG_SCSI_EATA_DMA is not set

# CONFIG_SCSI_EATA_PIO is not set

# CONFIG_SCSI_FUTURE_DOMAIN is not set

# CONFIG_SCSI_GDTH is not set

# CONFIG_SCSI_GENERIC_NCR5380 is not set

# CONFIG_SCSI_IPS is not set

# CONFIG_SCSI_INITIO is not set

# CONFIG_SCSI_INIA100 is not set

# CONFIG_SCSI_NCR53C406A is not set

# CONFIG_SCSI_NCR53C7xx is not set

# CONFIG_SCSI_SYM53C8XX_2 is not set

CONFIG_SCSI_NCR53C8XX=y

# CONFIG_SCSI_SYM53C8XX is not set

CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=4

CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32

CONFIG_SCSI_NCR53C8XX_SYNC=20

# CONFIG_SCSI_NCR53C8XX_PROFILE is not set

# CONFIG_SCSI_NCR53C8XX_IOMAPPED is not set

# CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT is not set

# CONFIG_SCSI_PAS16 is not set

# CONFIG_SCSI_PCI2000 is not set

# CONFIG_SCSI_PCI2220I is not set

# CONFIG_SCSI_PSI240I is not set

# CONFIG_SCSI_QLOGIC_FAS is not set

# CONFIG_SCSI_QLOGIC_ISP is not set

# CONFIG_SCSI_QLOGIC_FC is not set

# CONFIG_SCSI_QLOGIC_1280 is not set

# CONFIG_SCSI_SEAGATE is not set

# CONFIG_SCSI_SIM710 is not set

# CONFIG_SCSI_SYM53C416 is not set

# CONFIG_SCSI_DC390T is not set

# CONFIG_SCSI_T128 is not set

# CONFIG_SCSI_U14_34F is not set

# CONFIG_SCSI_ULTRASTOR is not set

# CONFIG_SCSI_NSP32 is not set

# CONFIG_SCSI_DEBUG is not set

# CONFIG_USB_HPUSBSCSI is not set

```

I haven't anymore many idea and haven't use this kind of hardware before ...

Anybody could help me ? Thanks !

----------

## psp

Your kernel config looks good.

The things I would try:

1) star w/o the blocksize setting.

2) mt w/o the scsi2logical option.

3) Try it with another tape.

4) Perhaps try erase the tape i.e. 'mt -f /dev/st0 erase' (this may take some time)

5) Try GNU tar (may be slower, but _MUCH_ more stable)

Hope this helps...

----------

## olah

you might wanna read the coversheet of youre ddt-2 tape (i presume that it is ddt-2 you are using) somewhere in the fineprint it should say  *Quote:*   

> the tape should be exposed to its enviormen for at least 24Hours

  i dont belive that 24 hours fully nessesary but let the tape be in the drive for at least an hour or two

----------

## ka2er

even if I try to erase the tape I've got an error maybe an problem on m y SCSI chain ?

here the log 

```
Aug 18 18:08:56 ka2er kernel: ncr53c875-0-<1,*>: FAST-10 SCSI 10.0 MB/s (100 ns, offset 16)

Aug 18 18:08:56 ka2er kernel: st0: Block limits 1 - 16777215 bytes.

Aug 18 18:11:26 ka2er kernel: st0: Error with sense data: Current st09:00: sense key Medium Error

Aug 18 18:11:26 ka2er kernel: Additional sense indicates Sequential positioning error

```

----------

## olah

 *Quote:*   

> ka2er wrote
> 
> ```
> Aug 18 18:08:56 ka2er kernel: ncr53c875-0-<1,*>: FAST-10 SCSI 10.0 MB/s (100 ns, offset 16)
> 
> ...

 

earlier you wrote your 

```
mt -f /dev/st0 status
```

 and i recall that your tapedrive is using dds-3 tapes... could it be 1: your tape is a dds-2 or 2: your tapedrive is given the wrong mediacode like 0x24 is dds-2 and 0x25 is dds-3. Check mt if there is any flag for setting medium and check if you have the right media type (dds-2 dds-3 etcetera)

----------

## Jimboberella

Most DDS drives are backwards compatible so using a DDS2 tape in a DDS3 drive will still work (only up to the capacity of the DDS2 tape of course)

IIRC the media sense error indicates a bad tape

----------

## ews99

I'm using the HP DAT8 DDS-2 8/4GB tapedrive (scsi) and it works fine using tar for my backups.

But, how do I check how much space is left on the tape after I ran a backup? And how do I check how strong is the compression?

----------

