[geeks] Raw disk access under Solaris

JP Hindin jplist2008 at kiwigeek.com
Thu Sep 15 11:28:37 CDT 2016


On Tue, 13 Sep 2016, Michael-John Turner wrote:
> On Tue, Sep 06, 2016 at 09:59:38AM -0500, JP Hindin wrote:
>> The disk is from a Cray J90, it is very, very definitely not partitioned in
>> any way that Solaris is going to understand - that being said, it's just a
>> string of bytes from one end of the drive to the other, partition maps are
>> irrelevant to the data that's on the disk. Under Linux I'd just do a 'dd
>> if=/dev/sdc ...' and all would be well.
>
> Hmm, do Crays use non-512-byte sector drives? I've never encountered one
> before so don't know, but a lot of "esoteric" systems use unusual sector
> sizes (eg, AS/400s, various storage arrays, etc - 520 byte sectors are not
> uncommon).
>
> Perhaps try booting NetBSD/OpenBSD from CD on your U2 and see if they
> identify the drive sector size (they should both say).


So I'm back in business thanks to a $50 U2 PSU from a company in Minnesota 
(free shipping and it still showed up in less than 24 hours, what a 
score).

My understanding is the blocksize of the filesystem is irrelevant - I'm 
doing a raw copy (or, rather, I'm _attempting_) and effectively all I'm 
asking is for the disk to feed the bytes directly from sector 0 right 
through until the last sector.

I had another run at it yesterday evening. Whenever I attempt to dd I get 
"Bad magic number in disk label"
I/O Error

This is while attempting:
dd if=/dev/dsk/c2t0d0sX of=./test.img bs=1024 count=64

I tried talking "directly" to the disk with /dev/dsk/c2t0d0, but this 
produces a 'file not found' error, since the device itself doesn't exist 
in /dev/dsk/.

So I tried looking at format. At this point there's a diversion into the 
/devices/ tree...
I'm running this from memory, so the path won't be exact, but it looks 
like this:
/devices/sbus at 1f,0/QLGC,isp at 3,10000/sd1,0:a
/devices/sbus at 1f,0/QLGC,isp at 3,10000/sd1,0:a,raw
/devices/sbus at 1f,0/QLGC,isp at 3,10000/sd1,0:b
/devices/sbus at 1f,0/QLGC,isp at 3,10000/sd1,0:b,raw
etc

Now, /dev/dsk/c2t0d0s0 actually is a symlink to the above sd1,0:a, and 
/dev/rdsk/ points to sd1,0:a,raw. Which is clever.

So as I was saying, _format_ uses: 
/devices/sbus at 1f,0/QLGC,isp at 3,10000/sd1,0

Great, raw disk, no partitions? Eeeeexcept this doesn't exist. And 
attempting to address it doesn't cause it to magically spawn out of 
nowhere. There's no such 'master' device for any of the system disks, so I 
can't clone a maj/min ID pair and try and create it. So I still have no 
idea how on earth 'format' does its magic.

I feel like it's just outside my grasp.

Thanks for all the suggestions so far, at any rate. They're appreciated.

  - JP


More information about the geeks mailing list