How to Access a Solaris Partition From Windows or Linux

Version 2 by kperkins
on May 05, 2008 08:36.

compared with
Current by bnsmb
on Nov 08, 2009 05:14.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (35)

View page history
!http://www.sun.com/bigadmin/home/images/bigadminHeaderWikiThumb.jpg!
{section:border=true} {section:border=false}
{column:width=20%}

{column}
 
{column:width=55%}

h1. How to access a Solaris partition from Windows or Linux
by Bernd Schemmer, Last Update: December 2008

Homepage: [http://www.bnsmb.de/|http://www.bnsmb.de/]

*Table of contents*
{toc}

h1. Overview
This article discusses a method to read and write data from Solaris partitions from within Windows or Linux.
[http://www.milax.org/?page_id=9]
unpack the Qemu archive (there's no installation neccessary for Qemu), copy the Milax ISO image, milax03.iso, to the directory with Qemu and start a Virtual machine for Milax with the command\\
{code} \\
cd {code}cd <directory_with_the_qemu_binary>

qemu.exe -L ".\bios" -m 256 -localtime -boot d -cdrom ./milax03.iso -hda \\\\.\\physicaldrive0 -net user -net nic,model=rtl8139 -redir tcp:1135::22 -name "Milax_(ssh_port:_1135)" -snapshot

{code}{*}Notes:*
*Notes:*

The parameter "-snapshot" means "write to temporary files instead of disk image files". That means that Qemu does NOT write to the harddisk. If you want to write your changes to the harddisk to can switch to the Qemu CLI with the key combination ctrl-alt-2 and issue the Qemu command "commit ide0-hd0" any time you like (see the Qemu documentation for details). To switch back to the Virtual Machine use the key combination ctrl-alt-1. You should NEVER use Qemu with access to real harddisks WITHOUT the parameter \-snapshot\!
You must use a double backslash for a backslash for Qemu 0.9.1
The number in the parameter "\\\\.
\\
The number in the parameter "\\\\.\\physicaldrive0" physicaldrive0" specifies the disk to use - if Solaris is not on the first harddisk replace 0 with the approbiate number.

This syntax works on Windows XP (tested) and should work Windows 2000 also. There are messages in the Qemu forum that this syntax does not work in Vista - I can not check this because I do not have Vista.

To access the Virtual Machine from your Windows host use
{code}ssh -l alex -p 1135 localhost
{code}or with scp
{code}scp -p 1135 alex@localhost:/etc/release .
{code}{*}Notes:*
ssh -l alex -p 1135 localhost
{code}
or with scp
{code}
scp -p 1135 alex@localhost:/etc/release .
{code}
*Notes:*

I've only tested this with Qemu 0.9.1 - this may or may not work with older Qemu Versions.

Use dmesg to list the device names for the Solaris slices:
{code}
{code}root@tp61p:~# dmesg | grep sda

[ 23.652384] sd 2:0:0:0: [sda] 312581808 512-byte hardware sectors (160042 MB)

root@tp61p:~#
{code}
{code}In this example the slices on the Solaris partition can be accessed by the Linux device names
{noformat}
{noformat}Slice Linux device name

--------------------------------------------

s7 sda14
{noformat}
{noformat}There's no Linux device for the slice 5 here because this slice is not used in Solaris (the size of the slice is 0)
 
To mount the slice use:\\ \\ \\
{code} \\
\\
\\
{code}root@tp61p:~# mount -t ufs -o ro /dev/sda8 /mnt
root@tp61p:~# df -k /mnt
cdrom etc media mnt1 opt sol10hvm.save var
data export milax mnt2 platform system xen
{code}\\ \\
\\

If you need write access to the Solaris slices (and your Linux distribution does not support write access for UFS) or if you're using ZFS under Solaris you can start Qemu in Linux to access the data on the Solaris partition:
{code}
{code}qemu -net user -net nic -usb -usbdevice tablet -L "/usr/local/share/qemu" -boot d \

-m 512 -net nic,model=rtl8139 -redir tcp:1135::22 \

-hda /dev/sda -cdrom ./milax03.iso -snapshot
{code}{*}Notes*
*Notes*

/dev/sda is the disk (not the partition\!) with the Solaris partition
The parameter "-snapshot" means "write to temporary files instead of disk image files". That means that Qemu does NOT write to the harddisk. If you want to write your changes to the harddisk to can switch to the Qemu CLI with the key combination ctrl-alt-2 and issue the Qemu command "commit ide0-hd0" any time you like (see the Qemu documentation for details). To switch back to the Virtual Machine use the key combination ctrl-alt-1. You should NEVER use Qemu with access to real harddisks WITHOUT the parameter \-snapshot\!\\
\\
 
{column}
 
{column}
{column:width=25%}

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact