Can I access Solaris/x86 partitions from Linux?

Can I access Solaris/x86 partitions from Linux?

Yes. Read-only access is available. You need to have Linux 2.1.x or
greater. To see if your Linux kernel recognizes Solaris partitions,
type the following on Linux:
dmesg | grep solaris


You should get something like this:


hda: hda1 hda2 <solaris: [s0] hda5 [s1] hda6 [s2] hda7 [s3] hda8
[s5] hda9 [s6] hda10 [s7] hda11 >


This says that Solaris lives in the 2nd partition (hda2), slices 0 to 7.
These Solaris slices are mapped to virtual partitions hda5 to hda11.


To mount a partition, type something like this:


mount -r -t ufs -o ro,ufstype=sunx86 /dev/hda5 /mnt


This will mount the root slice (s0) on /mnt read-only.


Warning: Softlinks that are relative to root
(e.g., /usr/local pointing to /local)
will point to the wrong place.
To avoid this problem, change these links in
Solaris to relative soft-links (e.g., /usr/local to ../local).


This can be automated with /etc/fstab.
If you don't want the partitions mounted at boot, add ",noauto"
after "defaults,ro" (no space). If you want non-root users to be able
to mount partitions, add ",user" (careful!):



# /etc/fstab
# . . .
#Device Mount FS Fsck Mount at
#to mount point type Options pass boot # Slice
/dev/hda5 /solaris ufs defaults,ro,ufstype=sun 0 0 # s0
/dev/hda8 /solaris/var ufs defaults,ro,ufstype=sun 0 0 # s6
/dev/hda9 /solaris/opt ufs defaults,ro,ufstype=sun 0 0 # s3
/dev/hda10 /solaris/usr ufs defaults,ro,ufstype=sun 0 0 # s5
/dev/hda11 /solaris/export/home ufs defaults,ro,ufstype=sun 0 0 # s7
# Note: slice s2, by convention, indicates the whole disk


If, when you type "dmesg" above, you don't see Solaris partitions
recognized, you might have to rebuild your Linux kernel. Be sure
to specify "y" in /usr/src/linux/.config when you type "make config":


CONFIG_UFS_FS=y
CONFIG_SOLARIS_x86_PARTITION=y


Linux 2.2 has experimental write support to Solaris partitions.
If you get this message when mounting in read-write mode:
"... ufs_read_super: fs needs fsck"

then UFS function ufs_read_super somehow decided the fs isn't clean,
and therefore set the RDONLY bit.
Type something like this to re-mount in read/write mode
(replace "hda5" with your file system):


mount -o remount,rw /dev/hda5



There's another linux kernel configuration question,
CONFIG_SMD_DISKLABEL, that applies only to
Sparc Solaris disks, which are in yet another format.
The answer to that question doesn't matter for Solaris/x86 filesystems.





Home
FAQ