On 8/5/2015 1:00 PM, Chris Murphy wrote:> On Wed, Aug 5, 2015 at 10:52 AM, Bowie Bailey <Bowie_Bailey at buc.com> wrote: >> How would I go about pointing it at the partition? >> >> What I am currently doing is this: >> device (hd0) /dev/hdg >> root (hd0,0) >> setup (hd0) > > setup (hd1,0) > > It's hd1 if your device map is correct and hdg is hd1. And then ,0 is > for the first partition assuming that's an ext3 boot partition.What I am doing on my other system (where everything is working), is forcing grub to install to both drives as hd0. I found that when the first drive dies and I remove it from the system, grub will see the remaining drive as hd0, regardless of what it was before. So if I install grub to the second disk as hd1, then it won't boot as a single drive. And to get this back to a single thread: On 8/5/2015 1:03 PM, Chris Murphy wrote:> On Wed, Aug 5, 2015 at 10:58 AM, Bowie Bailey <Bowie_Bailey at buc.com> wrote: > >> I tried 'smartctl -a' and 'hdparm -I', but I don't see anything about >> Advanced Format. What am I looking for? > # smartctl -i /dev/hdg | grep -i sector > Sector Size: 512 bytes logical/physicalI don't get a "Sector Size" line. smartctl version 5.38 [i686-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen Home page is http://smartmontools.sourceforge.net/ === START OF INFORMATION SECTION ==Device Model: WDC WD10EZEX-60M2NA0 Serial Number: WD-WCC3F6AX0119 Firmware Version: 03.01A03 User Capacity: 1,000,204,886,016 bytes Device is: Not in smartctl database [for details use: -P showall] ATA Version is: 9 ATA Standard is: Not recognized. Minor revision code: 0x1f Local Time is: Wed Aug 5 13:09:16 2015 EDT SMART support is: Available - device has SMART capability. SMART support is: Enabled -- Bowie
On Wed, Aug 5, 2015 at 11:11 AM, Bowie Bailey <Bowie_Bailey at buc.com> wrote:> On 8/5/2015 1:00 PM, Chris Murphy wrote: >> >> On Wed, Aug 5, 2015 at 10:52 AM, Bowie Bailey <Bowie_Bailey at buc.com> >> wrote: >>> >>> How would I go about pointing it at the partition? >>> >>> What I am currently doing is this: >>> device (hd0) /dev/hdg >>> root (hd0,0) >>> setup (hd0) >> >> >> setup (hd1,0) >> >> It's hd1 if your device map is correct and hdg is hd1. And then ,0 is >> for the first partition assuming that's an ext3 boot partition. > > > What I am doing on my other system (where everything is working), is forcing > grub to install to both drives as hd0. I found that when the first drive > dies and I remove it from the system, grub will see the remaining drive as > hd0, regardless of what it was before. So if I install grub to the second > disk as hd1, then it won't boot as a single drive.Nothing about hd0 or hd1 gets baked into the bootloader code. It's an absolute reference to a physical drive at the moment in time the command is made. If there is only one drive connected when you initiate this command, then it's hd0. Almost invariably hd0 is the current boot drive, or at least it's the first drive as enumerated by the BIOS. So long as the drive in question gets a bootloader, it'll boot regardless of what hdX designation it takes. I'm just not totally convinced the designation is correct here because I really don't see how 'setup hd0' works on a drive that has no MBR gap.> > And to get this back to a single thread: > > On 8/5/2015 1:03 PM, Chris Murphy wrote: >> >> On Wed, Aug 5, 2015 at 10:58 AM, Bowie Bailey <Bowie_Bailey at buc.com> >> wrote: >> >>> I tried 'smartctl -a' and 'hdparm -I', but I don't see anything about >>> Advanced Format. What am I looking for? >> >> # smartctl -i /dev/hdg | grep -i sector >> Sector Size: 512 bytes logical/physical > > > I don't get a "Sector Size" line. > > smartctl version 5.38 [i686-redhat-linux-gnu] Copyright (C) 2002-8 BruceOK that version predates sector size info. See if your version of hdparm will do it: # hdparm -I /dev/hdg | grep -i sector That spits out several lines for me, including Physical Sector size: 512 bytes Another one is: # parted -l /dev/hdg | grep -i sector I'm willing to bet that physical sector size is 4096 bytes> Allen > Home page is http://smartmontools.sourceforge.net/ > > === START OF INFORMATION SECTION ==> Device Model: WDC WD10EZEX-60M2NA0I looked this up and found this: http://www.wdc.com/wdproducts/library/SpecSheet/ENG/2879-771436.pdf That lists the 1TB as being advanced format. If that's the correct spec sheet then the next question is what is the workload for this drive? If it's just a boot drive and performance is not a consideration then you can leave it alone, the drive firmware will do RWM internally for the wrong alignment. But if performance is important (file sharing, database stuff, small file writes including web server), then this needs to get fixed... -- Chris Murphy
Please, download this. http://sourceforge.net/projects/bootinfoscript/ Run it: http://bootinfoscript.sourceforge.net/ Post a URL to the resulting file somewhere. I suggest having the entire computer assembled as it should be in normal use, rather than simulating device failure by removing a device. --- Chris Murphy
On Wed, 2015-08-05 at 13:11 -0400, Bowie Bailey wrote:> > # smartctl -i /dev/hdg | grep -i sector > > Sector Size: 512 bytes logical/physical> I don't get a "Sector Size" line. > > smartctl version 5.38 [i686-redhat-linux-gnu] Copyright (C) 2002-8 Bruce > AllenOn the latest Centos 5 = Centos 5.11 ~~~~~~~~~~~~~ smartctl -v smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-406.el5] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net ~~~~~~~~~~~~~ Why not do: YUM UPDATE ??? -- Regards, Paul. England, EU. England's place is in the European Union.
I never thought I'd say this, but I think it's easier to do this with GRUB 2. Anyway I did an installation to raid1's in CentOS 6's installer, which still uses GRUB legacy. I tested removing each of the two devices and it still boots. These are the commands in its log: : Running... ['/sbin/grub-install', '--just-copy'] : Running... ['/sbin/grub', '--batch', '--no-floppy', '--device-map=/boot/grub/device.map'] : grub> device (hd0) /dev/vdb : grub> root (hd0,1) : grub> install --stage2=/boot/grub/stage2 /grub/stage1 d (hd0,1) /grub/stage2 p (hd0,1)/grub/grub.conf : Running... ['/sbin/grub', '--batch', '--no-floppy', '--device-map=/boot/grub/device.map'] : grub> root (hd0,1) : grub> install --stage2=/boot/grub/stage2 /grub/stage1 d (hd0,1) /grub/stage2 p (hd0,1)/grub/grub.conf I do not know why there's a duplication of the install command. It also looks like the way it knows it's supposed to install two bootloader stage1 and stage2 to two different devices is with devices (hd0) /dev/vdb I don't know why the split referencing. (hd0) is /dev/vda and (hd1) is /dev/vdb. Weird. But it does work. hd0,1 in my case is /boot, but yours is hd0,0 since it's the first partition. So anywhere the steps above say hd0,1 you probably need hd0,0. Chris Murphy
On 08/05/2015 10:23 AM, Chris Murphy wrote:> Nothing about hd0 or hd1 gets baked into the bootloader code. It's an > absolute reference to a physical drive at the moment in time the > command is made.Is that true? If I have a system with two disks, where device.map labels one as hd0 and the other as hd1, and I swap those numbers, the resulting boot sector will differ by one bit. My understanding was that those IDs are used to map to the BIOS disk ID. Stage 2 will be read from the partition specified to the grub installer at installation, as in: grub> install --stage2=/boot/grub/stage2 /grub/stage1 d (hd0,1)/grub/stage2 p (hd0,1)/grub/grub.conf Stage 1 and 1.5 will, as far as I know, always be on (hd0), but stage2 might not be. If the BIOS device IDs specified in device.map weren't written into the boot loader, how else would it know where to look for them?