Re: [gentoo-user] Re: Can't find init due to inconsistent drive order

2013-07-02 Thread Randolph Maaßen
2013/7/2 Grant Edwards grant.b.edwa...@gmail.com

 On 2013-07-01, Grant Edwards grant.b.edwa...@gmail.com wrote:

  I've just recently run into a problem where sometimes when a machine
  boots, the kernel can't find init.  This appears to be because my grub
  configuration line says root=/dev/sda5 and _sometimes_ the drive
  that contains my root partition is sdb instead of sda. AFAICT, for the
  past 30 years the linux kernel was 100% consistent in the order that
  hard drives were labelled -- but recently that has seems to have
  changed.

 I still haven't figured out why my drives suddenly started getting
 discovered in varying orders.  I think that the SATA drives are always
 in the same order with respect to each other, but sometimes the
 external firewire drive gets discovered before the SATA drives and
 sometimes after the SATA drives.

 It looks like my options are:

  1) Keep hitting the reset button until it works.

  2) Unplug or power down the firewire drive when booting.

  3) Set up an initrd for the sole purpose of finding the actual root
 parition via filesystem label.  [I find this idea rather offensive.]

  4) Build the firewire drive as a module instead of building it into
 the kernel.  That would delay the discovery of the firewire drive
 until after root has been mounted.

  5) For the drive with the root parition on it switch from a DOS
 parition table to a GPT partition table and use the
 root=PARTUUID=whatever kernel option.


You don't need to switch to GPT for that. I have a DOS partitioned disk and
blkid prints the LABEL and UUID for each partition.


  6) Fix the kernel so it can find root by looking at filesystem
 labels.

 Number 6 (fixing the kernel) is The Right Thing To Do(tm), but it's a
 bit out of scope for the momement.  The early code in the kernel
 obviously knows how to read partition tables and also knows about the
 relevent file system, so I'm a bit baffled why it can't look at the
 file system label.

 Changing the firewire driver to be a module is probably the simplest
 solution, but it's a kludgy work-around for what is, in my opinion, a
 kernel bug: if you are going to require people to specify an absolute
 disk drive index for the root partition, then you'd better index
 drives in a consistent order from one boot to the next.

 Switching to a GPT partition table sounds like the cleanest solution,
 but I need to figure out if the grub (legacy) ebuild includes GPT
 support or not.  I know it's supported by grub2, but I don't really
 feel like switching to grub2 ATM.

 --
 Grant Edwards   grant.b.edwardsYow! But was he mature
   at   enough last night at the
   gmail.comlesbian masquerade?





-- 
Mit freundlichen Grüßen / Best regards

Randolph Maaßen


Re: [gentoo-user] Re: Can't find init due to inconsistent drive order

2013-07-02 Thread Wang Xuerui
2013/7/2 Grant Edwards grant.b.edwa...@gmail.com:
 It looks like my options are:

 snip

  5) For the drive with the root parition on it switch from a DOS
 parition table to a GPT partition table and use the
 root=PARTUUID=whatever kernel option.

 Switching to a GPT partition table sounds like the cleanest solution,
 but I need to figure out if the grub (legacy) ebuild includes GPT
 support or not.  I know it's supported by grub2, but I don't really
 feel like switching to grub2 ATM.

I'm not exactly sure about your system's setup, but msdos partition
tables can also hold partition UUIDs, which can be seen by running
blkid. So, such a solution does not necessarily imply a GPT-based
setup... you can experiment with it a bit, having fun tweaking kernel
parameters :)



Re: [gentoo-user] Re: Can't find init due to inconsistent drive order

2013-07-02 Thread Daniel Frey
On 07/02/2013 07:23 AM, Grant Edwards wrote:
 On 2013-07-01, Grant Edwards grant.b.edwa...@gmail.com wrote:
 
 
  2) Unplug or power down the firewire drive when booting. 
 

I had this problem on my Intel motherboard, and found out you can
disable booting from external drives. Boot to removable devices or
similar in the BIOS. Failing that, changing the boot order so that the
firewire/USB device is at the very end of the boot list may help your
situation.

 
 Number 6 (fixing the kernel) is The Right Thing To Do(tm), but it's a
 bit out of scope for the momement.  The early code in the kernel
 obviously knows how to read partition tables and also knows about the
 relevent file system, so I'm a bit baffled why it can't look at the
 file system label.
 

Is CONFIG_EDD set?

CONFIG_EDD:


  Say Y or M here if you
want to enable BIOS Enhanced Disk Drive Services real mode BIOS calls to
determine which disk
BIOS tries boot from.  This information is then exported via sysfs.


Dan



Re: [gentoo-user] Re: Can't find init due to inconsistent drive order

2013-07-02 Thread Randolph Maaßen
2013/7/2 Grant Edwards grant.b.edwa...@gmail.com

 On 2013-07-02, Randolph Maa?en r.maasse...@gmail.com wrote:
  2013/7/2 Grant Edwards grant.b.edwa...@gmail.com

  It looks like my options are:
 
 [...]
 
   5) For the drive with the root parition on it switch from a DOS
  parition table to a GPT partition table and use the
  root=PARTUUID=whatever kernel option.
 
  You don't need to switch to GPT for that. I have a DOS partitioned disk
 and
  blkid prints the LABEL and UUID for each partition.

 And you can pass those values to the kernel via  the root= parameter?


Yep.
The G in GPT just means that the type of the partition is stored as
GUID/UUID. The partition ID is a separate value.


 --
 Grant Edwards   grant.b.edwardsYow! NEWARK has been
   at   REZONED!!  DES MOINES
 has
   gmail.combeen REZONED!!





-- 
Mit freundlichen Grüßen / Best regards

Randolph Maaßen


Re: [gentoo-user] Re: Can't find init due to inconsistent drive order

2013-07-02 Thread Bruce Hill
On Tue, Jul 02, 2013 at 02:42:15PM +, Grant Edwards wrote:
 
  You don't need to switch to GPT for that. I have a DOS partitioned disk and
  blkid prints the LABEL and UUID for each partition.
 
 And you can pass those values to the kernel via  the root= parameter?

That still requires an initrd/initramfs, iirc.
-- 
Happy Penguin Computers   ')
126 Fenco Drive   ( \
Tupelo, MS 38801   ^^
supp...@happypenguincomputers.com
662-269-2706 662-205-6424
http://happypenguincomputers.com/

A: Because it messes up the order in which people normally read text.   

   
Q: Why is top-posting such a bad thing? 

   
A: Top-posting. 

   
Q: What is the most annoying thing in e-mail?

Don't top-post: http://en.wikipedia.org/wiki/Top_post#Top-posting



Re: [gentoo-user] Re: Can't find init due to inconsistent drive order

2013-07-02 Thread Neil Bothwick
On Tue, 2 Jul 2013 15:16:15 + (UTC), Grant Edwards wrote:

 The PARTUUID= parition specifier format is handled directly by kernel
 code, so I don't see why it should require an initrd (unless the UUID
 values for MBR partitions aren't actually something the kernel knows
 about and are something made up from whole cloth by the blkid program)

MBRs don't have PARTUUIDs do they? Don't confuse them with filesystem
UUIDs as used in fstab.


-- 
Neil Bothwick

Oops. My brain just hit a bad sector.


signature.asc
Description: PGP signature


Re: [gentoo-user] Re: Can't find init due to inconsistent drive order

2013-07-02 Thread Neil Bothwick
On Tue, 2 Jul 2013 15:09:28 + (UTC), Grant Edwards wrote:

  I had this problem on my Intel motherboard, and found out you can
  disable booting from external drives. Boot to removable devices or
  similar in the BIOS. Failing that, changing the boot order so that the
  firewire/USB device is at the very end of the boot list may help your
  situation.  
 
 The problem isn't that the BIOS is booting the wrong drive.  The BIOS
 is booting the correct drive, grub is starting, grub is loading the
 correct kernel.  When the _kernel_ runs it (sometimes) identifies disk
 drives in the wrong order and tries to mount the root directory from
 the wrong drive.

And the BIOS order can affect the order in which the kernel sees the
drives, so it is worth trying.

I'd go for the firewire-as-a-module approach and add the module
to /etc/conf.d/modules to make sure it is loaded ASAP. Yes, it is a
kludge, but it is the simplest solution from a practical POV.


-- 
Neil Bothwick

Processor: (n.) a device for converting sense to nonsense at the speed
   of electricity, or (rarely) the reverse.


signature.asc
Description: PGP signature


Re: [gentoo-user] Re: Can't find init due to inconsistent drive order

2013-07-02 Thread Neil Bothwick
On Tue, 2 Jul 2013 16:57:26 + (UTC), Grant Edwards wrote:

 IOW, it appears that the blkid program is either just making stuff
 up or its the filesystem UUID rather than the partition UUID. I
 suspect the latter, since I notice that blkid doesn't print a UUID for
 paritions that don't have filesystems.

UUIDs are for filesystems, PARTUUIDs ae for partitions - blkid prints
both, but only if both are present, which requires a GPT partition table.


-- 
Neil Bothwick

A man needs a mistress - just to break the monogamy


signature.asc
Description: PGP signature


Re: [gentoo-user] Re: Can't find init due to inconsistent drive order

2013-07-02 Thread Paul Hartman
On Tue, Jul 2, 2013 at 11:57 AM, Grant Edwards
grant.b.edwa...@gmail.com wrote:


 All the references Google can find for me say that you have to use a
 GPT partition table if you want to specify a boot partition using
 root=PARTUUID=partition-uuid.

 Does the root=PARTUUID option work for you?

 Can you point to some documentation on how you can use
 root=PARTUID=partition-uuid with an DOS/MBR partition table?

As Neil alluded to, you can use UUID with MBR (instead of PARTUUID and
GPT). I have DOS/MBR partition table and my kernel commandline looks
like:

root=UUID=1d21fa55-0fa9-4d43-8d41-8b4193900efa ro log_buf_len=1M quiet
rootfstype=ext4 raid=noautodetect

(along with an initramfs)



Re: [gentoo-user] Re: Can't find init due to inconsistent drive order

2013-07-02 Thread Randolph Maaßen
2013/7/2 Grant Edwards grant.b.edwa...@gmail.com

 On 2013-07-02, Neil Bothwick n...@digimed.co.uk wrote:
  On Tue, 2 Jul 2013 15:16:15 + (UTC), Grant Edwards wrote:
 
  The PARTUUID= parition specifier format is handled directly by kernel
  code, so I don't see why it should require an initrd (unless the UUID
  values for MBR partitions aren't actually something the kernel knows
  about and are something made up from whole cloth by the blkid program)
 
  MBRs don't have PARTUUIDs do they? Don't confuse them with filesystem
  UUIDs as used in fstab.

 No, blkid does not print a PARTUUID value with an MBR. In only prints
 UUID values, which as you noted, are _filesystem_ UUIDs.  If you
 want to use a filesystem UUID to locate the root partition, you need
 an initramfs/initrd which contains an 'init' program that finds the
 filesystem with the specified UUID, mounts that filesystem, and then
 does a root_pivot.

 --
 Grant Edwards   grant.b.edwardsYow! Hello.  Just walk
   at   along and try NOT to
 think
   gmail.comabout your INTESTINES
 being
almost FORTY YARDS
 LONG!!



SCREW ME! Still messing around with these IDs.

Sorry for disturbance.

-- 
Mit freundlichen Grüßen / Best regards

Randolph Maaßen


Re: [gentoo-user] Re: Can't find init due to inconsistent drive order

2013-07-02 Thread Paul Hartman
On Tue, Jul 2, 2013 at 3:27 PM, Grant Edwards grant.b.edwa...@gmail.com wrote:
 Can you point to some documentation on how you can use
 root=PARTUID=partition-uuid with an DOS/MBR partition table?

 As Neil alluded to, you can use UUID with MBR (instead of PARTUUID and
 GPT). I have DOS/MBR partition table and my kernel commandline looks
 like:

 root=UUID=1d21fa55-0fa9-4d43-8d41-8b4193900efa ro log_buf_len=1M quiet
 rootfstype=ext4 raid=noautodetect

 (along with an initramfs)

 Yes, we've already discussed that if you have an initrd (or
 initramfs), and an 'init' program that handles it, you can use
 filesystem labels and filesystem uuids.

 The option we were discussing in the posting to which you replied is
 that of using the root=PARTUUID method which is handled directly by
 the kernel.

Ah, sorry, I missed that detail. I thought I was helping to clear up
confusion, when in fact I was the confused one! :)



Re: [gentoo-user] Re: Can't find init due to inconsistent drive order

2013-07-02 Thread Neil Bothwick
On Tue, 2 Jul 2013 20:40:20 + (UTC), Grant Edwards wrote:

 Next time I do an install, I think I'll try GPT...

I can't think why any sane person would do otherwise. Who in their right
mind would want to use a 30+year old format where any more than four
partitions is a fragile kludge? :-O


-- 
Neil Bothwick

Eat shit - 50 million flies can't be wrong
Use Microsoft . . . . .


signature.asc
Description: PGP signature


Re: [gentoo-user] Re: Can't find init due to inconsistent drive order

2013-07-01 Thread Canek Peláez Valdés
On Jul 1, 2013 9:45 PM, Grant Edwards grant.b.edwa...@gmail.com wrote:

 On 2013-07-01, Alan McKinnon alan.mckin...@gmail.com wrote:
  On 01/07/2013 23:52, Grant Edwards wrote:
  I've just recently run into a problem where sometimes when a machine
  boots, the kernel can't find init.  This appears to be because my grub
  configuration line says root=/dev/sda5 and _sometimes_ the drive
  that contains my root partition is sdb instead of sda. AFAICT, for the
  past 30 years the linux kernel was 100% consistent in the order that
  hard drives were labelled -- but recently that has seems to have
  changed.
 
  I use partition labels in my fstab, so that's not a problem, but after
  all these years, the kernel still doesn't know how to grok parition
  labels.
 
  Are we really expected now to set up an initrd just so that the kernel
  can find the root partition??
 
  Where have you been for the past 6 months?
 
  Did you miss the entire clusterfuck debate about latest udev tricks?

 No.

  Those names depend only on the order in which devices are discovered,
  and that process has always been indeterminate.

 Really?  I've been running Linux on a lot of machines for 30 years --
 often on machines with a half-dozen hard drives -- and I never saw
 drive order change from one reboot to the next until today.  That's
 quite a lucky streak.

Since Linus started writing Linux in 1991 (22 years ago), I want to know
which time machine did you use.

Regards.
--
Canek Peláez Valdés