LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-04-2016, 06:10 PM   #1
ag33k
Member
 
Registered: Mar 2013
Location: Portugal
Distribution: Slackware
Posts: 98

Rep: Reputation: Disabled
Grub2 configuration with /boot on different partition


Hello

My Slackware64 13.2 setup is:

Code:
$fdisk /dev/sdb

Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sdb: 931.4 GiB, 1000120975360 bytes, 1953361280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 66F6F422-C1DC-4EC6-A111-387DE963444C

Device         Start        End    Sectors   Size Type
/dev/sdb1       2048   16779263   16777216     8G Linux swap
/dev/sdb2   16779264   18876415    2097152     1G Linux filesystem
/dev/sdb3   18876416  184551423  165675008    79G Linux filesystem
/dev/sdb4  184551424 1953361246 1768809823 843.4G Linux filesystem
/dev/sdb2 is /boot
/dev/sdb3 is /
/dev/sdb4 is /home

Code:
$ls -lF /dev/disk/by-uuid/
lrwxrwxrwx 1 root root 10 Nov  4  2016 068586c4-464a-4d4e-82bf-ac94f7d7c6ac -> ../../sda8
lrwxrwxrwx 1 root root 10 Nov  4  2016 07E619850D196770 -> ../../sda3
lrwxrwxrwx 1 root root 10 Nov  3 23:02 18936490-953b-4c52-b5c5-4bb7bd80a2c5 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Nov  3 22:58 2016-06-30-18-21-58-24 -> ../../sdh1
lrwxrwxrwx 1 root root 10 Nov  3 22:58 250013e7-a880-4188-8e1e-206d9e0e314e -> ../../sdc1
lrwxrwxrwx 1 root root 10 Nov  4  2016 5C1608A216087F70 -> ../../sda2
lrwxrwxrwx 1 root root 10 Nov  4  2016 5e910aed-4a4f-46ff-8f8d-d72a8cc08efb -> ../../sda7
lrwxrwxrwx 1 root root 10 Nov  3 22:58 67F7-C764 -> ../../sdh2
lrwxrwxrwx 1 root root 10 Nov  4  2016 6d0164ce-24cd-4fa4-afe0-93901c3c9e20 -> ../../sda6
lrwxrwxrwx 1 root root 10 Nov  4  2016 CA1E05A41E058AA1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Nov  3 23:02 b60d3b8f-02de-4142-8387-804e73fbba0a -> ../../sdb3
lrwxrwxrwx 1 root root 10 Nov  4  2016 bd4aa644-f2c0-414e-af0c-6503a6ade714 -> ../../sda5
lrwxrwxrwx 1 root root 10 Nov  3 23:02 bf4d4304-3003-4a5e-be37-b8d54f5b49cc -> ../../sdb4
lrwxrwxrwx 1 root root 10 Nov  3 23:02 c3039827-d728-4151-b68f-68a4abbca35e -> ../../sdb2
My settings /etc/grud.d/40_custom

Code:
!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "Slackware 14.2" --class slackware --class gnu --class os {
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos3)'
    search --no-floppy --fs-uuid --set=root b60d3b8f-02de-4142-8387-804e73fbba0a
    linux /boot/vmlinuz root=UUID=b60d3b8f-02de-4142-8387-804e73fbba0a ro vga=793 quiet nomodeset
    initrd /boot/initrd.gz

}

#menuentry 'Microsoft Windows 7 or Windows 8 (on sda)' --class windows {
#        insmod part_msdos
#        insmod ntfs
#        insmod search_fs_uuid
#        insmod ntldr
#        search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 CA1E05A41E058AA1
#        drivemap (hd1,msdos1) (hd0,msdos1)
        #Or, "drivemap (hd1,msdos2) (hd0,msdos1)" for those with Windows installed on sdb2)
#        ntldr /bootmgr
#}

menuentry "OpenELEC" --class openelec {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos6)'
    linux /KERNEL boot=/dev/sda6 disk=/dev/sda7 quiet
}

menuentry "OpenELEC debugging" --class openelec {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos6)'
    linux /KERNEL boot=/dev/sda6 disk=/dev/sda7 debugging
}

menuentry "System restart" {                             
    echo "System rebooting..."                           
    reboot                                               
}                                                        
                                                         
menuentry "System shutdown" {                            
    echo "System shutting down..."                       
    halt                          
}
I can't boot!
I receive a message that it can't find /boot/vmlinuz.

I know that is because I set root as /dev/sdb3

How I can setup grub to use /boot/ one a different partition?
In this case my /boot is on /dev/sdb2

Sorry that this not a Slackware question!
But I'm using Slackware!
 
Old 11-04-2016, 06:34 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Code:
    linux /boot/vmlinuz root=UUID=b60d3b8f-02de-4142-8387-804e73fbba0a ro vga=793 quiet nomodeset

Is this the correct UUID?

------------------------
Steve Stites
 
Old 11-04-2016, 06:38 PM   #3
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Use the interactive abilities of grub to figure out what should be the correct boot parameters.

That's the great thing about grub over lilo; if you mess up your grub configuration, you can interactively configure your boot.
 
Old 11-05-2016, 10:27 AM   #4
petelq
Member
 
Registered: Aug 2008
Location: Yorkshire
Distribution: openSUSE(Leap and Tumbleweed) and a (not so) regularly changing third and fourth
Posts: 627

Rep: Reputation: Disabled
I think Slackware entry should be (hd1,msdos2).
 
Old 11-05-2016, 03:54 PM   #5
ag33k
Member
 
Registered: Mar 2013
Location: Portugal
Distribution: Slackware
Posts: 98

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jailbait View Post
Code:
    linux /boot/vmlinuz root=UUID=b60d3b8f-02de-4142-8387-804e73fbba0a ro vga=793 quiet nomodeset

Is this the correct UUID?

------------------------
Steve Stites
That is the UUID of /dev/sdb3 or /

I will try to put the UUID of /dev/sdb2 (/boot) there. And test it.
 
Old 11-05-2016, 05:18 PM   #6
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
the "set root" line tells grub what partition vmlinuz is on, so should be set root = '(hd1,msdos2)' and the root=(some uuid) in the linux line should be the uuid of the partition the slackware root system is on which in your case should be the uuid of sdb3.

Last edited by colorpurple21859; 11-05-2016 at 05:21 PM.
 
Old 11-05-2016, 07:18 PM   #7
ag33k
Member
 
Registered: Mar 2013
Location: Portugal
Distribution: Slackware
Posts: 98

Original Poster
Rep: Reputation: Disabled
Thank you all for the help.
It's working now!


Quote:
Originally Posted by Richard Cranium View Post
Use the interactive abilities of grub to figure out what should be the correct boot parameters.

That's the great thing about grub over lilo; if you mess up your grub configuration, you can interactively configure your boot.
Yes that's right!
I followed this guide to help me boot Slackware.

https://www.linux.com/learn/how-resc...g-grub-2-linux

And after changed my /etc/grub.d/40_custom

Quote:
Originally Posted by colorpurple21859 View Post
the "set root" line tells grub what partition vmlinuz is on, so should be set root = '(hd1,msdos2)' and the root=(some uuid) in the linux line should be the uuid of the partition the slackware root system is on which in your case should be the uuid of sdb3.

Slackware entry is this one

Code:
menuentry "Slackware 14.2" --class slackware --class gnu --class os {                                                                                                
    insmod part_msdos                                                                                                                                                
    insmod ext2                                                                                                                                                      
    set root='(hd1,gpt2)'  # /boot partition                                                                                                                                     
    search --no-floppy --fs-uuid --set=root c3039827-d728-4151-b68f-68a4abbca35e #UUID /boot                                                                                     
    linux /vmlinuz root=UUID=b60d3b8f-02de-4142-8387-804e73fbba0a ro vga=793 quiet nomodeset                                                                         
    initrd /initrd.gz                                                                                                                                                
}
In
Code:
linux /vmlinuz root=UUID=b60d3b8f-02de-4142-8387-804e73fbba0a ro vga=793 quiet nomodeset

UUID=b60d3b8f-02de-4142-8387-804e73fbba0a is the UUID of /

/dev/sdb2 /boot
/dev/sdb3 /
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to get grub2 to boot a distro in a logical partition Higgsboson Linux - Newbie 7 02-10-2016 02:35 PM
[SOLVED] Can't get encrypted root partition to boot using grub2 spudgunner Slackware 15 01-15-2014 07:15 AM
Grub2 can't boot despite a seperate /boot partition rdantuma Ubuntu 2 08-13-2012 11:53 AM
[SOLVED] GRUB2 - Boot to Partition with Custom Bootloader snmcdonald Linux - General 2 01-04-2012 03:21 PM
[SOLVED] Grub2, moving /boot to separate partition qrange Linux - Software 8 10-25-2011 11:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration