All of lore.kernel.org
 help / color / mirror / Atom feed
* PV-GRUB - Does not read partition-less disk
@ 2008-09-11 23:10 Bastian Blank
  2008-09-12  1:38 ` Marco Sinhoreli
  0 siblings, 1 reply; 14+ messages in thread
From: Bastian Blank @ 2008-09-11 23:10 UTC (permalink / raw)
  To: xen-devel

Hi folks

PV-GRUB built from Xen 3.3.0 is not able to read from devices without a
partition table:

| grubdom> root (hd0)
|  Filesystem type unknown, using whole disk

Part of the config:
| disk = [ "phy:vg0_sledgehammer/servext_root,xvda,w" ]

Device:
| # file -s /dev/vg0_sledgehammer/servext_root       
| /dev/vg0_sledgehammer/servext_root: symbolic link to `/dev/mapper/vg0_sledgehammer-servext_root'
| # file -s /dev/mapper/vg0_sledgehammer-servext_root 
| /dev/mapper/vg0_sledgehammer-servext_root: Linux rev 1.0 ext3 filesystem data

Bastian

-- 
You can't evaluate a man by logic alone.
		-- McCoy, "I, Mudd", stardate 4513.3

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PV-GRUB - Does not read partition-less disk
  2008-09-11 23:10 PV-GRUB - Does not read partition-less disk Bastian Blank
@ 2008-09-12  1:38 ` Marco Sinhoreli
  2008-09-12  6:24   ` Bastian Blank
  0 siblings, 1 reply; 14+ messages in thread
From: Marco Sinhoreli @ 2008-09-12  1:38 UTC (permalink / raw)
  To: Bastian Blank; +Cc: xen-devel

Hello Bastian,

In this case, are you using the root partition for all block device or
is this partitioned? If you are using all block device (the logical
volume) to root disk, you need to set in your conffile it to 'xvda1'.
Case you are using a logical volume partitioned and the root disk is
the first partition, the right is:
| grubdom> root (hd0,0)


Best Regards,

On Thu, Sep 11, 2008 at 8:10 PM, Bastian Blank <bastian@waldi.eu.org> wrote:
> Hi folks
>
> PV-GRUB built from Xen 3.3.0 is not able to read from devices without a
> partition table:
>
> | grubdom> root (hd0)
> |  Filesystem type unknown, using whole disk
>
> Part of the config:
> | disk = [ "phy:vg0_sledgehammer/servext_root,xvda,w" ]
>
> Device:
> | # file -s /dev/vg0_sledgehammer/servext_root
> | /dev/vg0_sledgehammer/servext_root: symbolic link to `/dev/mapper/vg0_sledgehammer-servext_root'
> | # file -s /dev/mapper/vg0_sledgehammer-servext_root
> | /dev/mapper/vg0_sledgehammer-servext_root: Linux rev 1.0 ext3 filesystem data
>
> Bastian
>
> --
> You can't evaluate a man by logic alone.
>                -- McCoy, "I, Mudd", stardate 4513.3
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>



-- 
Marco Sinhoreli

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PV-GRUB - Does not read partition-less disk
  2008-09-12  1:38 ` Marco Sinhoreli
@ 2008-09-12  6:24   ` Bastian Blank
  2008-09-12 12:01     ` Marco Sinhoreli
  0 siblings, 1 reply; 14+ messages in thread
From: Bastian Blank @ 2008-09-12  6:24 UTC (permalink / raw)
  To: Marco Sinhoreli; +Cc: xen-devel

On Thu, Sep 11, 2008 at 10:38:51PM -0300, Marco Sinhoreli wrote:
> In this case, are you using the root partition for all block device or
> is this partitioned?

Äh, this is one device with a filesystem on it.

>                      If you are using all block device (the logical
> volume) to root disk, you need to set in your conffile it to 'xvda1'.

Since when does this set more then the name flag in xenstore and emulate
a partition table for use by the system? And no, this does not work
either.

Bastian

-- 
Violence in reality is quite different from theory.
		-- Spock, "The Cloud Minders", stardate 5818.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PV-GRUB - Does not read partition-less disk
  2008-09-12  6:24   ` Bastian Blank
@ 2008-09-12 12:01     ` Marco Sinhoreli
  2008-09-12 13:06       ` Bastian Blank
  0 siblings, 1 reply; 14+ messages in thread
From: Marco Sinhoreli @ 2008-09-12 12:01 UTC (permalink / raw)
  To: xen-devel

Hi Bastian,

Look this example:
* /etc/xen/xmexample.pv-grub or xen-3.3.0/tools/examples/xmexample.pv-grub

More information about pv-grub:
* http://blog.xen.org/index.php/2008/08/28/xen-33-feature-pv-grub/
* http://www.xen.org/files/xensummitboston08/SamThibault_XenSummit.pdf

-- 
Marco Sinhoreli

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PV-GRUB - Does not read partition-less disk
  2008-09-12 12:01     ` Marco Sinhoreli
