From: Laurence Oberman <loberman@redhat.com>
To: dgilbert@interlog.com
Cc: "Kai Mäkisara (Kolumbus)" <kai.makisara@kolumbus.fi>,
"Shane M Seymour" <shane.seymour@hpe.com>,
"Emmanuel Florac" <eflorac@intellique.com>,
"Laurence Oberman" <oberman.l@gmail.com>,
linux-scsi@vger.kernel.org
Subject: Re: What partition should the MTMKPART argument specify? Was: Re: st driver doesn't seem to grok LTO partitioning
Date: Thu, 4 Feb 2016 14:25:04 -0500 (EST) [thread overview]
Message-ID: <412135332.11533655.1454613904617.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <56B393DA.2050307@interlog.com>
Kai's latest patch passes all my tests on the DAT DSS drive
Fails on the older LTO3 as it should. (un-partionable)
I don't have the new LTO5 yet, arrives end of week I am told.
Testing log
-----------
[root@srp-server ~]# uname -a
Linux srp-server 4.4.0 #1 SMP Thu Jan 28 15:06:45 EST 2016 x86_64 x86_64 x86_64 GNU/Linux
Storage Changer /dev/sg3:1 Drives, 6 Slots ( 0 Import/Export )
Data Transfer Element 0:Full (Storage Element 2 Loaded)
Storage Element 1:Full
Storage Element 2:Empty
Storage Element 3:Full
Storage Element 4:Full
Storage Element 5:Full
Storage Element 6:Empty
[root@srp-server home]# mtx -f /dev/sg3 unload 2 0
Unloading drive 0 into Storage Element 2...done
[root@srp-server home]# mtx -f /dev/sg3 load 3 0
Loading media from Storage Element 3 into drive 0...done
[root@srp-server home]# sg_map -st -i
/dev/sg2 /dev/nst0 HP DAT72X6 B409
/dev/sg3 HP DAT72X6 B409
[root@srp-server home]# mt -f /dev/st0 stsetoption can-partitions
[root@srp-server home]# mt -f /dev/st0 mkpartition 10000
Tape screen shows Format
Completed with no errors and I can set to a specific partition
Feb 04 13:42:27 srp-server kernel: st: Unloaded.
Feb 04 13:43:57 srp-server kernel: st: Version 20160203, fixed bufsize 32768, s/g segs 256
Feb 04 13:43:57 srp-server kernel: st: Debugging enabled debug_flag = 1
Feb 04 13:43:57 srp-server kernel: st 6:0:1:0: Attached scsi tape st0
Feb 04 13:43:57 srp-server kernel: st 6:0:1:0: st0: try direct i/o: yes (alignment 4 B)
Feb 04 13:48:30 srp-server kernel: st 6:0:1:0: [st0] Block limits 1 - 16777215 bytes.
Feb 04 13:48:30 srp-server kernel: st 6:0:1:0: [st0] Mode sense. Length 11, medium 0, WBS 10, BLL 8
Feb 04 13:48:30 srp-server kernel: st 6:0:1:0: [st0] Density 47, tape length: 0, drv buffer: 1
Feb 04 13:48:30 srp-server kernel: st 6:0:1:0: [st0] Block size: 0, buffer size: 4096 (1 blocks).
Feb 04 13:48:30 srp-server kernel: st 6:0:1:0: [st0] Updating partition number in status.
Feb 04 13:48:30 srp-server kernel: st 6:0:1:0: [st0] Got tape pos. blk 0 part 0.
Feb 04 13:48:30 srp-server kernel: st 6:0:1:0: [st0] Mode 0 options: buffer writes: 1, async writes: 1, read ahead: 1
Feb 04 13:48:30 srp-server kernel: st 6:0:1:0: [st0] can bsr: 1, two FMs: 0, fast mteom: 0, auto lock: 0,
Feb 04 13:48:30 srp-server kernel: st 6:0:1:0: [st0] defs for wr: 0, no block limits: 0, partitions: 1, s2 log: 0
Feb 04 13:48:30 srp-server kernel: st 6:0:1:0: [st0] sysv: 0 nowait: 0 sili: 0 nowait_filemark: 0
Feb 04 13:48:30 srp-server kernel: st 6:0:1:0: [st0] debugging: 1
Feb 04 13:48:30 srp-server kernel: st 6:0:1:0: [st0] Rewinding tape.
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] Block limits 1 - 16777215 bytes.
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] Mode sense. Length 11, medium 0, WBS 10, BLL 8
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] Density 47, tape length: 0, drv buffer: 1
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] Block size: 0, buffer size: 4096 (1 blocks).
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] Loading tape.
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] Error: 8000002, cmd: 0 0 0 0 0 0
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] Sense Key : Unit Attention [current]
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] Add. Sense: Not ready to ready change, medium may have changed
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] Block limits 1 - 16777215 bytes.
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] Mode sense. Length 11, medium 0, WBS 10, BLL 8
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] Density 47, tape length: 0, drv buffer: 1
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] Block size: 0, buffer size: 4096 (1 blocks).
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] Partition page length is 10 bytes.
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] PP: max 1, add 0, xdp 0, psum 02, pofmetc 0, rec 03, units 00, sizes: 0 65535
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] MP: 11 08 01 00 10 03 00 00 00 00 ff ff
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] psd_cnt 1, max.parts 1, nbr_parts 0
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] Formatting tape with two partitions (1 = 10000 MB).
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] Sent partition page length is 10 bytes. needs_format: 0
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] PP: max 1, add 1, xdp 1, psum 02, pofmetc 0, rec 03, units 00, sizes: 10000 65535
Feb 04 13:48:42 srp-server kernel: st 6:0:1:0: [st0] MP: 11 08 01 01 30 03 00 00 27 10 ff ff
Tested-by: Laurence Oberman <loberman@redhat.com>
Laurence Oberman
Principal Software Maintenance Engineer
Red Hat Global Support Services
Laurence Oberman
Principal Software Maintenance Engineer
Red Hat Global Support Services
----- Original Message -----
From: "Douglas Gilbert" <dgilbert@interlog.com>
To: "Kai Mäkisara (Kolumbus)" <kai.makisara@kolumbus.fi>, "Shane M Seymour" <shane.seymour@hpe.com>
Cc: "Laurence Oberman" <loberman@redhat.com>, "Emmanuel Florac" <eflorac@intellique.com>, "Laurence Oberman" <oberman.l@gmail.com>, linux-scsi@vger.kernel.org
Sent: Thursday, February 4, 2016 1:09:30 PM
Subject: Re: What partition should the MTMKPART argument specify? Was: Re: st driver doesn't seem to grok LTO partitioning
Hi,
With a HP Ultrium 3000 tape drive (LTO-5) and a HP C7975A
tape cartridge (LTO-5 and partition capable) and mt as
patched by Shane:
# lsscsi -g
[1:0:0:0] disk ATA ST3320620AS K /dev/sda /dev/sg0
[6:0:0:0] tape HP Ultrium 5-SCSI Z64D /dev/st0 /dev/sg1
# sg_read_attr -s 3 /dev/sg1
Partition number list:
First partition number: 0
Number of partitions available: 1
# mt -f /dev/st0 stsetoption debug
# mt -f /dev/st0 stsetoption can-partitions
# mt -f /dev/st0 mkpartition 10000
The following was cut and pasted from /var/log/messages
st 6:0:0:0: [st0] Block limits 1 - 16777215 bytes.
[st0] Mode sense. Length 11, medium 0, WBS 10, BLL 8
[st0] Density 58, tape length: 0, drv buffer: 1
[st0] Block size: 0, buffer size: 4096 (1 blocks).
[st0] Updating partition number in status.
[st0] Got tape pos. blk 0 part 0.
[st0] Loading tape.
[st0] Block limits 1 - 16777215 bytes.
[st0] Mode sense. Length 11, medium 0, WBS 10, BLL 8
[st0] Density 58, tape length: 0, drv buffer: 1
[st0] Block size: 0, buffer size: 4096 (1 blocks).
[st0] Partition page length is 12 bytes.
[st0] PP: max 1, add 0, xdp 1, psum 03, pofmetc 4, rec 03, units 09, sizes: 1529 0
[st0] MP: 11 0a 01 00 3c 03 09 00 05 f9 00 00
[st0] psd_cnt 2, max.parts 1, nbr_parts 0
[st0] Formatting tape with two partitions (1 = 10000 MB).
[st0] Sent partition page length is 12 bytes. needs_format: 1
[st0] PP: max 1, add 1, xdp 1, psum 03, pofmetc 4, rec 03, units 09, sizes: 65535 10
[st0] MP: 11 0a 01 01 3c 03 09 00 ff ff 00 0a
[st0] Sending FORMAT MEDIUM
[st0] Rewinding tape.
# sg_read_attr -s 3 /dev/sg1
Partition number list:
First partition number: 0
Number of partitions available: 2
Looks good.
Tested-by: Douglas Gilbert <dgilbert@interlog.com>
On 16-02-04 12:54 PM, "Kai Mäkisara (Kolumbus)" wrote:
>
>> On 4.2.2016, at 3.43, Seymour, Shane M <shane.seymour@hpe.com> wrote:
>>
>> Hi Kai,
>>
>> Tested with patched kernel 4.5.0-rc2-next-20160202+. It's looking good everything partition related passed with DDS5 and LTO6. You can definitely add me as a tested-by. I did find one issue below but it's not related to the partitioning changes.
>>
> Thanks for testing. It would be interesting to get confirmation from a LTO-5 user that partitioning
> works. Even without that I will make the final patch within a few days (remove some debugging
> and update the documentation).
>
> ...
>> I did find one issue in testing unrelated to the changes, the tell option didn't work with my LTO-6 drive:
>>
>> # ./mt -f /dev/st0 tell
>> /dev/st0: Input/output error
>>
>> [ 2045.974642] st 3:0:0:0: [st0] Block limits 1 - 16777215 bytes.
>> [ 2045.975221] st 3:0:0:0: [st0] Mode sense. Length 11, medium 0, WBS 10, BLL 8
>> [ 2045.975224] st 3:0:0:0: [st0] Density 5a, tape length: 0, drv buffer: 1
>> [ 2045.975226] st 3:0:0:0: [st0] Block size: 0, buffer size: 4096 (1 blocks).
>> [ 2045.975718] st 3:0:0:0: [st0] Error: 8000002, cmd: 34 1 0 0 0 0
>> [ 2045.975723] st 3:0:0:0: [st0] Sense Key : Illegal Request [current]
>> [ 2045.975726] st 3:0:0:0: [st0] Add. Sense: Invalid field in cdb
>> [ 2045.975729] st 3:0:0:0: [st0] Can't read tape position.
>> [ 2045.975857] st 3:0:0:0: [st0] Rewinding tape.
>>
>> I believe that in get_location() we're doing this:
>>
>> static int get_location(struct scsi_tape *STp, unsigned int *block, int *partition,
>> int logical)
>> {
>> int result;
>> unsigned char scmd[MAX_COMMAND_SIZE];
>> struct st_request *SRpnt;
>>
>> if (STp->ready != ST_READY)
>> return (-EIO);
>>
>> memset(scmd, 0, MAX_COMMAND_SIZE);
>> if ((STp->device)->scsi_level < SCSI_2) {
>> scmd[0] = QFA_REQUEST_BLOCK;
>> scmd[4] = 3;
>> } else {
>> scmd[0] = READ_POSITION;
>> if (!logical && !STp->scsi2_logical)
>> scmd[1] = 1; <<<<<<<<<<<<<<
>> }
>>
>> When called from the ioctl that the tell option uses the variable logical is passed in as 0 (from what I could see everything else sets it to 1). For a READ_POSITION the drive I'm using only supports 0, 6, or 8 in the service action field of the second byte:
>>
> I think you have not set the scsi2_logical option bit with mt or stinit or some other tool.
> The default of device-specific addresses is a historical mistake but we have to live with
> it. I don’t see this as a big problem because any user of current drives should enable
> some driver options anyway.
>
> Thanks,
> Kai
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-02-04 19:25 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20151218170644.24167419@harpe.intellique.com>
2015-12-21 12:46 ` st driver doesn't seem to grok LTO partitioning Emmanuel Florac
2015-12-21 17:25 ` "Kai Mäkisara (Kolumbus)"
[not found] ` <20151221185759.38dd21d6@harpe.intellique.com>
2015-12-21 18:57 ` "Kai Mäkisara (Kolumbus)"
2015-12-22 5:51 ` Seymour, Shane M
2015-12-22 9:59 ` Emmanuel Florac
[not found] ` <CAAzz28i5=oz_BmcoEC2ApLN9zj_F4aDmGkCXkXaS48HR_Ockew@mail.gmail.com>
2015-12-22 10:04 ` Emmanuel Florac
2015-12-22 10:31 ` Laurence Oberman
2015-12-25 15:53 ` Kai Makisara
2015-12-25 17:47 ` Emmanuel Florac
2015-12-29 16:14 ` Emmanuel Florac
2015-12-29 16:58 ` Emmanuel Florac
2015-12-29 17:46 ` "Kai Mäkisara (Kolumbus)"
2015-12-29 17:58 ` Emmanuel Florac
[not found] ` <20151229191347.2e0e5f0e@harpe.intellique.com>
2015-12-30 17:54 ` Kai Makisara
2015-12-30 18:33 ` Emmanuel Florac
2015-12-30 19:21 ` "Kai Mäkisara (Kolumbus)"
2015-12-30 21:24 ` Emmanuel Florac
2015-12-31 16:08 ` "Kai Mäkisara (Kolumbus)"
2016-01-04 10:22 ` Kai Makisara
2016-01-04 10:54 ` Emmanuel Florac
2016-01-04 11:05 ` Emmanuel Florac
2016-01-04 11:46 ` Emmanuel Florac
[not found] ` <CAAzz28gW69rB-6h2fwxtwnTj5h7HZcn2qkJdx2GTgu3Y8SDNqQ@mail.gmail.com>
2016-01-04 15:32 ` Emmanuel Florac
[not found] ` <CAAzz28iCoG-rjnL7EsjHXA7UtRJSCEXuwL3+27ZBo7fckcBAfg@mail.gmail.com>
2016-01-05 21:55 ` Laurence Oberman
2016-01-06 15:10 ` Emmanuel Florac
2016-01-06 15:23 ` Laurence Oberman
2016-01-06 15:25 ` Laurence Oberman
2016-01-06 15:32 ` Laurence Oberman
2016-01-06 15:48 ` Douglas Gilbert
2016-01-06 15:54 ` Laurence Oberman
2016-01-06 16:07 ` Emmanuel Florac
2016-01-14 20:12 ` Laurence Oberman
2016-01-15 0:21 ` Seymour, Shane M
2016-01-21 20:58 ` What partition should the MTMKPART argument specify? Was: " "Kai Mäkisara (Kolumbus)"
2016-01-21 22:06 ` Laurence Oberman
2016-01-22 2:10 ` Seymour, Shane M
2016-01-22 3:31 ` Seymour, Shane M
2016-01-22 11:24 ` Emmanuel Florac
2016-01-22 11:50 ` Emmanuel Florac
2016-01-26 23:35 ` Seymour, Shane M
2016-01-28 17:31 ` "Kai Mäkisara (Kolumbus)"
2016-01-28 17:39 ` Emmanuel Florac
2016-01-24 21:05 ` Kai Makisara
2016-01-25 10:21 ` Emmanuel Florac
2016-01-28 7:36 ` Seymour, Shane M
2016-01-28 17:04 ` "Kai Mäkisara (Kolumbus)"
2016-01-28 19:21 ` Laurence Oberman
2016-01-28 19:56 ` "Kai Mäkisara (Kolumbus)"
2016-01-28 23:12 ` Seymour, Shane M
2016-01-28 23:23 ` Laurence Oberman
2016-01-28 23:25 ` Laurence Oberman
2016-01-29 0:54 ` Seymour, Shane M
2016-01-29 17:22 ` Kai Makisara
2016-02-01 6:31 ` Seymour, Shane M
2016-02-01 18:43 ` "Kai Mäkisara (Kolumbus)"
2016-02-01 19:02 ` Laurence Oberman
2016-02-01 22:59 ` Seymour, Shane M
2016-02-03 3:40 ` Laurence Oberman
2016-02-03 2:18 ` Seymour, Shane M
2016-02-03 18:36 ` Kai Makisara
2016-02-04 1:43 ` Seymour, Shane M
2016-02-04 17:54 ` "Kai Mäkisara (Kolumbus)"
2016-02-04 18:09 ` Douglas Gilbert
2016-02-04 19:25 ` Laurence Oberman [this message]
2016-02-04 18:12 ` Emmanuel Florac
2016-01-15 11:48 ` Emmanuel Florac
2016-01-22 10:17 ` Douglas Gilbert
2016-01-06 16:10 ` Emmanuel Florac
2016-01-06 16:16 ` Emmanuel Florac
2016-01-06 16:44 ` Emmanuel Florac
2015-12-29 16:59 ` Emmanuel Florac
2015-12-29 17:18 ` "Kai Mäkisara (Kolumbus)"
[not found] ` <CAAzz28gn2zwC5ZUTtPupDOTHekGspWh0vnWHV+jvbx52c=cq2Q@mail.gmail.com>
2015-12-21 17:49 ` Emmanuel Florac
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=412135332.11533655.1454613904617.JavaMail.zimbra@redhat.com \
--to=loberman@redhat.com \
--cc=dgilbert@interlog.com \
--cc=eflorac@intellique.com \
--cc=kai.makisara@kolumbus.fi \
--cc=linux-scsi@vger.kernel.org \
--cc=oberman.l@gmail.com \
--cc=shane.seymour@hpe.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).