LinuxQuestions.org
Review your favorite Linux distribution.
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 12-03-2012, 11:38 PM   #1
muahahaha9001
LQ Newbie
 
Registered: Sep 2012
Location: Northern Virginia, USA
Distribution: Slackware, Debian, FreeBSD, Arch Linux, Ubuntu, Kubuntu, CentOS, OS X
Posts: 21

Rep: Reputation: 0
LVM2 root partitions not mounting at boot - HELP!


I have a new install of Slackware 14.0 on my laptop. The bootloader is GRUB2 on a separate flash drive. Most of the directories in / including the root directory itself (/) are LVM2 logical volumes. When I was chrooted into the laptop's hard drive, I was able to create an initrd for booting using the mkinitrd_command_generator.sh script.

As it stands, the laptop can only be fully booted if I manually mount the LVM2 partitions during the booting process. What happens is the normal booting process halts saying something about /sbin/init missing and opens a shell for me to fix it before the booting process continues. I eventually discovered that all the LVM2 partitions weren't mounted under the /mnt directory like they were supposed to be. What I did was mount all the partitions as if I was going to do a chroot from the Slackware Live DVD, then exit the shell for the boot process to continue. The laptop booted just fine but it sure was a hassle activating and then mounting all those partitions.

How do I fix this? I'm new at this and am unsure of where to look.

In my grub.cfg there are a few insmod entries and during the boot process I see something explicit in the output for each insmod except for the lvm insmod. Despite that, one of the messages I see before the mid-boot shell appears says that there are 12 active lvm volumes. Strange.

Any advice would be greatly appreciated!

Last edited by muahahaha9001; 12-05-2012 at 01:39 PM.
 
Old 12-04-2012, 09:16 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 2,211

Rep: Reputation: 572Reputation: 572Reputation: 572Reputation: 572Reputation: 572Reputation: 572
Not sure this will work, but since your mount did work I think this should:

When you make the initrd, add "-r /dev/<your root device>".

I had to do this when creating a VM running slackware - Until I added the drivers (the virtual io stuff) and "-r /dev/vda3" it too would stop until I manually mounted the root filesystem and exited.
 
Old 12-04-2012, 11:08 AM   #3
muahahaha9001
LQ Newbie
 
Registered: Sep 2012
Location: Northern Virginia, USA
Distribution: Slackware, Debian, FreeBSD, Arch Linux, Ubuntu, Kubuntu, CentOS, OS X
Posts: 21

Original Poster
Rep: Reputation: 0
Thanks but the mkinitrd_command_generator.sh script generated a command which included the -r flag and the root device path already. Nice try though.

I went through the logs and found some of the messages I was seeing during boot. I could post them if it could help anyone.

At this point I'm contemplating writing a script to act as a band-aid for the situation. Basically, when the boot process stops and drops into the shell, I'll have it execute a bash script that will automatically activate the logical volume partition, do all the proper mounting for me, and then exit the shell. It isn't perfect, but it should save me the trouble I'm experiencing now. At this point there are still some things I need to learn about initrd and shell scripting before I could write such a script. The shell environment of initrd has no /etc/profile and I'm not even sure if initrd can be written to with persistence.

With a script like that, it still wouldn't change the fact that somehow, something seems to be misconfigured.
 
Old 12-05-2012, 09:26 AM   #4
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,494

Rep: Reputation: 438Reputation: 438Reputation: 438Reputation: 438Reputation: 438
When you did the original chroot, did you run...
Code:
mount -B /dev /mnt/dev
mount -B /sys /mnt/sys
mount -B /proc /mnt/proc
...prior to chrooting and running mkinitrd_command_generator.sh?

I'm running grub2 with my root partition on an LVM2 logical volume on the machine that I'm using to type this.
 
Old 12-05-2012, 01:56 PM   #5
muahahaha9001
LQ Newbie
 
Registered: Sep 2012
Location: Northern Virginia, USA
Distribution: Slackware, Debian, FreeBSD, Arch Linux, Ubuntu, Kubuntu, CentOS, OS X
Posts: 21

Original Poster
Rep: Reputation: 0
Hi Richard Cranium. Thanks for the reply. Yes, I did make sure to mount those things. It was a frustrating having nothing work until I realized those three things were necessary for a proper chroot. Without using them, I wouldn't have been able to boot the system out of initrd in the first place.

Here is how I fixed the problem: First I used a guide on Ubuntu's wiki to decompress, edit, and recompress /boot/initrd.gz. I was able to make the proper edits to initrd when I found that the initrd had it's own /init script that did the mounting of the root file system. I modified that to mount my other partitions ( /sbin, /bin, /etc, /var, /usr, /lib, /opt, /home, ... ) in addition to mounting my root partition. After compressing the temporary initrd directory I had made for doing the edits, I realized that the file I ended up with was much larger than the original initrd.gz. I had thought there might have been a difference in how the two initrd.gz files had been compressed and was worried that the compression differences would cause a problem. Luckily they did not. Now the boot process goes straight to the login prompt and there is no interruption that drops to an initrd shell anymore. So I'm happy. My new slackware laptop rocks for the most part.

The solution isn't perfect. I'm not entirely sure how exactly these partitions should be mounted because I was seeing some error messages about needing partitions to be mounted read-only in order to do filesystem checks at start up and that there had been a number of aborted filesystem checks for certain partitions. Either I'll find a way to stop the filesystem checks from being attempted or I'll find the right way to mount these filesystems from initrd's init script. My Slackware 14.0 install was a 'full' install so there are probably a lot of unnecessary things happening at start up.
 
Old 12-05-2012, 02:30 PM   #6
GazL
Senior Member
 
Registered: May 2008
Posts: 3,392

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by muahahaha9001 View Post
HI modified that to mount my other partitions ( /sbin, /bin, /etc, /var, /usr, /lib, /opt, /home, ... ) in addition to mounting my root partition..
/bin, /sbin, /lib and /etc shouldn't be separate partitions. They belong in the rootfs. I'm not surprised you had problems.
 
Old 12-05-2012, 02:30 PM   #7
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,254

Rep: Reputation: 634Reputation: 634Reputation: 634Reputation: 634Reputation: 634Reputation: 634
Do you really have /sbin, /bin, /etc, and /lib on separate partitions? This would be completely unsupported in Slackware as far as I know.../usr, /home, /var, /tmp, /opt and /boot are fine living on their own partitions, but I think every Linux guide anywhere would recommend keeping /etc, /sbin, /bin, and /lib (and /lib64) on the root (/) partition. The init scripts are located in /etc, and they are required for properly setting up the system (and they may use utilities from /sbin and /bin, which may use libraries from /lib). Therefore, all four directories *must* be mounted in order for the system to boot. If you don't want to reinstall, the only way to get it to boot is to hack the initrd, which you have done; but I see very little utility in such a setup...

[edit] Too late I see. [/edit]

Last edited by T3slider; 12-05-2012 at 02:32 PM.
 
Old 12-05-2012, 07:37 PM   #8
muahahaha9001
LQ Newbie
 
Registered: Sep 2012
Location: Northern Virginia, USA
Distribution: Slackware, Debian, FreeBSD, Arch Linux, Ubuntu, Kubuntu, CentOS, OS X
Posts: 21

Original Poster
Rep: Reputation: 0
Quote:
but I see very little utility in such a setup...
Probably. This was my first time using Slackware which is the most barebones distro I've had the chance to try. I was curious about the kind of space each one of these directories would consume and what the optimal amount of space would be for each of them. The quota program might have been another option to keep track of how much space was consumed but I've always liked the features that come with LVM2.

Just curious, how would you more expereinced guys determine the best partition size for the root file system and other partitions?

Anyone care to guess what options the mount command needs in initrd to mount these partitions in a way that allows the start up filesystem check to happen?
 
Old 12-06-2012, 06:19 AM   #9
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 2,211

Rep: Reputation: 572Reputation: 572Reputation: 572Reputation: 572Reputation: 572Reputation: 572
"Best" is relative to what you are doing. They can be quite small. The best way to find out is to create your target system and measure it.

One "best" is the initrd itself...
 
Old 12-06-2012, 07:04 AM   #10
GazL
Senior Member
 
Registered: May 2008
Posts: 3,392

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
The whole point of LVM is to allow you to dynamically manage storage space as and when you need it. Only allocate what you estimate you're likely to need in the short-term and then leave the rest of the volume group as freespace. Should you need to increase any of the logical volumes at a later date you will find it relatively trivial and non-destructive. Don't try and run things too tight though, always allocate enough to cater for a reasonable amount of growth.

Last edited by GazL; 12-06-2012 at 07:06 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] LUKS / LVM2: Root partition unable to boot, initrd errors ADX Slackware 5 01-13-2012 04:57 PM
Way to not auto mount HD partitions; Mandriva One 2008 Spring Live CD RHTopics Mandriva 9 03-28-2008 02:00 AM
Auto-mount windows share on boot - manual OK, auto not ok! erskie Linux - Newbie 2 02-12-2008 06:42 PM
LVM2 (non-root) lv's won't mount at boot time jbanafato Linux - General 3 03-06-2005 11:29 PM
After reboot LVM2 partitions will not mount sendas4 Linux - General 0 10-12-2004 04:35 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration