Phobos
February 14, 2005, 11:01pm
1
In reading Ralph's pervious post I came accross a question. Say you have two hard drives in your system. One is running Solaris 10 and the other is Linux on ext2 FS. Is it possible to mount the linux using Solaris and transfer files?
Thanks,
Robert
Neo
February 14, 2005, 11:05pm
2
(9.17) Will Linux programs run on Solaris 2/x86?
The Lxrun program, originally written for SCO, is now available on Solaris/x86. The Lxrun emulator allows one to execute Linux binaries, both in ELF and a.out Linux formats. Linux ext2 read-only filesystem support from Solaris (mount/unmount) is included with ext2fs.tar.gz.
To install, first install package SFWlxrun from the Solaris Software Companion CD. Setup or mount a ext2fs filesystem, say at /linux (as explained in a question below on ext2fs).
Reference: 9. Interoperability with Other Operating Systems (Solaris x86 FAQ)
(9.23) Can I access Linux (ext2fs) partitions from Solaris?
Yes. The Lxrun program (see the question elsewhere above on Lxrun) includes software for Linux ext2 read-only filesystem support from Solaris (mount/unmount) is in file ext2fs.tar.gz.
Obtain the ext2fs.tar.gz file for your version of Solaris. Note that this software is not supported and may contain bugs. Use at your own risk.
Solaris 10 ("Solaris Express" pre-release, 7/2004): ext2fs.solaris10.tar.gz,
Solaris 9: ext2fs.solaris9.tar.gz,
Solaris 8: ext2fs.solaris8.tar.gz,
Solaris 7: ext2fs.solaris7.tar.gz
Untar file "gzcat ext2fs*.tar.gz | tar xvf -", and either rebuild from source or use the prebuilt binaries (easiest).
Become root and install the files under directory ext2fs/i386. by running "./getext2fs" as root from the source directory downloaded above.
Install the man pages:
cp ext2fs.7fs /usr/share/man/man7fs
cp mount_ext2fs.1m /usr/share/man/man1m
Make your mount point. For example: "mkdir /linux"
Find your Linux partition and try and mount it. For SCSI, mount it similar to this:
/usr/sbin/mount -r -F ext2fs /dev/dsk/c0t0d0p1 /linux
For ATAPI, mount it similar to this (no "t0"):
/usr/sbin/mount -r -F ext2fs /dev/dsk/c0d0p1 /linux
"c0d0p1" indicates fdisk partition 1 (2nd partition) on disk 0 of ATAPI controller 0. See the question above on mounting DOS filesystems and the question below on decoding /dev/dsk/c* device names.
If you installed the ext2fs correctly and specified the correct partition, you should see something like this from mount, modinfo, and ls. (My linux partition is on the 2nd disk, 3rd partition.)
# mount | grep /linux
/linux on /dev/dsk/c0d1p2 read only/setuid/dev=1980052 on Sat Mar 31 14:57 2001
# modinfo | grep ext2fs
186 fe9688f1 5e98 19 1 ext2fs (Linux Second Extended Filesystem)
# ls /linux
bin etc lib proc sbin tmp
boot home lost+found root var usr
dev include mnt
Once you found and mounted the correct linux partition, add and add an entry to /etc/vfstab similar to one of the following. For SCSI, it might look like this:
/dev/dsk/c0t0d0p1 - /linux ext2fs - no ro
For ATAPI, it might look like this (no "t0"):
/dev/dsk/c0d0p1 - /linux ext2fs - no ro
(Use "yes" instead of "no" if you want it mounted automatically at boot).
Repeat for other linux filesystems, if desired.
Once you mount a ext2fs filesystem, you can execute Linux programs using lxrun (see the question on lxrun, above).
For further information, see the ext2fs(7fs) and mount_ext2fs(1m) man pages you installed above.
[Thanks to Pete Shanahan for the Solaris 10 port, Paul Floyd for the Solaris 9 port, and Mike Sullivan for the Solaris 8 port. Neither I nor they take any responsibility for errors with this software.]