[opensuse] Upgrading from Grub1 -> Grub2 on OpenSUSE. /boot is on RAID-1. Making sure I get the Grub2 version installed right?
I inherited a machine from a relative. It was running an old version of OpenSUSE 12.3. I'm new to OpenSUSE. I upgraded it so that it's now running OpenSUSE Leap. It has 4 drives in my desktop. There's a RAID-1 array consisting of those four drives (2 as fallback) cat /proc/mdstat Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] md126 : active raid1 sdc1[2] sdb1[1] sda1[0] sdd1[3] 1060160 blocks [4/4] [UUUU] bitmap: 0/130 pages [0KB], 4KB chunk across partitions /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 That array's UUID is (e.g.) blkid /dev/md126 -s UUID /dev/md126: UUID="a1234567-0123-0123-0123-ab1234567890" The system's '/boot' partition is on that array. The rest is on an LVM on another array. /etc/fstab UUID=a1234567-0123-0123-0123-ab1234567890 /boot ext4 defaults 0 2 /dev/VG0/SYSTEM / ext4 defaults 1 1 The old system bootloader was 'old' Grub v0.97. I thought the upgrade to Leap would update automatically to Grub2. It didn't. I still have only 'old' Grub package. So now I want to upgrade it to 'new' Grub2 v2.02. I installed the Grub2 packages rpm -qa | grep -i grub2 grub2-x86_64-xen-2.02~beta2-20.10.1.x86_64 grub2-i386-pc-2.02~beta2-20.10.1.x86_64 grub2-2.02~beta2-20.10.1.x86_64 grub2-branding-openSUSE-13.2-3.6.1.noarch grub2-x86_64-efi-2.02~beta2-20.10.1.x86_64 The old Grub is still installed rpm -qa | grep -i grub- grub-0.97-200.1.3.x86_64 For grub2, I created an /etc/default/grub and executed grub2-mkconfig -o /boot/grub2/grub.cfg Now I know I need to install grub2 as the bootloader to be used on boot, instead of old grub? Is the grub2-install command the right command? When I look at that command's usage grub2-install --help Usage: grub2-install [OPTION...] [OPTION] [INSTALL_DEVICE] it says INSTALL_DEVICE must be system device filename. Since I have '/boot' partition on a 4-disk RAID-1 array, what's the right way to install grub2 as the bootloader default on that array? Do I execute grub2-install 4 times, once for each drive? grub2-install /dev/sda grub2-install /dev/sdb grub2-install /dev/sdc grub2-install /dev/sdd Of course my goal is to make sure grub2 gets used, I'm able to boot, and I have some redundancy. - Garrett -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On November 26, 2015 10:30:21 PM PST, garrett.timmins@speedymail.org wrote:
I inherited a machine from a relative. It was running an old version of OpenSUSE 12.3. I'm new to OpenSUSE. I upgraded it so that it's now running OpenSUSE Leap.
It has 4 drives in my desktop. There's a RAID-1 array consisting of those four drives (2 as fallback)
cat /proc/mdstat Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] md126 : active raid1 sdc1[2] sdb1[1] sda1[0] sdd1[3] 1060160 blocks [4/4] [UUUU] bitmap: 0/130 pages [0KB], 4KB chunk
across partitions
/dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
That array's UUID is (e.g.)
blkid /dev/md126 -s UUID /dev/md126: UUID="a1234567-0123-0123-0123-ab1234567890"
The system's '/boot' partition is on that array. The rest is on an LVM on another array.
/etc/fstab UUID=a1234567-0123-0123-0123-ab1234567890 /boot ext4 defaults 0 2 /dev/VG0/SYSTEM / ext4 defaults 1 1
The old system bootloader was 'old' Grub v0.97. I thought the upgrade to Leap would update automatically to Grub2.
It didn't. I still have only 'old' Grub package.
So now I want to upgrade it to 'new' Grub2 v2.02.
I installed the Grub2 packages
rpm -qa | grep -i grub2 grub2-x86_64-xen-2.02~beta2-20.10.1.x86_64 grub2-i386-pc-2.02~beta2-20.10.1.x86_64 grub2-2.02~beta2-20.10.1.x86_64 grub2-branding-openSUSE-13.2-3.6.1.noarch grub2-x86_64-efi-2.02~beta2-20.10.1.x86_64
The old Grub is still installed
rpm -qa | grep -i grub- grub-0.97-200.1.3.x86_64
For grub2, I created an /etc/default/grub and executed
grub2-mkconfig -o /boot/grub2/grub.cfg
Now I know I need to install grub2 as the bootloader to be used on boot, instead of old grub?
Is the
grub2-install
command the right command?
When I look at that command's usage
grub2-install --help Usage: grub2-install [OPTION...] [OPTION] [INSTALL_DEVICE]
it says
INSTALL_DEVICE must be system device filename.
Since I have '/boot' partition on a 4-disk RAID-1 array, what's the right way to install grub2 as the bootloader default on that array?
Do I execute grub2-install 4 times, once for each drive?
grub2-install /dev/sda grub2-install /dev/sdb grub2-install /dev/sdc grub2-install /dev/sdd
Of course my goal is to make sure grub2 gets used, I'm able to boot, and I have some redundancy.
- Garrett
What was wrong with regular old grub? Why mess with that? -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Fri, Nov 27, 2015 at 9:36 AM, John Andersen <jsamyth@gmail.com> wrote:
What was wrong with regular old grub?
YaST dropped support for it? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrei Borzenkov composed on 2015-11-27 09:45 (UTC+0300):
John Andersen wrote:
What was wrong with regular old grub?
YaST dropped support for it?
If Grub Legacy wasn't broke on OP's system, OP doesn't *need* YaST to fix it. All my Leap installations are booting from Grub Legacy, RAID or otherwise. Whether OP *wants* Grub2 is another matter. As OP was written, it seems to me he does, but didn't say why. -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Fri, Nov 27, 2015 at 9:30 AM, <garrett.timmins@speedymail.org> wrote:
I inherited a machine from a relative. It was running an old version of OpenSUSE 12.3. I'm new to OpenSUSE. I upgraded it so that it's now running OpenSUSE Leap.
It has 4 drives in my desktop. There's a RAID-1 array consisting of those four drives (2 as fallback)
cat /proc/mdstat Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] md126 : active raid1 sdc1[2] sdb1[1] sda1[0] sdd1[3] 1060160 blocks [4/4] [UUUU] bitmap: 0/130 pages [0KB], 4KB chunk ...
Now I know I need to install grub2 as the bootloader to be used on boot, instead of old grub?
Is the
grub2-install
command the right command?
No. You always should change bootloader using YaST bootloader module. This ensures that configuration is correctly updated and the right bootloader will be reconfigured when you add/remove kernels.
Since I have '/boot' partition on a 4-disk RAID-1 array, what's the right way to install grub2 as the bootloader default on that array?
You should install GRUB2 in MBR of each disk if you want full redundancy.
Do I execute grub2-install 4 times, once for each drive?
grub2-install /dev/sda grub2-install /dev/sdb grub2-install /dev/sdc grub2-install /dev/sdd
Yes, at this time this means running grub-install 4 times. Unfortunately I am not sure whether YaST actually supports this configuration. It does support 2-way mirror (i.e. RAID1 consisting of two drives). In this case you should see checkbox "Enable MD redundancy" or similar' checking it (it is not default) will cause YaST to automatically configure bootloader location in MBR of each drive. Try going in YaST bootloader and see what it offers when you change bootloader type to GRUB2.
Of course my goal is to make sure grub2 gets used, I'm able to boot, and I have some redundancy.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrei
command the right command?
No. You always should change bootloader using YaST bootloader module. This ensures that configuration is correctly updated and the right bootloader will be reconfigured when you add/remove kernels.
I'll use the UI but I'd like to also understand what the UI's doing. Is there a guide to the equivalent manual steps that using the UI represents?
Since I have '/boot' partition on a 4-disk RAID-1 array, what's the right way to install grub2 as the bootloader default on that array?
You should install GRUB2 in MBR of each disk if you want full redundancy.
Just to be clear, that means which of the two boxes in the UI [ ] Boot from Master Record [ ] Write Generic Boot Code to MBR ?
Do I execute grub2-install 4 times, once for each drive?
grub2-install /dev/sda grub2-install /dev/sdb grub2-install /dev/sdc grub2-install /dev/sdd
Yes, at this time this means running grub-install 4 times.
Unfortunately I am not sure whether YaST actually supports this configuration. It does support 2-way mirror (i.e. RAID1 consisting of two drives). In this case you should see checkbox "Enable MD redundancy" or similar' checking it (it is not default) will cause YaST to automatically configure bootloader location in MBR of each drive.
In that same Yast2 module? In the BootLoader module I don't find any redundancy-related checkbox. But at the Yast2 BootLoader module's Boot Loader Settings > Boot Code Options > Boot Loader Installation Details I do get a dialog that lists four drives by-id Disk Order Disks /dev/disk/by-id/ata-ST31000528AS_AAAAAAAAA@ /dev/disk/by-id/ata-ST31000528AS_BBBBBBBB@ /dev/disk/by-id/ata-ST31000528AS_CCCCCCCC@ /dev/disk/by-id/ata-ST31000528AS_DDDDDDDD@ Checking with readlink I verify that those correspond in order to /dev/sda /dev/sdc /dev/sdb /dev/sdd The "Help" there says Disks Order To specify the order of the disks according to the order in BIOS, use the Up and Down buttons to reorder the disks. To add a disk, push Add. To remove a disk, push Remove. doesn't specify that all four of those drive will get written with Grub2 info. And more specifically if the right boxes are checked that all 4 MBRs will get written. How can I verify that all four drives get the data? - Garrett -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
27.11.2015 17:26, garrett.timmins@speedymail.org пишет:
Andrei
command the right command?
No. You always should change bootloader using YaST bootloader module. This ensures that configuration is correctly updated and the right bootloader will be reconfigured when you add/remove kernels.
I'll use the UI but I'd like to also understand what the UI's doing.
Is there a guide to the equivalent manual steps that using the UI represents?
Not that I'm aware of. Sources are open if you are really interested.
Since I have '/boot' partition on a 4-disk RAID-1 array, what's the right way to install grub2 as the bootloader default on that array?
You should install GRUB2 in MBR of each disk if you want full redundancy.
Just to be clear, that means which of the two boxes in the UI
[ ] Boot from Master Record [ ] Write Generic Boot Code to MBR
?
None of them. MBR here means "MBR of the first disk", in whatever disk order YaST finds them.
Do I execute grub2-install 4 times, once for each drive?
grub2-install /dev/sda grub2-install /dev/sdb grub2-install /dev/sdc grub2-install /dev/sdd
Yes, at this time this means running grub-install 4 times.
Unfortunately I am not sure whether YaST actually supports this configuration. It does support 2-way mirror (i.e. RAID1 consisting of two drives). In this case you should see checkbox "Enable MD redundancy" or similar' checking it (it is not default) will cause YaST to automatically configure bootloader location in MBR of each drive.
In that same Yast2 module? In the BootLoader module I don't find any redundancy-related checkbox.
What exactly you did? Which bootloader is currently selected?
But at the Yast2 BootLoader module's
Boot Loader Settings > Boot Code Options > Boot Loader Installation Details
I do get a dialog that lists four drives by-id
Disk Order
That is irrelevant (it only affects which disk is considered first for MBR install). ...
How can I verify that all four drives get the data?
One possibility is https://github.com/arvidjaar/bootinfoscript -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrei
Is there a guide to the equivalent manual steps that using the UI represents?
Not that I'm aware of. Sources are open if you are really interested.
I'll put that on my todo list. For not, using the UI.
Just to be clear, that means which of the two boxes in the UI
[ ] Boot from Master Record [ ] Write Generic Boot Code to MBR
?
None of them. MBR here means "MBR of the first disk", in whatever disk order YaST finds them.
Okay, I UNchecked both of those.
In that same Yast2 module? In the BootLoader module I don't find any redundancy-related checkbox.
What exactly you did? Which bootloader is currently selected?
Open YaST Control Center Open System:BootLoader BooLoader == GRUB2 Here's a screenshot: http://snag.gy/6qV33.jpg
I do get a dialog that lists four drives by-id
Disk Order
That is irrelevant (it only affects which disk is considered first for MBR install). ...
Ah okay. I thought it might be listing all the disk Grub gets installed to. Not. Just the 1st that gets looked at.
How can I verify that all four drives get the data?
One possibility is https://github.com/arvidjaar/bootinfoscript
After setting up the Yast screen like above and executing the install from the UI then running that script I get Saviing Boot Loader Configuration [X] Create initrd [X] Save boot loader configuration files -> Install boot loader Then a YaST2 dialog An error occurred during boot loader installation. Retry boot loader configuration? [Yes] [No] Retrying just gets you the same error. No related output in the system logs. - Garrett -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
27.11.2015 21:18, garrett.timmins@speedymail.org пишет:
Andrei
Is there a guide to the equivalent manual steps that using the UI represents?
Not that I'm aware of. Sources are open if you are really interested.
I'll put that on my todo list. For not, using the UI.
Just to be clear, that means which of the two boxes in the UI
[ ] Boot from Master Record [ ] Write Generic Boot Code to MBR
?
None of them. MBR here means "MBR of the first disk", in whatever disk order YaST finds them.
Okay, I UNchecked both of those.
In that same Yast2 module? In the BootLoader module I don't find any redundancy-related checkbox.
What exactly you did? Which bootloader is currently selected?
Open YaST Control Center Open System:BootLoader BooLoader == GRUB2 Here's a screenshot: http://snag.gy/6qV33.jpg
I checked and this option is offered only if there are exactly two disks RAID1. Sorry. You can manually edit /etc/default/grub_installdevice and add each disk; it is the file that is used by update-bootloader so if it is correct subsequent bootloader updates should be correct as well. But I'm afraid it means you won't be able to edit bootloader configuration by YaST then.
An error occurred during boot loader installation. Retry boot loader configuration? [Yes] [No]
Well, if you unchecked everything this may be expected. I never really tried it, although update-bootloader should work.
Retrying just gets you the same error.
No related output in the system logs.
Logs are in /var/log/YaST2, starting point is y2log; and /var/log/pbl.log. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrei
I checked and this option is offered only if there are exactly two disks RAID1. Sorry.
You can manually edit /etc/default/grub_installdevice and add each disk; it is the file that is used by update-bootloader so if it is correct subsequent bootloader updates should be correct as well. But I'm afraid it means you won't be able to edit bootloader configuration by YaST then.
I'm ok with manual files. Prefer them, fewer surprises. That file exists here but it's empty. I can't find Suse documentation for its usage yet.
From other distros I figure I'd add those four disks as
/etc/default/grub_installdevice /dev/disk/by-id/ata-ST31000528AS_AAAAAAAA /dev/disk/by-id/ata-ST31000528AS_BBBBBBBB /dev/disk/by-id/ata-ST31000528AS_CCCCCCCC /dev/disk/by-id/ata-ST31000528AS_DDDDDDDD activate for d in /dev/disk/by-id/ata* do ls $d readlink -f $d echo -e "\n" done ... /dev/disk/by-id/ata-ST31000528AS_AAAAAAAA /dev/sda /dev/disk/by-id/ata-ST31000528AS_BBBBBBBB /dev/sdc /dev/disk/by-id/ata-ST31000528AS_CCCCCCCC /dev/sdb /dev/disk/by-id/ata-ST31000528AS-DDDDDDDD /dev/sdd ... /etc/default/grub_installdevice /dev/disk/by-id/ata-ST31000528AS_AAAAAAAA /dev/disk/by-id/ata-ST31000528AS_BBBBBBBB /dev/disk/by-id/ata-ST31000528AS_CCCCCCCC /dev/disk/by-id/ata-ST31000528AS-DDDDDDDD activate update-bootloader --reinit tail -f /var/log/YaST/y2log /var/log/pbl.log ... { '/etc/default/grub_installdevice' => [ '/dev/disk/by-id/ata-ST31000528AS_AAAAAAAA', '/dev/disk/by-id/ata-ST31000528AS_BBBBBBBB', '/dev/disk/by-id/ata-ST31000528AS_CCCCCCCC', '/dev/disk/by-id/ata-ST31000528AS-DDDDDDDD', 'activate', '' ] } 2015-11-27 11:11:12 <1> pbl-7539.2 Core::GRUB2::InitializeBootloader.1356: devices = [ '/dev/disk/by-id/ata-ST31000528AS_AAAAAAAA', '/dev/disk/by-id/ata-ST31000528AS_BBBBBBBB', '/dev/disk/by-id/ata-ST31000528AS_CCCCCCCC', '/dev/disk/by-id/ata-ST31000528AS-DDDDDDDD', 'activate', '' ] 2015-11-27 11:11:37 <1> pbl-7539.2 Core::RunCommand.1654: '/usr/sbin/grub2-install --target=i386-pc --force --skip-fs-probe "/dev/disk/by-id/ata-ST31000528AS_AAAAAAAA"' = 0, output: <<<<<<<<<<<<<<<< Installing for i386-pc platform. Installation finished. No error reported. >>>>>>>>>>>>>>>> 2015-11-27 11:12:00 <1> pbl-7539.2 Core::RunCommand.1654: '/usr/sbin/grub2-install --target=i386-pc --force --skip-fs-probe "/dev/disk/by-id/ata-ST31000528AS_BBBBBBBB"' = 0, output: <<<<<<<<<<<<<<<< Installing for i386-pc platform. Installation finished. No error reported. >>>>>>>>>>>>>>>> 2015-11-27 11:12:24 <1> pbl-7539.2 Core::RunCommand.1654: '/usr/sbin/grub2-install --target=i386-pc --force --skip-fs-probe "/dev/disk/by-id/ata-ST31000528AS_CCCCCCCC"' = 0, output: <<<<<<<<<<<<<<<< Installing for i386-pc platform. Installation finished. No error reported. >>>>>>>>>>>>>>>> 2015-11-27 11:12:44 <1> pbl-7539.2 Core::RunCommand.1654: '/usr/sbin/grub2-install --target=i386-pc --force --skip-fs-probe "/dev/disk/by-id/ata-ST31000528AS-DDDDDDDD"' = 0, output: <<<<<<<<<<<<<<<< Installing for i386-pc platform. Installation finished. No error reported. >>>>>>>>>>>>>>>> 2015-11-27 11:13:07 <3> pbl-7539.2 Core::RunCommand.1658: Error: '/usr/sbin/grub2-install --target=i386-pc --force --skip-fs-probe ""' failed with exit code 1, output: <<<<<<<<<<<<<<<< Installing for i386-pc platform. /usr/sbin/grub2-install: error: cannot find a GRUB drive for . Check your device.map. >>>>>>>>>>>>>>>> Not sure what to do with that. cat /boot/grub2/device.map cat /boot/grub2/device.map (hd0) /dev/disk/by-id/ata-ST31000528AS_AAAAAAAA (hd1) /dev/disk/by-id/ata-ST31000528AS_BBBBBBBB (hd2) /dev/disk/by-id/ata-ST31000528AS_CCCCCCCC (hd3) /dev/disk/by-id/ata-ST31000528AS_DDDDDDDD
An error occurred during boot loader installation. Retry boot loader configuration? [Yes] [No]
Well, if you unchecked everything this may be expected. I never really tried it, although update-bootloader should work.
I'm a little confused then. I asked which boxes to check
Just to be clear, that means which of the two boxes in the UI
[ ] Boot from Master Record [ ] Write Generic Boot Code to MBR
?
You said
None of them. MBR here means "MBR of the first disk", in whatever disk order YaST finds them.
So I unchecked both of them. Not the right action? - Garrett -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Looks like I had a blank line in both /etc/default/grub_installdevice & /boot/grub2/device.map that was making the updatebootloader unhappy. Removing them BOTH and leaving the rest as before now updatebootloader --reinit updatebootloader --refresh works OK. After, your script shows grep "MBR " ~/RESULTS2.txt -A1 -B1 => Grub2 (v2.00) is installed in the MBR of /dev/sda and looks at sector 1 of the same hard drive for core.img. core.img is at this location and looks -- --------------------------------------------------------------------------- => Grub2 (v2.00) is installed in the MBR of /dev/sdb and looks at sector 1 of the same hard drive for core.img. core.img is at this location and looks -- --------------------------------------------------------------------------- => Grub2 (v2.00) is installed in the MBR of /dev/sdc and looks at sector 1 of the same hard drive for core.img. core.img is at this location and looks -- --------------------------------------------------------------------------- => Grub2 (v2.00) is installed in the MBR of /dev/sdd and looks at sector 1 of the same hard drive for core.img. core.img is at this location and looks So looks like I have Grub2 on all four RAID-1 array disks' MBR. Haven't tried yet to reboot this. Gonna look at it some more. - Garrett -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
27.11.2015 23:17, garrett.timmins@speedymail.org пишет:
Looks like I had a blank line in both /etc/default/grub_installdevice & /boot/grub2/device.map that was making the updatebootloader unhappy.
Removing them BOTH and leaving the rest as before now
updatebootloader --reinit updatebootloader --refresh
works OK.
Well, that leaves you in exactly the same situation as you have been before - update-bootloader works, YaST does not. That returns us to the question that was asked here already - what was the reason for switching bootloader in the first place? :) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
27.11.2015 22:25, garrett.timmins@speedymail.org пишет:
Well, if you unchecked everything this may be expected. I never really tried it, although update-bootloader should work.
I'm a little confused then.
I asked which boxes to check
Just to be clear, that means which of the two boxes in the UI
[ ] Boot from Master Record [ ] Write Generic Boot Code to MBR
?
You said
None of them. MBR here means "MBR of the first disk", in whatever disk order YaST finds them.
So I unchecked both of them. Not the right action?
You asked which of two check boxes is responsible for installing bootloader on each disk in Linux MD and I said "none of them". It did not imply "you should uncheck everything and go ahead". -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (4)
-
Andrei Borzenkov
-
Felix Miata
-
garrett.timmins@speedymail.org
-
John Andersen