The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > SUN Solaris
Google UNIX.COM


SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
big disk solaris 2.6 malcqv SUN Solaris 13 06-30-2008 04:14 AM
Disk Mirroring for Solaris 10 x86 chuck43 SUN Solaris 2 01-30-2008 06:19 AM
Reading Data from Disk taordw SCO 2 07-25-2007 08:07 PM
Disk Mirror in Solaris 9 via Solaris Volume Manager deal732 SUN Solaris 3 05-02-2007 08:43 AM
reading from usb to sun solaris Anant SUN Solaris 1 11-11-2005 07:21 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-31-2007
Registered User
 

Join Date: Jul 2007
Posts: 15
Reading raw disk on Solaris

Hello

I wonder if someone could help me in reading a raw (non-Solaris) disk on a Solaris system...

I have an IDE HDD in my Sun Blade and would like to read it (using C). It appears on the system and with the format command shows up as c0t1d0.

I use the dd command to read the disk as such:

rhino# dd if=/dev/dsk/c0t1d0s0 bs=1 skip=0 count=1024
dd: /dev/dsk/c0t1d0s0: open: I/O error
rhino# dd if=/dev/dsk/c0t1d0s2 bs=1 skip=0 count=1024
dd: /dev/dsk/c0t1d0s2: open: I/O error

but as you can see I get an error.

How do I read a raw, unformatted, non-Solaris disk in my Solaris box?

Any ideas appreciated...
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-31-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
try "/dev/rdsk/c0t1d0s0"?

There are two forms of disk devices, block and raw.
Reply With Quote
  #3 (permalink)  
Old 07-31-2007
Registered User
 

Join Date: Jul 2007
Posts: 15
Quote:
Originally Posted by porter View Post
try "/dev/rdsk/c0t1d0s0"?

There are two forms of disk devices, block and raw.
Sorry forgot to say I tried that as well, and no, that doesn't work either.
Reply With Quote
  #4 (permalink)  
Old 07-31-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Try a block size (bs) that matches the drives block size. With a disk it should be multiples of 512.
Reply With Quote
  #5 (permalink)  
Old 07-31-2007
Registered User
 

Join Date: Jul 2007
Posts: 15
I haven't tried it, but the point is that it is a raw disk - i.e. FS unknown... so things such as 'blocksize' does not exist or unknown...

I just need to open the device... in a C program... like in Linux the HDD devices are /dev/sda, /dev/hda, etc...
Reply With Quote
  #6 (permalink)  
Old 07-31-2007
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,502
Quote:
Originally Posted by son_t View Post
Hello

I wonder if someone could help me in reading a raw (non-Solaris) disk on a Solaris system...

I have an IDE HDD in my Sun Blade and would like to read it (using C). It appears on the system and with the format command shows up as c0t1d0.

I use the dd command to read the disk as such:

rhino# dd if=/dev/dsk/c0t1d0s0 bs=1 skip=0 count=1024
dd: /dev/dsk/c0t1d0s0: open: I/O error
rhino# dd if=/dev/dsk/c0t1d0s2 bs=1 skip=0 count=1024
dd: /dev/dsk/c0t1d0s2: open: I/O error

but as you can see I get an error.

How do I read a raw, unformatted, non-Solaris disk in my Solaris box?

Any ideas appreciated...
If you are on a sparc box and you want to read a disk you use the backup slice (s2) - this is as opposed to a raw slice.

Also you need to be root to do this.
Reply With Quote
  #7 (permalink)  
Old 07-31-2007
Registered User
 

Join Date: Jul 2007
Posts: 15
Yup (from above) doing this:

rhino# dd if=/dev/dsk/c0t1d0s0 bs=1 skip=0 count=1024
dd: /dev/dsk/c0t1d0s0: open: I/O error
rhino# dd if=/dev/dsk/c0t1d0s2 bs=1 skip=0 count=1024
dd: /dev/dsk/c0t1d0s2: open: I/O error


The same with /dev/rdsk result in the same error, and yes I am root...
Reply With Quote
Google UNIX.COM
Reply

Tags
linux, solaris

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0