grub2 issues with multiple hdds and partitions...

General support questions
Post Reply
bigbanana69
Posts: 46
Joined: 2017/07/03 16:55:42

grub2 issues with multiple hdds and partitions...

Post by bigbanana69 » 2019/04/20 15:42:02

Hi,

I'm experiencing issues with grub2, sometimes it doesn't boots.
I'm usin 5 hdds and have 16 partition; 4 partitions on the primary disk, and on the other hdds by 3 partitions on each one.

The primary hdd has:
/boot 200mb ext2
/ 20GB xfs
swap 4GB
/home about 900GB xfs

I had labelled each partition and had put them by 'LABEL=PARTLABEL" in /etc/fstab, and then I had reinstalled grub2 on the primary hdd and clicked update with "Grub Customizer", but it still doesn't boots sometimes.

Fix?

User avatar
TrevorH
Forum Moderator
Posts: 25621
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: grub2 issues with multiple hdds and partitions...

Post by TrevorH » 2019/04/20 16:50:27

How exactly does it "not boot"? We need exact error messages and output. Vague descriptions are not enough to debug problems.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

bigbanana69
Posts: 46
Joined: 2017/07/03 16:55:42

Re: grub2 issues with multiple hdds and partitions...

Post by bigbanana69 » 2019/04/20 19:39:51

Well, grub2 shows boot menu at boot, then the kernel is selected first and I press enter and it doesn't loads so on; the monitor screen is black and the power button on the monitor blinks like there's no signal. I have to press the reset button on the PC and sometimes it loads, sometimes it doesn't.

I have been experiencing such problems with grub2 on different distributions, so the solution was that I had to label the partitions and put them by LABEL=PARTITIONLABEL instead /dev/sda1 or by UUID which is more complex in /etc/fstab... by entering the LABEL's in /etc/fstab and then I had to type 'grub-mkconfig -o /boot/grub/grub.cfg' and after that I don't have issues with grub2 and multiple partitions and hdds.

