LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 06-18-2013, 02:22 AM   #1
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,991

Rep: Reputation: Disabled
findfs returns wrong device(s) outside initrd


I'm booting a Slackware 14 system with an initrd, and I'd like to use file system labels in /etc/fstab. Both / and /boot are on LVM (actually dmraid, but that should make no difference).

Problem: Once the initrd exits, findfs returns the wrong devices for both labels.

Inside initrd:
Code:
# findfs LABEL=root
/dev/dm-1
# findfs LABEL=boot
/dev/dm-2
Once initrd exits, it's a different story:
Code:
~# findfs LABEL=root
/dev/sda1
~# findfs LABEL=boot
/dev/sda2
Since both these partitions are actually in use by device-mapper, any attempt to access or mount either of them will fail. Since /dev/sda1 can't be fsck'ed, the system won't boot unless I mount the root file system as writable (and get an error message, but at least it boots).

I believe this has to be an issue with the init script in the initrd. Any idea where I should start looking?
 
Old 06-18-2013, 08:33 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,494

Rep: Reputation: 437Reputation: 437Reputation: 437Reputation: 437Reputation: 437
What mkinitrd command did you use to create it?
 
Old 06-19-2013, 10:32 AM   #3
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,991

Original Poster
Rep: Reputation: Disabled
I used the command generated by mkinitrd_command_generator.sh, except I changed the root device parameter to -r LABEL=root. I then added the dmraid executable to /boot/mkinitrd-tree/sbin, copied all dmraid-related libraries to /boot/mkinitrd-tree/lib64, and added the following commands to the init script, right below the part that does LVM initialization:
Code:
if [ -x /sbin/dmraid ]; then
   dmraid -ay
   /sbin/udevadm settle --timeout=10
fi
I then ran mkinitrd again with no parameters. This generated a working /boot/initrd.gz with dmraid support.

While troubleshooting this issue, I added a few debug statements to the init script that would print the output of findfs LABEL=root at various points in the script. I was able to determine the following:
  • When init starts, findfs returns /dev/sda1 and /dev/sda2 for LABEL=root and LABEL=boot respectively. This is as expected, as each component of a fakeRAID mirror set contains a regular partition with a valid file system and RAID metadata at the end.
  • Once the dmraid command has been run, findfs returns /dev/dm-1 and /dev/dm-2, as it should.
  • The init script successfully identifies /dev/dm-1 as the root FS, and is able to mount it (adding a mount command et the very end of the init script confirmed this).
And now for the weird part: When initrd exits and the boot process continues, findfs immediately starts returning /dev/sda1 and /dev/sda2 again. There's no way the kernel could have probed /dev/sda1 again as it is mounted and locked by device-mapper, so this must be stale information from earlier in the boot process. At this point, mount also insists that /dev/sda1 is mounted as /. And no, there's no stale information in /etc/mtab, so where is this information coming from?

Interestingly, running partprobe will fix the invalid /dev/sda2 reference, since /dev/dm-2 (a small, mirrored boot volume) never gets mounted. The /dev/sda1 reference stays though, as /dev/dm-1 is mounted and cannot be probed.
 
Old 06-19-2013, 11:16 AM   #4
GazL
Senior Member
 
Registered: May 2008
Posts: 3,392

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Maybe the blkid cache file is the culprit: /run/blkid/blkid.tab
 
Old 06-19-2013, 12:18 PM   #5
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,991

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by GazL View Post
Maybe the blkid cache file is the culprit: /run/blkid/blkid.tab
Slackware doesn't seem to have that file, neither in /run/blkid (which doesn't exist) nor anywhere else.
 
Old 06-19-2013, 02:15 PM   #6
GazL
Senior Member
 
Registered: May 2008
Posts: 3,392

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
It gets created when you run blkid. I was working on the assumption that findfs used the same backend, but perhaps that's not the case then.
 
  


Reply

Tags
initrd label uuid findfs


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
df -h returns wrong values Hmail Linux - Software 6 03-02-2010 04:36 PM
openoffice calc LOOKUP() returns wrong value edgjerp Linux - Software 3 06-20-2009 05:08 AM
search in slackbuilds returns wrong item garyg007 Slackware 3 11-02-2008 02:01 PM
cdrecord returns wrong startsec warning parthenios Linux - Hardware 1 03-05-2005 12:50 AM
cdrecord -scanbus sez: "controller returns wrong size for capapabilities page rdaves@earthlink.net Linux - General 5 10-08-2001 09:09 AM


All times are GMT -5. The time now is 05:36 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