Monday May 02, 2005 On my laptop, I have a hibernation partition on P1, WinXP [ntfs] on P2, and Solaris Next on P3. Since Solaris cannot natively read an NTFS partition, I'd like to be able to read my files off of my WinXP partition without having to use something like a FAT32 partition to transfer data around. Since Knoppix can read an NTFS partition, I figured I should try and see if I can get to the data. It's a bit convoluted to do it this way, but it prevents having to reboot Solaris to get back to Windows XP so I can transfer some files. So I start qemu like this, still booting from the cdrom image, and assigning -hdd to be the primary Solaris fdisk partition /dev/rdsk/c0d0p0 on my laptop. Of course, unless you're running qemu as root, you won't have access to the physical partition as a user. We will setup access to the raw device for read only access by running the following command, as root, against the physical device's acl, for the user running qemu to access the NTFS partition.
$ su root
# getfacl `ls -l /dev/rdsk/c0d0p0 | sed 's,.* -> ../..,,'`
# file: /devices/pci@0,0/pci-ide@11,1/ide@0/cmdk@0,0:q,raw
# owner: root
# group: sys
user::rw-
group::r-- #effective:r--
mask:r--
other:---
# setfacl -m user:bent:r-- `ls -l /dev/rdsk/c0d0p0 | sed 's,.* -> ../..,,'`
# getfacl `ls -l /dev/rdsk/c0d0p0 | sed 's,.* -> ../..,,'`
# file: /devices/pci@0,0/pci-ide@11,1/ide@0/cmdk@0,0:q,raw
# owner: root
# group: sys
user::rw-
user:bent:r--
group::r-- #effective:r--
mask:r--
other:---
I use the -snapshot to prevent any writes from happening to the disk, just as a matter of caution, even
though I'm defining the boot device as -boot d. I do the following as the user which was given the acl read rights to the device:
/tmp/qemu/bin/qemu -cdrom /vol/dev/rdsk/c1t0d0/knoppix -user-net -enable-audio \
-pci -m 256 -k en-us -boot d -snapshot -hdd /dev/rdsk/c0d0p0
At the Knoppix boot prompt, I type:
boot: knoppix dma screen=1152x864
and wait for Knoppix to boot. If all goes well, you should see a couple of "Hard Disk" icons on the desktop,
and since Knoppix sets up the mount entries, the knoppix user (non-root) is allowed to mount the drive. Verify
that the partition that has the NTFS file system on it is listed in /etc/fstab in your Knoppix file system.
Then just use the mount command with the mount point that corresponds to the mountpoint in the /etc/fstab. In my
case, /dev/hdd2 is the location of the NTFS file system.
$ mount /dev/hdd2
If there are no errors in the mount, then you should be able to cd /mnt/hdd2 and see the NTFS file system
under Knoppix. There should be no problems because by default, Knoppix will mount the NTFS file system read only,
which is all you need to access the files so that you can copy them from NTFS to the Knoppix image, and then transfer
them out of the Knoppix virtual machine using ftp, scp, or samba (which I haven't figured out how to setup yet).
Using this configuration, is a perfect example of using a quick start configuration. It turns out that leaving the NTFS file system mounted in the QEMU Knoppix session caused the quick start to be something more like 60 seconds, rather than the 10 seconds I was seeing off a standard config. It also might have something to do with using the "-snapshot" option. I plan on doing some more testing.