On CentOS 7 it's grubby instead of grub-mkconfig, and I did it with 'Grub customizer' which didn't did the job right (as I don't know how to use grubby).

desertcat
Posts: 557
Joined: 2014/08/07 02:17:29
Location: Tucson, AZ

Re: grub2 issues with multiple hdds and partitions...

Post by desertcat » 2019/04/23 11:43:17

bigbanana69 wrote:
2019/04/20 19:39:51
Well, grub2 shows boot menu at boot, then the kernel is selected first and I press enter and it doesn't loads so on; the monitor screen is black and the power button on the monitor blinks like there's no signal. I have to press the reset button on the PC and sometimes it loads, sometimes it doesn't.

I have been experiencing such problems with grub2 on different distributions, so the solution was that I had to label the partitions and put them by LABEL=PARTITIONLABEL instead /dev/sda1 or by UUID which is more complex in /etc/fstab... by entering the LABEL's in /etc/fstab and then I had to type 'grub-mkconfig -o /boot/grub/grub.cfg' and after that I don't have issues with grub2 and multiple partitions and hdds.

On CentOS 7 it's grubby instead of grub-mkconfig, and I did it with 'Grub customizer' which didn't did the job right (as I don't know how to use grubby).

I have pondered over your post several times and have given up each time. Here is what throws me:

"Well, grub2 shows boot menu at boot, then the kernel is selected first and I press enter [??] and it doesn't loads so on"....

First you should not have to press ENTER to boot the system. If you have properly configured your system the first kernel (the one at the top) is the kernel that which AUTOMATICALLY boots after a period of 5 seconds. In other words you have 5 seconds to select an alternate kernel -- in that case you would have to highlight and then press ENTER.

Moving on...

"I have been experiencing such problems with grub2 on different distributions, so the solution was that I had to label the partitions and put them by LABEL=PARTITIONLABEL instead /dev/sda1 or by UUID which is more complex in /etc/fstab..."

If you have been experiencing such problems on OTHER distros, that suggests that you REALLY have a screwed up system. " "LABEL=PARTITIONLABEL" ( followed by the actual partition ID, the File System Type, if it Defaults, followed by either 0 0, 1 1, or 1 2) This was the common /etc/fstab format for GRUB, not GRUB2. In CentOS 7, which uses GRUB2 the /etc/fstab format would appear something like the one below:

#
# /etc/fstab
# Created by anaconda on Tue Dec 15 08:51:54 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=fe5624d4-aeb4-466a-91b5-3cb23638cb26 / ext4 defaults 1 1
UUID=233c6120-7706-43da-8917-077997f37a80 /boot ext4 defaults 1 2
UUID=a41ddd66-3e73-4194-8e1f-631e7c9eaced /home ext4 defaults 1 2
UUID=cff8df1c-c21a-4dba-a5b2-57bbb9e9b8a4 /tmp ext4 defaults 1 2
UUID=7fb9c752-3e76-4382-9b8a-5b40a029ac8a /usr ext4 defaults 1 2
UUID=cb40f878-918f-47a6-b683-38fdf99b7c83 /var ext4 defaults 1 2
UUID=1e7fa702-5bec-4823-8c3e-7581335b6b88 /vm4 ext4 defaults 1 2
UUID=cfc7bb53-9424-4c96-84e9-f0ffde3b1627 swap swap defaults 0 0
UUID=b3be6ee2-d189-4d7a-91bf-3d4f4994f016 /backup ext4 defaults 1 2
UUID=68c35148-72ce-473d-ad42-3a831a0ff1e5 /backup2 xfs defaults 1 2

NOTICE: All of those are partitions that are accessed by my machine. Notice too that at the very bottom is a partition called /backup2. /backup2 is on an separate 2TB internal HDD, all the others refer to the 500 GB SSD on which CentOS 7.6 (now) resides. Notice too that /backup2 uses the xfs file system rather than ext4. Why?!? there is/was some talk that Red Hat may be moving towards using xfs as their default file syatem, so I used xfs as a base file system, though I doubt ext4 is going anywhere soon. As you can probably guess the /backup2 HDD is used for one thing and one thing only: the storage of my backups! Indeed the ENTIRE disk is just one 2TB partition. If I run fdisk -l the 2TB HDD shows up as /dev/sdb, where the CentOS 7.6 shows up as /dev/sda. Oh, there is another HDD in the machine: that is a 1TB HDD that holds Fedora 20 on it, and it shows up as /dev/sdc. This brings me to the GRUB2 Menu.

A word on GRUB2. I know very few people who have a good word to say about GRUB2. It is a GIANT PITA, especially if something screws it up. Grub Customizer is a great utility to have as it can bail you out of a bad situation, but it should be used in conjunction with an on disk backup of 3 essential files: /boot/grub2/grub.cfg; /etc/default/grub; and /etc/grub.d. The file most likely to get screwed up is /etc/grub.d.

If you use a file browser/editor such as Midnight Commander and go to /etc/grub.d you should have these speciality files listed:

*00_header
*00_tuned
*01_users
*06_grub-customizer_menu_color_helper
*10_linux
*20_linux_xen
*20_ppc_terminfo
*30_os-prober
*40_custom
*41_custom
README

These files *should* be in this sequential order. In a truly whacked system these files may have different numbers, names etc., etc., etc. You may need to go into ALL the files and find which are correctly numbered, named, and have the correct contents. If a file can be identified by its contents, but has the wrong number sequence, you need to rename the file back to its original name. This may or may not take a few hours to get correctly ordered.

Judging from your limited description you are trying to use a GRUB naming sequence rather than the GRUB2 UUID name sequence in /etc/fstab. I have no idea WHY you have multiple partitions spread over a gazillion drives. This is inefficient. With the price of HDD falling to obscene levels -- I bought the 2 TB drive for ~$50, and the 500GB SSD for ~$100, and now 1TB SSD's are now about $100-$115 --there is no bloody good reason you should not put an ENTIRE OS on a SINGLE DRIVE. You can put CentOS 7.6 on 1 drive, Windows (if you are one of *them*) on another , Ubuntu, on another, etc., etc. etc. Chose the OS you wish to serve as the Master Drive, and then build a custom menu in /etc/grub.d/*40_Custom. You can then boot *any* of the OS's you like from a SINGLE Custom Menu (that is how I can boot Fedora 20 [used as backup or alternative OS] from the same menu which automatically CentOS 7.6.

The simplest solution to your problem is 1) Buy a New Drive 2) Do a Fresh install of CentOS 7 3) Remove all the old drives and copy off all the OLD data you want and move to a NEW Partition you create during the install phase called /backup.

Once you have moved all the OLD data you want to save to a new location reformat all those OLD drives and then use them in various build projects. Except for my current workstation, all my computers have been hand-me-downs, and one was found by the dumpster. The first then I do in each case (besides blowing out all the dust bunnies, etc., etc., etc. ) after I test to see if I can power on the computer, is to simply reformat the drive/s, and then install Linux. Some can be set up as print servers and others as time servers, etc. -- Even Build a NEW Computer!

Best of luck
Last edited by desertcat on 2019/04/23 11:59:34, edited 1 time in total.

bigbanana69
Posts: 46
Joined: 2017/07/03 16:55:42

Re: grub2 issues with multiple hdds and partitions...

Post by bigbanana69 » 2019/04/23 11:54:08

I did something similar;

In etc/fstab I had put LABEL=PARTITIONLABEL for all parititions and I had marked only the boot partition as defaults,noatime 1 2; all others with just noatime 0 1 except for the swap partition which is marked as sw 0 0.

LABEL's work only for primary partitions; for LVM's UUID is probably the solution when using multiple hdd's and partitions. For usage on only single hdd with primary (up to 4 partitions per hdd), even /dev/sda1 style might work properly.

after editing /etc/fstab, I had typed 'grub2-mkconfig -o /boot/grub2/grub.cfg' as root, and now after these changes I think all works properly.
Last edited by bigbanana69 on 2019/04/23 17:23:54, edited 1 time in total.