@ 2008-09-12 13:06       ` Bastian Blank
  2008-09-12 14:29         ` Marco Sinhoreli
  0 siblings, 1 reply; 14+ messages in thread
From: Bastian Blank @ 2008-09-12 13:06 UTC (permalink / raw)
  To: xen-devel

On Fri, Sep 12, 2008 at 09:01:17AM -0300, Marco Sinhoreli wrote:
> Look this example:
> * /etc/xen/xmexample.pv-grub or xen-3.3.0/tools/examples/xmexample.pv-grub

hdaX is not supported by current kernels in the disk definition. And
this does not work either. It still sees one disk (hd0) without a
partition table and an unknown fs.

Bastian

-- 
Warp 7 -- It's a law we can live with.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PV-GRUB - Does not read partition-less disk
  2008-09-12 13:06       ` Bastian Blank
@ 2008-09-12 14:29         ` Marco Sinhoreli
  2008-09-12 14:42           ` Bastian Blank
  0 siblings, 1 reply; 14+ messages in thread
From: Marco Sinhoreli @ 2008-09-12 14:29 UTC (permalink / raw)
  To: Bastian Blank; +Cc: xen-devel

Do you have a system installed in this disk? Are you passing the path
of menu.lst in your configuration?
extra = "(hd0,0)/boot/grub/menu.lst"

I used a Debian lenny as dom0 and domU and it is working fine to me.
To partitioning the logical volume, I used the fdisk and, to access
it, I used kpartx. After mapped the partitions in /dev/mapper/, I
formated and I installed the system using debootstrap. I needed to
edit some files like /etc/fstab, /boot/grub/menu.lst, /etc/securetty
and /etc/inittab and to copy the kernel, and  initrd.img and the
modules into virtual machine partition.

On Fri, Sep 12, 2008 at 10:06 AM, Bastian Blank <bastian@waldi.eu.org> wrote:
> On Fri, Sep 12, 2008 at 09:01:17AM -0300, Marco Sinhoreli wrote:
>> Look this example:
>> * /etc/xen/xmexample.pv-grub or xen-3.3.0/tools/examples/xmexample.pv-grub
>
> hdaX is not supported by current kernels in the disk definition. And
> this does not work either. It still sees one disk (hd0) without a
> partition table and an unknown fs.
>
> Bastian
>
> --
> Warp 7 -- It's a law we can live with.
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>



-- 
Marco Sinhoreli

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PV-GRUB - Does not read partition-less disk
  2008-09-12 14:29         ` Marco Sinhoreli
@ 2008-09-12 14:42           ` Bastian Blank
  2008-09-12 15:01             ` Marco Sinhoreli
  0 siblings, 1 reply; 14+ messages in thread
From: Bastian Blank @ 2008-09-12 14:42 UTC (permalink / raw)
  To: Marco Sinhoreli; +Cc: xen-devel

On Fri, Sep 12, 2008 at 11:29:10AM -0300, Marco Sinhoreli wrote:
> Do you have a system installed in this disk?

Sure.

>                                              Are you passing the path
> of menu.lst in your configuration?
> extra = "(hd0,0)/boot/grub/menu.lst"

Yes. But even if not, "root (hd0)" should show that it can see the
filesystem. And the fact that it falls back into the normal commandline
and not the menu shows that it is not able to read the config.

Bastian

-- 
Mind your own business, Spock.  I'm sick of your halfbreed interference.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PV-GRUB - Does not read partition-less disk
  2008-09-12 14:42           ` Bastian Blank
@ 2008-09-12 15:01             ` Marco Sinhoreli
  2008-09-12 19:16               ` Bastian Blank
  0 siblings, 1 reply; 14+ messages in thread
From: Marco Sinhoreli @ 2008-09-12 15:01 UTC (permalink / raw)
  To: xen-devel

My tests:

# grep '^disk' pvmtest
disk = [ 'phy:empirevg/lenny.pvm,xvda,w' ]

# xm create -c /etc/xen/pvmtest
| grubdom> root (hd0)
| Filesystem type unknown, using whole disk
|
| grubdom> root (hd0,0)
| Filesystem type is ext2fs, partition type 0x83
|
| grubdom> configfile (hd0,0)/boot/grub/menu.lst

After this the grub menu was opened.

# fdisk -l /dev/empirevg/lenny.pvm
| Disk /dev/empirevg/lenny.pvm: 10.7 GB, 10737418240 bytes
| 255 heads, 63 sectors/track, 1305 cylinders
| Units = cylinders of 16065 * 512 = 8225280 bytes
| Disk identifier: 0x50e94ad8
|
|                   Device Boot      Start         End      Blocks   Id  System
| /dev/empirevg/lenny.pvm1               1        1156     9285538+  83  Linux
| /dev/empirevg/lenny.pvm2            1157        1305     1196842+
82  Linux swap / Solaris

On Fri, Sep 12, 2008 at 11:42 AM, Bastian Blank <bastian@waldi.eu.org> wrote:
> On Fri, Sep 12, 2008 at 11:29:10AM -0300, Marco Sinhoreli wrote:
>> Do you have a system installed in this disk?
>
> Sure.
>
>>                                              Are you passing the path
>> of menu.lst in your configuration?
>> extra = "(hd0,0)/boot/grub/menu.lst"
>
> Yes. But even if not, "root (hd0)" should show that it can see the
> filesystem. And the fact that it falls back into the normal commandline
> and not the menu shows that it is not able to read the config.
>
> Bastian
>
> --
> Mind your own business, Spock.  I'm sick of your halfbreed interference.
>



-- 
Marco Sinhoreli

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PV-GRUB - Does not read partition-less disk
  2008-09-12 15:01             ` Marco Sinhoreli
@ 2008-09-12 19:16               ` Bastian Blank
  2008-09-12 19:38                 ` Samuel Thibault
  0 siblings, 1 reply; 14+ messages in thread
From: Bastian Blank @ 2008-09-12 19:16 UTC (permalink / raw)
  To: Marco Sinhoreli; +Cc: xen-devel

On Fri, Sep 12, 2008 at 12:01:43PM -0300, Marco Sinhoreli wrote:
> | grubdom> root (hd0,0)
> | Filesystem type is ext2fs, partition type 0x83
> |
> | grubdom> configfile (hd0,0)/boot/grub/menu.lst

So we are at the beginning. You have a partition table on the device, I
don't.

Anyway, I found it. It is buried in the filesystem modules of grub in
the mount hook. It checks for
| ((current_drive & 0x80) || (current_slice != 0))
|    && (current_slice != PC_SLICE_TYPE_EXT2FS)
|    && (current_slice != PC_SLICE_TYPE_LINUX_RAID)
|    && (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_EXT2FS))
|    && (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_OTHER))

Which reads as:
- If device is a harddisk,
- or it is a slice with none matching type,
then abort.

It simply refuses to find filesystems on the whole disk. If I remove the
current_disk check it is able to find the filesystem.

Bastian

-- 
To live is always desirable.
		-- Eleen the Capellan, "Friday's Child", stardate 3498.9

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PV-GRUB - Does not read partition-less disk
  2008-09-12 19:16               ` Bastian Blank
@ 2008-09-12 19:38                 ` Samuel Thibault
  2008-09-12 19:54                   ` Bastian Blank
  2008-09-17 20:08                   ` Bastian Blank
  0 siblings, 2 replies; 14+ messages in thread
From: Samuel Thibault @ 2008-09-12 19:38 UTC (permalink / raw)
  To: Bastian Blank; +Cc: xen-devel, Marco Sinhoreli

Bastian Blank, le Fri 12 Sep 2008 21:16:36 +0200, a écrit :
> Anyway, I found it. It is buried in the filesystem modules of grub in
> the mount hook.

Cool, I currently don't have much time to spend on these :)

> It checks for
> | ((current_drive & 0x80) || (current_slice != 0))
> |    && (current_slice != PC_SLICE_TYPE_EXT2FS)
> |    && (current_slice != PC_SLICE_TYPE_LINUX_RAID)
> |    && (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_EXT2FS))
> |    && (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_OTHER))
> 
> Which reads as:
> - If device is a harddisk,
> - or it is a slice with none matching type,
> then abort.
> 
> It simply refuses to find filesystems on the whole disk. If I remove the
> current_disk check it is able to find the filesystem.

Uh, so that's an upstream bug, isn't it?

Samuel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PV-GRUB - Does not read partition-less disk
  2008-09-12 19:38                 ` Samuel Thibault
@ 2008-09-12 19:54                   ` Bastian Blank
  2008-09-12 19:59                     ` Samuel Thibault
  2008-09-17 20:08                   ` Bastian Blank
  1 sibling, 1 reply; 14+ messages in thread
From: Bastian Blank @ 2008-09-12 19:54 UTC (permalink / raw)
  To: Samuel Thibault, Marco Sinhoreli, xen-devel

On Fri, Sep 12, 2008 at 09:38:36PM +0200, Samuel Thibault wrote:
> Bastian Blank, le Fri 12 Sep 2008 21:16:36 +0200, a écrit :
> > It simply refuses to find filesystems on the whole disk. If I remove the
> > current_disk check it is able to find the filesystem.
> Uh, so that's an upstream bug, isn't it?

Yes. Many PC BIOS and even the OpenPOWER OF refuses to boot from disks
without a partition table, so I doubt that such a setup is used often on
real machines.

Bastian

-- 
Men of peace usually are [brave].
		-- Spock, "The Savage Curtain", stardate 5906.5

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PV-GRUB - Does not read partition-less disk
  2008-09-12 19:54                   ` Bastian Blank
@ 2008-09-12 19:59                     ` Samuel Thibault
  0 siblings, 0 replies; 14+ messages in thread
From: Samuel Thibault @ 2008-09-12 19:59 UTC (permalink / raw)
  To: Bastian Blank; +Cc: xen-devel, Marco Sinhoreli

Bastian Blank, le Fri 12 Sep 2008 21:54:00 +0200, a écrit :
> On Fri, Sep 12, 2008 at 09:38:36PM +0200, Samuel Thibault wrote:
> > Bastian Blank, le Fri 12 Sep 2008 21:16:36 +0200, a écrit :
> > > It simply refuses to find filesystems on the whole disk. If I remove the
> > > current_disk check it is able to find the filesystem.
> > Uh, so that's an upstream bug, isn't it?
> 
> Yes. Many PC BIOS and even the OpenPOWER OF refuses to boot from disks
> without a partition table,

You could still want to have grub load a kernel from a secondary drive.

Samuel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PV-GRUB - Does not read partition-less disk
  2008-09-12 19:38                 ` Samuel Thibault
  2008-09-12 19:54                   ` Bastian Blank
@ 2008-09-17 20:08                   ` Bastian Blank
  2008-09-17 20:15                     ` Samuel Thibault
  1 sibling, 1 reply; 14+ messages in thread
From: Bastian Blank @ 2008-09-17 20:08 UTC (permalink / raw)
  To: Samuel Thibault, Marco Sinhoreli, xen-devel

On Fri, Sep 12, 2008 at 09:38:36PM +0200, Samuel Thibault wrote:
> Bastian Blank, le Fri 12 Sep 2008 21:16:36 +0200, a écrit :
> > Anyway, I found it. It is buried in the filesystem modules of grub in
> > the mount hook.
> Cool, I currently don't have much time to spend on these :)

Patch.

Bastian

diff -r 8abe082246d0 stubdom/grub.patches/50fs_fulldisk.diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stubdom/grub.patches/50fs_fulldisk.diff	Wed Sep 17 22:07:03 2008 +0200
@@ -0,0 +1,72 @@
+diff -urN grub-0.97.orig/stage2/fsys_ext2fs.c grub-0.97/stage2/fsys_ext2fs.c
+--- grub-0.97.orig/stage2/fsys_ext2fs.c	2004-08-08 18:19:18.000000000 +0000
++++ grub-0.97/stage2/fsys_ext2fs.c	2008-09-16 19:31:15.000000000 +0000
+@@ -254,7 +254,7 @@
+ {
+   int retval = 1;
+ 
+-  if ((((current_drive & 0x80) || (current_slice != 0))
++  if ((((current_slice != 0))
+        && (current_slice != PC_SLICE_TYPE_EXT2FS)
+        && (current_slice != PC_SLICE_TYPE_LINUX_RAID)
+        && (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_EXT2FS))
+diff -urN grub-0.97.orig/stage2/fsys_fat.c grub-0.97/stage2/fsys_fat.c
+--- grub-0.97.orig/stage2/fsys_fat.c	2005-03-15 16:52:00.000000000 +0000
++++ grub-0.97/stage2/fsys_fat.c	2008-09-16 19:31:26.000000000 +0000
+@@ -70,7 +70,7 @@
+   __u32 magic, first_fat;
+   
+   /* Check partition type for harddisk */
+-  if (((current_drive & 0x80) || (current_slice != 0))
++  if (((current_slice != 0))
+       && ! IS_PC_SLICE_TYPE_FAT (current_slice)
+       && (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_MSDOS)))
+     return 0;
+diff -urN grub-0.97.orig/stage2/fsys_ffs.c grub-0.97/stage2/fsys_ffs.c
+--- grub-0.97.orig/stage2/fsys_ffs.c	2003-07-09 11:45:52.000000000 +0000
++++ grub-0.97/stage2/fsys_ffs.c	2008-09-16 19:31:32.000000000 +0000
+@@ -82,7 +82,7 @@
+ {
+   int retval = 1;
+ 
+-  if ((((current_drive & 0x80) || (current_slice != 0))
++  if ((((current_slice != 0))
+        && ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_BSDFFS))
+       || part_length < (SBLOCK + (SBSIZE / DEV_BSIZE))
+       || !devread (SBLOCK, 0, SBSIZE, (char *) SUPERBLOCK)
+diff -urN grub-0.97.orig/stage2/fsys_minix.c grub-0.97/stage2/fsys_minix.c
+--- grub-0.97.orig/stage2/fsys_minix.c	2003-07-09 11:45:53.000000000 +0000
++++ grub-0.97/stage2/fsys_minix.c	2008-09-16 19:32:01.000000000 +0000
+@@ -160,7 +160,7 @@
+ int
+ minix_mount (void)
+ {
+-  if (((current_drive & 0x80) || current_slice != 0)
++  if ((current_slice != 0)
+       && ! IS_PC_SLICE_TYPE_MINIX (current_slice)
+       && ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_OTHER))
+     return 0;			/* The partition is not of MINIX type */
+diff -urN grub-0.97.orig/stage2/fsys_ufs2.c grub-0.97/stage2/fsys_ufs2.c
+--- grub-0.97.orig/stage2/fsys_ufs2.c	2004-06-19 12:17:52.000000000 +0000
++++ grub-0.97/stage2/fsys_ufs2.c	2008-09-16 19:32:32.000000000 +0000
+@@ -87,7 +87,7 @@
+   sblockloc = -1;
+   type = 0;
+   
+-  if (! (((current_drive & 0x80) || (current_slice != 0))
++  if (! (((current_slice != 0))
+ 	 && ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_BSDFFS)))
+     {
+       for (i = 0; sblock_try[i] != -1; ++i)
+diff -urN grub-0.97.orig/stage2/fsys_vstafs.c grub-0.97/stage2/fsys_vstafs.c
+--- grub-0.97.orig/stage2/fsys_vstafs.c	2003-07-09 11:45:53.000000000 +0000
++++ grub-0.97/stage2/fsys_vstafs.c	2008-09-16 19:32:39.000000000 +0000
+@@ -47,7 +47,7 @@
+ {
+   int retval = 1;
+   
+-  if( (((current_drive & 0x80) || (current_slice != 0))
++  if( (((current_slice != 0))
+        && current_slice != PC_SLICE_TYPE_VSTAFS)
+       ||  ! devread (0, 0, BLOCK_SIZE, (char *) FSYS_BUF)
+       ||  FIRST_SECTOR->fs_magic != 0xDEADFACE)
-- 
All your people must learn before you can reach for the stars.
		-- Kirk, "The Gamesters of Triskelion", stardate 3259.2

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PV-GRUB - Does not read partition-less disk
  2008-09-17 20:08                   ` Bastian Blank
@ 2008-09-17 20:15                     ` Samuel Thibault
  0 siblings, 0 replies; 14+ messages in thread
From: Samuel Thibault @ 2008-09-17 20:15 UTC (permalink / raw)
  To: Bastian Blank; +Cc: xen-devel, Marco Sinhoreli

Bastian Blank, le Wed 17 Sep 2008 22:08:33 +0200, a écrit :
> On Fri, Sep 12, 2008 at 09:38:36PM +0200, Samuel Thibault wrote:
> > Bastian Blank, le Fri 12 Sep 2008 21:16:36 +0200, a écrit :
> > > Anyway, I found it. It is buried in the filesystem modules of grub in
> > > the mount hook.
> > Cool, I currently don't have much time to spend on these :)
> 
> Patch.

Thanks!

Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-09-17 20:15 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-11 23:10 PV-GRUB - Does not read partition-less disk Bastian Blank
2008-09-12  1:38 ` Marco Sinhoreli
2008-09-12  6:24   ` Bastian Blank
2008-09-12 12:01     ` Marco Sinhoreli
2008-09-12 13:06       ` Bastian Blank
2008-09-12 14:29         ` Marco Sinhoreli
2008-09-12 14:42           ` Bastian Blank
2008-09-12 15:01             ` Marco Sinhoreli
2008-09-12 19:16               ` Bastian Blank
2008-09-12 19:38                 ` Samuel Thibault
2008-09-12 19:54                   ` Bastian Blank
2008-09-12 19:59                     ` Samuel Thibault
2008-09-17 20:08                   ` Bastian Blank
2008-09-17 20:15                     ` Samuel Thibault

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.