fsck entire hard drive?

ho do you check filesystem on entire hard disk?

how is your layout? what kind of filesystem? what is "df -k" output?

well the whole story is long and offtopic. but here goes; we have this SPARC computer running Solaris10. it has been running for several years 24/7 with no RAID or backup.
so we made dd image of whole 72Gb hdd. now we wish to test the image, check filesystem integrity.
first try is loopback mount in linux. but that showed only first partition and some errors.
next, converted it to .vdi and tried FreeBSD and Solaris(x86) in virtualbox.
.vdi file is a lot smaller (about 20Gb, probably due to being dynamic and hdd mostly empty)
Solaris needed devfsadm to register the image as second hdd, but after that it could not see partition table at all.

how to test it?

How did you create the dd image ?
UFS isn't compatible between SPARC and x86 because of big vs little endian hardcoded drivers as far as Solaris is concerned.
Moreover, a SPARC is laying out its slices directly on the whole disk while on x86, a dedicated primary partition is used instead.

we took the hdd out and connected it to SCSI card on Linux PC.
there must be a way to check it on PC. If I split the file into slices, perhaps Linux can loopmount other SPARC partitions?
but still need some way to fsck it.
are you implying that no OS in virtualbox could handle SPARC partitiontable?

You would have to extract the vtoc fields and compute the slice offset, that's indeed doable but not straightforward.

Why do you want to fsck it ?

Solaris won't but Linux might be able to access the partition table (precisely vtoc) and then the file systems but your experience shows it doesn't works well. I strongly doubt FreeBSD, which uses a different UFS format, has any Solaris UFS support.

The easiest way to check out the contents of the disk is simply to put it into another SPARC box as a non-boot disk.

Anything else is pretty much impossible. Solaris x86 won't read the VTOC, nor do I think there's any Linux support for reading SPARC VTOCs.

There is support for reading SPARC VTOCs in Linux. It is in the kernel source file /fs/partitions/sun.c

As exists Linux version for SPARC, it must be supported.
Question is if it is supported in case of x86, maybe it is possible the only witch SPARC version of kernel.
Not sure, just suggestion.

This code is used in both SPARC and x86 builds and is handling endianness (be_16to_cpu Linux/fs/partitions/sun.c ). As I wrote, I didn't tested it but reading the code, I see no reason for it not to work on x86, especially as it has been there for more than 15 years.