User avatar
TrevorH
Forum Moderator
Posts: 25621
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: grub2 issues with multiple hdds and partitions...

Post by TrevorH » 2019/04/23 13:58:34

I'd be pretty sure you have a hardware problem with those symptoms.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

bigbanana69
Posts: 46
Joined: 2017/07/03 16:55:42

Re: grub2 issues with multiple hdds and partitions...

Post by bigbanana69 » 2019/04/23 17:29:30

Not sure about that.

I had tried few distros and on all of them I have been experiencing such grub2 problems with multiple hdds and partitions, although grub2 was working properly when using single hdd.

Then I found out that I need to (when using multiple hdds and partitions) enter in the /etc/fstab configuration like that and reconfigure the grub.cfg file.

And then it worked properly.

I did a few reboots after configuring CentOS 7.6 like that, and I haven't experienced grub2 booting problems since than.

desertcat
Posts: 557
Joined: 2014/08/07 02:17:29
Location: Tucson, AZ

Re: grub2 issues with multiple hdds and partitions...

Post by desertcat » 2019/04/23 20:57:55

bigbanana69 wrote:
2019/04/20 15:42:02
Hi,

I'm experiencing issues with grub2, sometimes it doesn't boots.
I'm usin 5 hdds and have 16 partition; 4 partitions on the primary disk, and on the other hdds by 3 partitions on each one.

[snip]

I had labelled each partition and had put them by 'LABEL=PARTLABEL" in /etc/fstab, and then I had reinstalled grub2 on the primary hdd and clicked update with "Grub Customizer", but it still doesn't boots sometimes.

Fix?
I said,"If you have been experiencing such problems on OTHER distros, that suggests that you REALLY have a screwed up system. " "LABEL=PARTITIONLABEL" This was the common /etc/fstab format for GRUB, not GRUB2.". What you are doing is NOT in fact similar to the format used in GRUB 2 which is based on the UUID system. You are trying to mix an OLD GRUB format with a the NEWER GRUB2 format. You are asking for problems.

TrevorH said, "I'd be pretty sure you have a hardware problem with those symptoms.".

You still have not answered my initial question of WHY do you need to have 16 Partitions spread over 5 HDD, rather than consolidating on a SINGLE larger drive?

You asked for a "Fix" . The "Fix" is to fix /etc/fstab so that it uses the same UUID naming system throughout, NOT some mishmash of two different systems.

The second "fix" is simply to consolidate everything onto a SINGLE larger drive. You can buy a NEW single 4 TB that should be large enough to replace the total space used buy the 5 total HDD now in use. God knows how OLD those 5 drives are, but if they are several years old they are approaching their point of failure, and ALL drive fail at some point.

You have an needlessly overly complicated system where any given failure will bring down the entire system. SIMPLIFY it! If something goes WRONG -- and it will at some point, trust me -- it will be a lot easier to troubleshoot it.

Given the limited amount of data you have provided it is almost impossible to diagnose your if problem is due to your screwed up GRUB/GRUB2 system; a screwed up /etc/fstab table; or a hardware failure.

BTW? Why are you still using an ext2 file table? Ext2 has not been used in almost a decade! The current ext file system is ext4. I am not a guru like TrevorH some of the guys on this forum, but I have been around the block more than once. That your system runs at all is more a miracle than anything else.

I have provided you with pragmatic advice. The "Fix" you are looking for is way above my meager hacking skills.

Best of luck.

bigbanana69
Posts: 46
Joined: 2017/07/03 16:55:42

Re: grub2 issues with multiple hdds and partitions...

Post by bigbanana69 » 2019/04/24 11:54:18

Speaking more correctly:

For a single hdd partitioning scheme, the /dev/sda1 style in /etc/fstab was working with grub2 correctly, while it wasn't working properly when using multiple hdds (sometimes it boots, sometimes it doesn't).
Next things are partition labels and UUID's. Patition labels work only for primary partitions (which may be up to 4 partitions on single hdd) and not working with LVM's.
Partition labels are simple and easy for configuring as they are short.
Other things are that UUID's work with both, primary and extended partitions, but the numbers are more complex to manage as they are longer and may be very different between partitions.

CentOS was automatically configuring the /etc/fstab by UUID's, but CentOS 7.6 isn't offering to configure mount points for the other partitions which are on the other hdds except for the primary hdd in use during the installation.

So I had to configure the /etc/fstab manually and update the grub.cfg file.

And if you think of using a single hdd instead of 5 smaller size hdds it would be probably a 10TB single hdd in my case.... but 10TB is a big big number, if you understand me, I prefer up to 2TB hdds, the size number is a lot smaller and it's sort of simpler/easier, unless we are speaking about a notebooks which are limited with space so a single larger hdd would be better in that case.

I even split a single 2TB hdd into 3 equal partitions. It's a lot simpler and easier to manage smaller partitions which may have a lot less folders and files instead of a single one with many many folders and files. Also I label the partitions like Music, Videos, Programs, etc, to make it simpler and easier to work with.

And you are right... I would use xfs instead of ext2 for the /boot partition too on the next install.

Post Reply