From: Henry N. <Hen...@Ar...> - 2008-05-18 21:24:29
|
Hello Harald, Harald Weidner wrote: > How can logical hard disk partitions be accessed within a colinux > environment? Logical disk can access. But I have never used LVM there. > The hard disk partition is like: > > Disk /dev/hda: 400.0 GB, 400088457216 bytes > 255 heads, 63 sectors/track, 48641 cylinders > Units = cylinders of 16065 * 512 = 8225280 bytes > > Device Boot Start End Blocks Id System > /dev/hda1 * 1 5099 40957686 7 HPFS/NTFS > /dev/hda2 5100 20397 122881185 7 HPFS/NTFS > /dev/hda3 20398 21856 11719417+ 83 Linux > /dev/hda4 21857 48641 215150512+ 5 Extended > /dev/hda5 21857 28543 53713296 8e Linux LVM > /dev/hda6 28544 35230 53713296 8e Linux LVM > /dev/hda7 35231 41917 53713296 8e Linux LVM > /dev/hda8 41918 48641 54010498+ 8e Linux LVM > > hda1 and hda2 are Windows XP Home C: and D: . > hda3 is the root partition of a Linux installation (Debian 4.0). > hda5 contains an LV group with LVs for swap and /home. > > I use the coLinux Snapshot 20080425 with the kernel and modules > version 2.6.22.18-co-0.8.0 as provided by Henry Nestler. The basic > configuration is not special: > > mem=256 > kernel=vmlinux > root=/dev/cobd0 ro > cobd0=d:\coLinux\system.img > eth0=pcap-bridge,"LAN-Verbindung" > > system.img contains a minimal Debian 4.0 installation. > > When trying to access the linux partitions under colinux like: > > cobd1=\Device\Harddisk0\Partition3 > cobd2=\Device\Harddisk0\Partition4 > cobd3=\Device\Harddisk0\Partition5 > cobd4=\Device\Harddisk0\Partition6 > cobd5=\Device\Harddisk0\Partition7 > > only the primary partition 3 (cobd1) is effectively visible under coLinux. > The logical partitions cannot be accessed: > > colinux:~# cat /dev/cobd2 > cat: /dev/cobd2: No such device > colinux:~# ls -l /dev/cobd2 > brw-rw---- 1 root disk 117, 2 May 18 01:13 /dev/cobd2 cat on a partition is not good idea. Perhaps you can access this by reading block size only with "dd if=/dev/cobd2 bs=512 count=1" ? If not, run the coLinux debugger to see more about problems an the windows detailed error message. Run the debugger: colinux-debug-daemon.exe -d -p -s prints=31,misc=31 -f debug.xml Than try to read one block. Stop the debugger. Open the file debug.xml with IE or notepad. Typicaly at the end you should see the error from block device read and the Windows internal error code. > According to the output of "dd --list" under Windows, > [see http://uranus.it.swin.edu.au/~jn/linux/rawwrite/dd.htm ] > the partitions should well exist: > > [...] > \\?\Device\Harddisk0\Partition0 > link to \\?\Device\Harddisk0\DR0 > Fixed hard disk media. Block size = 512 > size is 400088457216 bytes > \\?\Device\Harddisk0\Partition1 > link to \\?\Device\HarddiskVolume1 > \\?\Device\Harddisk0\Partition2 > link to \\?\Device\HarddiskVolume2 > \\?\Device\Harddisk0\Partition3 > link to \\?\Device\HarddiskVolume3 > Fixed hard disk media. Block size = 512 > size is 12000683520 bytes > \\?\Device\Harddisk0\Partition4 > link to \\?\Device\HarddiskVolume4 > size is 55002415104 bytes > \\?\Device\Harddisk0\Partition5 > link to \\?\Device\HarddiskVolume5 > size is 55002415104 bytes > \\?\Device\Harddisk0\Partition6 > link to \\?\Device\HarddiskVolume6 > size is 55002415104 bytes > \\?\Device\Harddisk0\Partition7 > link to \\?\Device\HarddiskVolume7 > size is 55306750464 bytes > [...] That's a strong result. In normal case, all Linux Partition have a line "Fixed hard disk media. Block size = 512" Is that normal for LVM, that they don't have? I don't know. >From the "size is" I would say from \Device\HarddiskVolume4 to \Device\HarddiskVolume7 is your LVM array for hda5 to hda8. Your config was ok. YOu can writ also the short form: hda3=\Device\Harddisk0\Partition3 hda5=\Device\Harddisk0\Partition4 hda6=\Device\Harddisk0\Partition5 hda7=\Device\Harddisk0\Partition6 hda8=\Device\Harddisk0\Partition7 Remember: The Extended Partition /dev/hda4 you can never see under Windows and is not countered. > Is there a way to access the partitions under coLinux? > > > I also tried to access the whole hard disk under coLinux: > > cobd1=\Device\Harddisk0\Partition0 > alias hda=:cobd1 > > The entire hard disk seems to be visible under coLinux now. > fdisk -l , or partprobe -d -s work fine: > > colinux:~# partprobe -d -s > /dev/hda: msdos partitions 1 2 3 4 <5 6 7 8> > /dev/cobd1: msdos partitions 1 2 3 4 <5 6 7 8> > > However, the partitions themselves are not present. Even partprobe is not > able to communicate the partitions to the kernel: > > debian:~# partprobe -s > Error: Error informing the kernel about modifications to partition /dev/hda1 -- Invalid argument. This means Linux won't know about any changes you made to /dev/hda1 until you reboot -- so you shouldn't mount it or use it in any way before rebooting. > Error: Error informing the kernel about modifications to partition /dev/hda2 -- Invalid argument. This means Linux won't know about any changes you made to /dev/hda2 until you reboot -- so you shouldn't mount it or use it in any way before rebooting. > [...] cobd and the alias hdaX has no partitions support. "partprobe" is not usable on cobd and not usable on the alias hdaX. You can configure to use the whole disks as scsi. This driver has partition support and is available in the coLinux 0.8.0 snapshots. scsi0=disk,\Device\Harddisk0\Partition0 Than you have all your partitions from /dev/sda1 to /dev/sda8. "partprobe" should work with this device. Be carefully with accessing the windows partition from that driver. You should never mount the windows partitions (sda1, sda2)! Please also don't mount Windows aktive partitions as readonly, you risk to read wrong datas. > Finally, I'd like to try to access the locical partitions via the > losetup command with --offset option. But the loop module is not present > within the kernel/modules provided by Henry. > > Is there a reason why loop is ommitted? Would it be possible to access > the locical partitions using loop with offset? Loop is not a module. Loop is compiled in: $ zgrep LOOP < /proc/config.gz CONFIG_BLK_DEV_LOOP=y I'm afraid you need modules to use the LVM. All drivers after CONFIG_MD are only in the modules (CONFIG_BLK_DEV_DM=m). After you have installed modules under /lib/modules, you can use the LVM modules. I don't know what modules you need to load. Please check the files in lib/modules/2.6.25/kernel/drivers/md/ they begining with "dm-". Please also read Linux kernel source under Documentation/device-mapper. -- Henry N. |