Solaris only supports raw partitions vs. raw disk ?
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
Solaris only supports raw partitions vs. raw disk ?

 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Storage System
Author Message
Arne Joris
Guest





Posted: Fri Nov 19, 2004 9:57 pm    Post subject: Solaris only supports raw partitions vs. raw disk ? Reply with quote

I am looking for a way to use an entire scsi disk as a raw device.
Solaris 8 claims to support raw devices, but really it only seems to
support raw partitions : block 0 (the first 512 bytes) is reserved for
the disk label containing the partition table; there are no devices
corresponding to disks, only partitions.

Yes you can make a partition starting at block 0, but writing to block 0
causes all kinds of havoc since Solaris tries to read it and interpret
it as the partition table.

Is there a way to access an entire scsi disk without having a label
on it ? Could I "encapsulate" my disk by writing it's label in memory or
on another disk, so that I can still use my disk's block 0 ?

Thanks !

Arne Joris
Back to top
Don Khan
Guest





Posted: Sat Nov 20, 2004 6:05 am    Post subject: Re: Solaris only supports raw partitions vs. raw disk ? Reply with quote

"Arne Joris" <nospam@org.org> wrote in message
news:ZBpnd.276162$nl.155347@pd7tw3no...
Quote:
I am looking for a way to use an entire scsi disk as a raw device.
Solaris 8 claims to support raw devices, but really it only seems to
support raw partitions : block 0 (the first 512 bytes) is reserved for
the disk label containing the partition table; there are no devices
corresponding to disks, only partitions.

Yes you can make a partition starting at block 0, but writing to block 0
causes all kinds of havoc since Solaris tries to read it and interpret
it as the partition table.

Is there a way to access an entire scsi disk without having a label
on it ? Could I "encapsulate" my disk by writing it's label in memory or
on another disk, so that I can still use my disk's block 0 ?

Thanks !

Arne Joris


You do not have to have a disk label. If your application is writing to the
entire disk then it is assumed that your application knows what it is doing.
If you are using the entire disk then you do not need more than one
partition. Normally the s2 slice covers the entire partition. Writing over
block 0 is not a problem if your application is allowed to use the entire
disk.

You could also make a partition at block 1 to the end of the disk and use
that. Will one block really make a difference in your situation? Ideally
create the partition from cylinder 1 as some disks and arrays optimize IO on
cylinder boundaries.
Back to top
Maxim S. Shatskih
Guest





Posted: Sat Nov 20, 2004 6:17 pm    Post subject: Re: Solaris only supports raw partitions vs. raw disk ? Reply with quote

Quote:
create the partition from cylinder 1 as some disks and arrays optimize IO on
cylinder boundaries.

From what I know, the notion of "cylinder" is long ago fake for at least 10
years now.

Windows still carries this for backward compat with DOS legacy, but I'm
surprised that Solaris, being absolutely free from DOS legacy, still carries
this notion.

More so. Both Windows (2000) and Linux (kernel 2.2) - even these older
versions - work fine with deliberately wrong CHS values in the partition table.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
Back to top
Don Khan
Guest





Posted: Sun Nov 21, 2004 9:59 am    Post subject: Re: Solaris only supports raw partitions vs. raw disk ? Reply with quote

"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:cnng3g$ca0$1@antigua.mtu.ru...
Quote:
create the partition from cylinder 1 as some disks and arrays optimize IO
on
cylinder boundaries.

From what I know, the notion of "cylinder" is long ago fake for at least
10
years now.

Windows still carries this for backward compat with DOS legacy, but I'm
surprised that Solaris, being absolutely free from DOS legacy, still
carries
this notion.

More so. Both Windows (2000) and Linux (kernel 2.2) - even these older
versions - work fine with deliberately wrong CHS values in the partition
table.


I am not talking about the host IO pattern or the host's view of the disk
(CHS values). Some arrays, even enterprise arrays do their internal IO on
certain cylinder/track boundaries. This is a problem no matter what the
operating system. Some arrays tend to optimize IO if the IO is done on
boudaries of its internal track/cylinder sizes. The operating systems will
still work fine but performace can be impacted.
Back to top
Arne Joris
Guest





Posted: Mon Nov 22, 2004 10:14 pm    Post subject: Re: Solaris only supports raw partitions vs. raw disk ? Reply with quote

Don Khan <root@localhost.localdomain> wrote:
Quote:
You do not have to have a disk label. If your application is writing to the
entire disk then it is assumed that your application knows what it is doing.
If you are using the entire disk then you do not need more than one
partition. Normally the s2 slice covers the entire partition. Writing over
block 0 is not a problem if your application is allowed to use the entire
disk.

No if you write to block 0, you over-write the label and the device
refuses to do any more I/O :

sun189-bash-2.03# dd if=/dev/zero of=/dev/rdsk/c2t2d0s2 seek=0 count=1
bs=512
1+0 records in
1+0 records out

sun189-bash-2.03# dd if=/dev/zero of=/dev/rdsk/c2t2d0s2 seek=0 count=1
bs=512
dd: /dev/rdsk/c2t2d0s2: open: I/O erroro

dmesg
....
Nov 22 10:08:36 sun189 scsi: [ID 107833 kern.warning] WARNING:
/pci@1f,2000/QLGC,qla@1/sd@2,0 (sd32):
Nov 22 10:08:36 sun189 corrupt label - wrong magic number
sun189-bash-2.03#

Quote:
You could also make a partition at block 1 to the end of the disk and use
that. Will one block really make a difference in your situation? Ideally
create the partition from cylinder 1 as some disks and arrays optimize IO on
cylinder boundaries.

Yes that works ofcourse. But I'm trying to manipulate raw disk blocks
here and yes, I need to write to block 0. Imagine using Solaris to dump
a raw disk image (NOT solaris) onto a set of disks and then using normal
read and write commands from a user program to modify the image.

Arne Joris
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Storage System All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB