[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] try to reread partition table in 10_linux
From: |
Felix Zielcke |
Subject: |
Re: [PATCH] try to reread partition table in 10_linux |
Date: |
Thu, 29 Oct 2009 00:18:05 +0100 |
Am Donnerstag, den 29.10.2009, 00:00 +0100 schrieb Robert Millan:
> On Wed, Oct 28, 2009 at 11:33:51PM +0100, Felix Zielcke wrote:
> > +if which sfdisk /dev/null ; then
> > + GRUB_DEVICE_DISK=`echo ${GRUB_DEVICE} | sed -e "s/[0-9]*$//"`
> > + sfdisk -R ${GRUB_DEVICE_DISK} 2>/dev/null
> > +fi
>
> s/[0-9]*$// doesn't catch all partition path layouts. More heuristic
> is needed for that (we have this in util/hostdisk.c), but duplicating it
> doesn't sound like a good idea.
Oh right I forgot about e.g. the hardware RAID controllers.
Hm if grub-probe would accept a GRUB device, we could use 2 grub-probe
calls to do that.
i.e. something like
tmp_drive=`grub-probe -t drive -d ${GRUB_DEVICE} | sed -e 's/,[a-z0-9]//g'`
GRUB_DEVICE_DISK=`grub-probe -t device ${tmp_drive}`
> Can this be avoided altogether? E.g. by telling Linux the partition path
> instead, or by using another interface.
I don't think we can:
$ LANG=C sudo sfdisk -R /dev/hda2
BLKRRPART: Invalid argument
I doubt the kernel provides more then one way to reread the partition
table.
Hm but maybe libparted or something else has a wrapper for this.
--
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer