LinuxQuestions.org
Visit Jeremy's Blog.
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 03-12-2021, 04:16 PM   #1
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,443

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
slackware64-14.2 : Error booting kernel generic on /dev/sda2


Hi,

VBox with slackware64 14.2, fresh install
Boot on huge kernel : nothing to report
Boot on generic kernel (initrd.gz made with the shell script in /usr/share/mkinitrd/) :
just after insmod part :
Code:
mount: mounting /dev/sda2 on /mnt failed : No such device
ERROR: No /sbin/init found on rootdev (or not mounted). Trouble ahead.
My fstab:
Code:
/dev/sda1 swap swap defaults 0 0
/dev/sda2 / ext4 defaults 1 1
My lilo.conf (generic part):
Code:
image: /boot/vmlinuz-generic-4.4.240
  initrd = /boot/initrd.gz
  root = /dev/sda2
  label = 4.4.240
  read-only
fdisk -l :
Code:
/dev/sda1   ... 2G 82 Linux swap
/dev/sda2 * ... 20G 83 Linux
Is it not recommended to put the / on the 2nd partition in the case of a generic kernel ?

Last edited by marav; 03-12-2021 at 04:17 PM.
 
Old 03-12-2021, 04:53 PM   #2
slac
Member
 
Registered: May 2019
Posts: 265

Rep: Reputation: Disabled
Post

Quote:
Originally Posted by marav View Post
Hi,
Code:
mount: mounting /dev/sda2 on /mnt failed : No such device
ERROR: No /sbin/init found on rootdev (or not mounted). Trouble ahead.
That is a little bit weird. Your root device is /dev/sda2 and it says it does not exist and it even says it would be mounted to /mnt instead of /.

At least you can boot using kernel-huge. Check very well your /etc/fstab from beginning to end. Also, could you show the command that the script in /usr/share/mkinitrd/ gives you (?)

Last edited by slac; 03-12-2021 at 05:08 PM. Reason: spell-checking
 
Old 03-12-2021, 05:09 PM   #3
quickbreakfast
Member
 
Registered: Oct 2015
Location: northern territory
Distribution: slackware 15
Posts: 338

Rep: Reputation: Disabled
Quote:
Originally Posted by marav View Post
Hi,

VBox with slackware64 14.2, fresh install
Boot on huge kernel : nothing to report
I find the lack of a dash between the words huge kernel curious. My 14.2 system has those words reversed and there is a dash (-) between them. Is this a typo?

Quote:
fdisk -l :
Code:
/dev/sda1   ... 2G 82 Linux swap
/dev/sda2 * ... 20G 83 Linux
Is it not recommended to put the / on the 2nd partition in the case of a generic kernel ?
To boot, my machine required a EFI partition, even though it is not used, so your lack of a EFI partition has me asking why it wasn't required.

Which made my swap partition /dev/sda3, because / is /dev/sda2. And EFI is /dev/sda1.

After posting what is above I noticed your fstab has a swap partition doesn't indicate a mount point. It says swap swap. Shouldn't that be /swap swap ?

Last edited by quickbreakfast; 03-12-2021 at 05:15 PM.
 
Old 03-12-2021, 05:11 PM   #4
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,443

Original Poster
Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
I don't think it will help ... but here it is :
Code:
bash-4.3# /usr/share/mkinitrd/mkinitrd_command_generator.sh 
#
# mkinitrd_command_generator.sh revision 1.45
#
# This script will now make a recommendation about the command to use
# in case you require an initrd image to boot a kernel that does not
# have support for your storage or root filesystem built in
# (such as the Slackware 'generic' kernels').
# A suitable 'mkinitrd' command will be:

mkinitrd -c -k 4.4.240 -f ext4 -r /dev/sda2 -m jbd2:mbcache:ext4 -u -o /boot/initrd.gz
I'm on slackware64-current for a while, with /dev/sda1 on /
nothing to report

My question is just : If I use a generic kernel, is it not recommended or not to put the / on the 2nd partition ?
It's just a VM, I don't want anyone to waste time on this if it's not appropriate

Last edited by marav; 03-12-2021 at 05:16 PM.
 
Old 03-12-2021, 05:29 PM   #5
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,077

Rep: Reputation: Disabled
Quote:
Originally Posted by marav View Post
My question is just : If I use a generic kernel, is it not recommended or not to put the / on the 2nd partition ?
It's just a VM, I don't want anyone to waste time on this if it's not appropriate
I don't know, but why bother? Just set up a swap file instead of a swap partition in the VM.
 
Old 03-12-2021, 05:33 PM   #6
slac
Member
 
Registered: May 2019
Posts: 265

Rep: Reputation: Disabled
Exclamation

I do not understand what you refer to by saying:

Quote:
Originally Posted by marav View Post

My question is just : If I use a generic kernel, is it not recommended or not to put the / on the 2nd partition ?
As a supposition if you are referring to "/dev/sda2 / ext4 defaults 1 1" ["/"] in /etc/fstab then it should not matter, it is all right to have it there.

This MAY BE the solution: What are you using to boot up? Lilo or grub? Because if you are using lilo you need to execute "lilo" as root every time you rebuild the mkinitrd or "eliloconfig" if you are using EFI.
 
Old 03-12-2021, 05:35 PM   #7
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,443

Original Poster
Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by Didier Spaier View Post
I don't know, but why bother? Just set up a swap file instead of a swap partition in the VM.
I probably misspoke, sorry
In fact, this is a fresh install, everything is by default
The worry does not come from the swap
The choice of partitioning being left to the user's discretion, I just wanted to know if it was a good idea or not to put the / on /dev/sda2 ?
In summary :
Either it's not a good idea
Either it doesn't matter, in this case, there is a problem with the generic kernel when the / is positioned on the 2nd partition

Last edited by marav; 03-12-2021 at 05:43 PM.
 
Old 03-12-2021, 05:52 PM   #8
baumei
Member
 
Registered: Feb 2019
Location: USA; North Carolina
Distribution: Slackware 15.0 (replacing 14.2)
Posts: 365

Rep: Reputation: 124Reputation: 124
The generic kernel does not have any problem having "/" on "/dev/sda2", nor on any other partition which I have used.

Recently, on actual hardware, I did run into a situation where the huge-kernel would boot a particular computer just fine, but the generic-kernel would not. The solution was that I needed to give mkinitrd a list of modules to use during booting, so that the kernel would be able to access the hard-drive --- the problem was in figuring out which modules. Eventually, I figured it out. This computer is using the generic-kernel and has "/" on "/dev/sda2".

Last edited by baumei; 03-12-2021 at 06:02 PM.
 
Old 03-12-2021, 05:53 PM   #9
quickbreakfast
Member
 
Registered: Oct 2015
Location: northern territory
Distribution: slackware 15
Posts: 338

Rep: Reputation: Disabled
Quote:
Originally Posted by marav View Post
I probably misspoke, sorry
In fact, this is a fresh install, everything is by default
The worry does not come from the swap
Maybe not.

But in post #1 your fstab doesn't have a swap mount point, (aka /swap) so I'll bet when the computer goes looking for partition number 2 (your root partition) it doesn't find a second mounted partition.

So humour me and in your fstab give your swap a mount point.

Quote:
The choice of partitioning being left to the user's discretion, I just wanted to know if it was a good idea or not to put the / on /dev/sda2 ?
In summary :
Either it's not a good idea
If putting your root partition as /dev/sda2 is the default suggestion, then it's a good idea.

Last edited by quickbreakfast; 03-12-2021 at 05:56 PM.
 
Old 03-12-2021, 05:54 PM   #10
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,443

Original Poster
Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Ok

I finally found the problem
By default swap entry in fstab is
Code:
 
/dev/sdaX swap swap defaults 0 0
And everything boot well with
Code:
/dev/sdaX none swap defaults 0 0
I think this is probably an issue if / is positioned on /dev/sda2

Last edited by marav; 03-12-2021 at 05:57 PM.
 
Old 03-12-2021, 05:55 PM   #11
slac
Member
 
Registered: May 2019
Posts: 265

Rep: Reputation: Disabled
Post

Quote:
Originally Posted by marav View Post
I just wanted to know if it was a good idea or not to put the / on /dev/sda2 ?
In summary :
Either it's not a good idea
Either it doesn't matter, in this case, there is a problem with the generic kernel when the / is positioned on the 2nd partition
I think I get what you are saying now. Basically, you want if there could be a problem if you put the root filesystem ("/") in a block device that is not the 1st one (/dev/sda1), in this case, having root in /dev/sda2. Well... About that, if you are using a gpt partition scheme then it should not matter at all, you can have the root partition in /dev/sda1 or /dev/sda61, or maybe inside of an LVM, RAID or encrypted container, it does not matter. But if you are using MBR then you need to put the root partition in a PRIMARY partition and not in a logical partition, you can only have up to 4 primary partitions in MBR, also if /boot is separated it must be a primary partition.
 
Old 03-12-2021, 05:56 PM   #12
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,443

Original Poster
Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by quickbreakfast View Post
Maybe not.

But in post #1 your fstab doesn't have a swap mount point, (aka /swap) so I'll bet when the computer goes looking for partition number 2 (your root partition) it doesn't find a second partition.

So humour me and in your fstab give your swap a mount point.



If putting your root partition as /dev/sda2 is the default suggestion, then it's a good idea.
/swap never existed
see : man fstab
Code:
The second field (fs_file).
This field describes the mount point (target) for the filesystem.  
For swap partitions, this field should be specified as `none'. 
If the name of the mount point contains spaces or tabs these 
can be escaped as `\040' and '\011' respectively.

Last edited by marav; 03-12-2021 at 06:00 PM.
 
Old 03-12-2021, 06:08 PM   #13
Aeterna
Senior Member
 
Registered: Aug 2017
Location: Terra Mater
Distribution: VM Host: Slackware-current, VM Guests: Artix, Venom, antiX, Gentoo, FreeBSD, OpenBSD, OpenIndiana
Posts: 1,018

Rep: Reputation: Disabled
Quote:
Originally Posted by quickbreakfast View Post
...To boot, my machine required a EFI partition, even though it is not used, so your lack of a EFI partition has me asking why it wasn't required.
because VB has nothing to do with bare bone metal EFI requirements of lack of thereof. This is virtual setup. I have VB clients with EFI and without EFI formatted/configured

Last edited by Aeterna; 03-12-2021 at 06:09 PM.
 
Old 03-12-2021, 06:09 PM   #14
baumei
Member
 
Registered: Feb 2019
Location: USA; North Carolina
Distribution: Slackware 15.0 (replacing 14.2)
Posts: 365

Rep: Reputation: 124Reputation: 124
According to my understanding
Code:
/dev/sda[x]   swap   swap   defaults   0   0
is correct for a swap partition. All of my computers have this in "/etc/fstab", and swapping works fine.
 
Old 03-12-2021, 06:10 PM   #15
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,443

Original Poster
Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by baumei View Post
According to my understanding
Code:
/dev/sda[x]   swap   swap   defaults   0   0
is correct for a swap partition. All of my computers have this in "/etc/fstab", and swapping works fine.
I agree
I have the same on my slackware-current
But I also have the / on /dev/sda1
 
  


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] Problem upgrading to new kernel 5.3.0-45-generic from 4.18.0-25-generic fgonza1971 Linux - Laptop and Netbook 1 04-01-2020 02:54 PM
[SOLVED] setting up initrd / generic kernel in Grub2...can't load generic Ubunoob001 Slackware 12 03-20-2015 07:32 AM
kernel-generic and kernel-generic-smp ?? liuyug Slackware - Installation 5 06-01-2014 07:01 PM
slackware64 14.0 stop at booting on generic kernel ? WiseDraco Slackware 3 02-14-2014 01:41 AM
GART TLB error generic level generic Clydesdale Linux - Hardware 0 08-13-2007 06:18 PM

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

All times are GMT -5. The time now is 11:18 AM.

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