Michel Gaudet
2007-Sep-27 07:55 UTC
[Xen-users] Share of disks in read only between dom0 and domU.
Hello ! Because of a special config of my grub boot system, i try to export in a domU, in read only mode, one of my disk partition mounted in the dom0 (in RW) and i don''t succeed because xen refuse to export this disk partition in a domU. extract of the conf : disk = [ ''phy:/dev/sda,ioemu:hda,r'' , ''phy:/dev/sda6,ioemu:sda6,r]'' , ''phy:/dev/sda1,ioemu:sda1'' ] The first disk for grub to access the MBR , the second for grub to obtain its 1.5 and second stage and the third to reach the guest OS. I block at the export of the sda6 which is the / of my dom0 with the message : Error: Device 2054 (vbd) could not be connected. Device /dev/sda6 is mounted read-write in the privileged domain, and so cannot be mounted read-only by a guest. If i don''t mount the /dev/sda6 the domU begin the boot but it freeze with the error : Booting from Hard Disk GRUB Loading stage1.5. GRUB loading, please wait... Error 5 Error 5 is : Partition table invalid or corrupt But we can boot normally our 2 OS without xen. I think it is because it don''t see the partition onto which is the grub install : /dev/sda6 I understand why it is forbidden to mount in RW the same disk but in R ? In fact i try to boot a domU Windows XP installed on a disk with 2 primary partitions and 1 extended, itself with the 3 partitions of the SuSE 10.2 xen install with its dom0. The grub is installed on the MBR of the SATA disk and the XP on the 1st primary part. Some ideas ? Thanks a lot. Regards. -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ^ ^ ---- Michel GAUDET +--- | | +--- +--- +--- /| /|| | CRI/SIR |__ |__| |__ |__ |__ / |/ || __ Ecole des Hautes Etudes | | | | | | / ||____| en Sciences Sociales +--- | | +--- ---+ ---+ 54 Boulevard RASPAIL 75006 PARIS Tel:(33) 01 49 54 25 91 Email: Michel.Gaudet@ehess.fr FAX:(33) 01 49 54 26 85 _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Goswin von Brederlow
2007-Sep-27 09:20 UTC
Re: [Xen-users] Share of disks in read only between dom0 and domU.
Michel Gaudet <Michel.Gaudet@ehess.fr> writes:> Hello ! > > Because of a special config of my grub boot system, i try to export in > a domU, in read only mode, one of my disk partition mounted in the > dom0 (in RW) and i don''t succeed because xen refuse to export this > disk partition in a domU. > > extract of the conf : > > disk = [ ''phy:/dev/sda,ioemu:hda,r'' , ''phy:/dev/sda6,ioemu:sda6,r]'' , > ''phy:/dev/sda1,ioemu:sda1'' ] > > The first disk for grub to access the MBR , the second for grub to obtain its 1.5 and > second stage and the third to reach the guest OS. > > I block at the export of the sda6 which is the / of my dom0 with the message : > > Error: Device 2054 (vbd) could not be connected. > Device /dev/sda6 is mounted read-write in the privileged domain, > and so cannot be mounted read-only by a guest.And it has good reason to refuse this.> If i don''t mount the /dev/sda6 the domU begin the boot but it freeze with the error : > > Booting from Hard Disk > GRUB Loading stage1.5. > > GRUB loading, please wait... > Error 5 > > Error 5 is : Partition table invalid or corrupt > > But we can boot normally our 2 OS without xen.You need sda there, not sda6. There is no partition table on sda6.> I think it is because it don''t see the partition onto which is the grub install : /dev/sda6 > > I understand why it is forbidden to mount in RW the same disk but in R ?Because the filesystem structures will be in some inconsistent state and change underneath the caches the domU maintains without notice. You quickly get a mix of old and new data. For grub this might not matter as it is so low level but xen doesn''t know you only want to start grub there. MfG Goswin _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
James Harper
2007-Sep-27 09:41 UTC
RE: [Xen-users] Share of disks in read only between dom0 and domU.
> Hello ! > > Because of a special config of my grub boot system, i try to export ina> domU, in read > only mode, one of my disk partition mounted in the dom0 (in RW) and i > don''t succeed > because xen refuse to export this disk partition in a domU. >I think you can append a ''!'' do the permissions, eg ''r!'' or ''w!'' (or maybe it was a ''+''?) if you want to force xen to do your bidding, even if xen thinks it''s not a good idea. I''ve done this with OCFS2 before. But for a non-cluster aware filesystem, you''re asking for trouble. DomU will cache filesystem data which Dom0 may write to, leaving DomU with out of data information (nothing to tell it to re-read). If everyone mounts the filesystem ro then you should be fine I think you can configure Dom0 to mount the filesystem with no write caching (eg synchronous mode), but I don''t think you can tell DomU to mount it with no read caching, and even if you could, you would surely run into race conditions where Dom0 is changing data even as DomU is reading it. James _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Michel Gaudet
2007-Sep-27 10:02 UTC
Re: [Xen-users] Share of disks in read only between dom0 and domU.
Hello ! James Harper a écrit :>> Hello ! >> >> Because of a special config of my grub boot system, i try to export in > a >> domU, in read >> only mode, one of my disk partition mounted in the dom0 (in RW) and i >> don''t succeed >> because xen refuse to export this disk partition in a domU. >> > > I think you can append a ''!'' do the permissions, eg ''r!'' or ''w!'' (or > maybe it was a ''+''?) if you want to force xen to do your bidding, even > if xen thinks it''s not a good idea. I''ve done this with OCFS2 before. >I tried this before but neither ! nor + works on my xen (3.0.3 in SuSE 10.2). I get : Error: Invalid mode> But for a non-cluster aware filesystem, you''re asking for trouble. DomU > will cache filesystem data which Dom0 may write to, leaving DomU with > out of data information (nothing to tell it to re-read). If everyone > mounts the filesystem ro then you should be fine > > I think you can configure Dom0 to mount the filesystem with no write > caching (eg synchronous mode), but I don''t think you can tell DomU to > mount it with no read caching, and even if you could, you would surely > run into race conditions where Dom0 is changing data even as DomU is > reading it. > > James >It is only for grub to see its differents stages (1.5 and 2) which are located on /dev/sda6 and it is no need at all to access this disk after booting the XP. I don''t know really if my idea is good but all the others tries did not work. Thanks. -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ^ ^ ---- Michel GAUDET +--- | | +--- +--- +--- /| /|| | CRI/SIR |__ |__| |__ |__ |__ / |/ || __ Ecole des Hautes Etudes | | | | | | / ||____| en Sciences Sociales +--- | | +--- ---+ ---+ 54 Boulevard RASPAIL 75006 PARIS Tel:(33) 01 49 54 25 91 Email: Michel.Gaudet@ehess.fr FAX:(33) 01 49 54 26 85 _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Michel Gaudet
2007-Sep-27 10:07 UTC
Re: [Xen-users] Share of disks in read only between dom0 and domU.
Goswin von Brederlow a écrit :> Michel Gaudet <Michel.Gaudet@ehess.fr> writes: > >> Hello ! >> >> Because of a special config of my grub boot system, i try to export in >> a domU, in read only mode, one of my disk partition mounted in the >> dom0 (in RW) and i don''t succeed because xen refuse to export this >> disk partition in a domU. >> >> extract of the conf : >> >> disk = [ ''phy:/dev/sda,ioemu:hda,r'' , ''phy:/dev/sda6,ioemu:sda6,r]'' , >> ''phy:/dev/sda1,ioemu:sda1'' ] >> >> The first disk for grub to access the MBR , the second for grub to obtain its 1.5 and >> second stage and the third to reach the guest OS. >> >> I block at the export of the sda6 which is the / of my dom0 with the message : >> >> Error: Device 2054 (vbd) could not be connected. >> Device /dev/sda6 is mounted read-write in the privileged domain, >> and so cannot be mounted read-only by a guest. > > And it has good reason to refuse this.And as i say belox i understand this.> >> If i don''t mount the /dev/sda6 the domU begin the boot but it freeze with the error : >> >> Booting from Hard Disk >> GRUB Loading stage1.5. >> >> GRUB loading, please wait... >> Error 5 >> >> Error 5 is : Partition table invalid or corrupt >> >> But we can boot normally our 2 OS without xen. > > You need sda there, not sda6. There is no partition table on sda6.Yes the partition is on /dev/sda which is mounted also; but grub stage 1.5 and 2 are on /dev/sda6 and grub access its stage > 1 thru the file system onto it is installed then i think i do mount /dev/sda6 which contain the grub stage > 1.> >> I think it is because it don''t see the partition onto which is the grub install : /dev/sda6 >> >> I understand why it is forbidden to mount in RW the same disk but in R ? > > Because the filesystem structures will be in some inconsistent state > and change underneath the caches the domU maintains without > notice. You quickly get a mix of old and new data. > > For grub this might not matter as it is so low level but xen doesn''t > know you only want to start grub there. > > MfG > GoswinThanks. -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ^ ^ ---- Michel GAUDET +--- | | +--- +--- +--- /| /|| | CRI/SIR |__ |__| |__ |__ |__ / |/ || __ Ecole des Hautes Etudes | | | | | | / ||____| en Sciences Sociales +--- | | +--- ---+ ---+ 54 Boulevard RASPAIL 75006 PARIS Tel:(33) 01 49 54 25 91 Email: Michel.Gaudet@ehess.fr FAX:(33) 01 49 54 26 85 _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Goswin von Brederlow
2007-Sep-28 08:05 UTC
Re: [Xen-users] Share of disks in read only between dom0 and domU.
Michel Gaudet <Michel.Gaudet@ehess.fr> writes:> Yes the partition is on /dev/sda which is mounted also; but grub stage > 1.5 and 2 are on /dev/sda6 and grub access its stage > 1 thru the file > system onto it is installed then i think i do mount /dev/sda6 which > contain the grub stage > 1.Grub does not access /dev/sda6 for the later stages. It uses the bios to read the data from sda directly following the partition block to the partition and then parsing the filesystem. You are seriously changing the way the disk appear in the bios with yur xen configuration as compared to without xen. That is why it fails. MfG Goswin _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users