Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 214448 - root filesystem is not checked when using unionfs
Summary: root filesystem is not checked when using unionfs
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Cluster Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-23 22:13 UTC by Dmitriy Bogun
Modified: 2010-09-10 19:01 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
boot-log (boot-report,1.31 KB, text/plain)
2008-03-24 18:36 UTC, Dmitriy Bogun
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitriy Bogun 2008-03-23 22:13:40 UTC
Hello.

I have installed fresh hardened system on partitionable software raid1 array. A can't to make system to check root filesystem at boot time. All my filesystems except /boot located inside of one partitionable raid array.

/dev/md_d0p1 on / type ext3 (rw)
/dev/md_d0p2 on /var type ext3 (rw)
/dev/md_d0p5 on /media/local/media0 type ext3 (rw)
/dev/sda1 on /boot type ext2 (rw,noatime)

When I make "touch /forcefsck" and reboot the system. It check all filesystem except "/" :(

Here is array config
# grep -v '^#' /etc/mdadm.conf 
DEVICE /dev/sd[abcdef]5
ARRAY /dev/md_d0 level=raid1 num-devices=2 auto=mdp5 UUID=de49148c:b31b6b3e:3c4242ab:31fccc5a
MAILADDR root

# cat /proc/mdstat 
Personalities : [raid0] [raid1] [raid10] 
md_d0 : active raid1 sdc5[1] sda5[0]
      488351744 blocks [2/2] [UU]
      
unused devices: <none>

Related software(as I think)
sys-apps/baselayout-1.12.11.1
sys-fs/mdadm-2.6.4-r1

Reproducible: Always
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-03-23 22:17:48 UTC
please include the non-comment lines of your fstab?
Comment 2 Dmitriy Bogun 2008-03-24 00:59:34 UTC
# grep -v '^#' /etc/fstab

LABEL=lina-/            /               ext3            defaults        0 1
LABEL=lina-/boot        /boot           ext2            noauto,noatime  1 2
LABEL=lina-/var         /var            ext3            defaults        1 2
LABEL=lina-swp0         none            swap            sw              0 0

LABEL=lina-media0       /media/local/media0 ext3        defaults        0 2

/media/bind/home        /home           ext3            bind            0 0
/media/bind/srv         /srv            ext3            bind            0 0

mahoro:/usr/share/portage/distfiles /usr/share/portage/distfiles nfs rw,sync 0 0

proc                    /proc           proc            defaults        0 0
shm                     /dev/shm        tmpfs           nodev,nosuid,noexec 0 0
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-03-24 01:07:54 UTC
1. When you boot, after touching /forcefsck, or having forcefsck in your kernel parameters, do you see this message at all:
"Checking root filesystem (full fsck forced)"
2. Do you see any other messages about the root filesystem during the boot runlevel?
3. Are you using an initrd at all? (genkernel or others)
4. When checkroot runs, does /dev/md_d0p1 exist?
Comment 4 Dmitriy Bogun 2008-03-24 08:46:30 UTC
(In reply to comment #3)
> 1. When you boot, after touching /forcefsck, or having forcefsck in your kernel
> parameters, do you see this message at all:
> "Checking root filesystem (full fsck forced)"
No, I don't see this message.
I see following messages:
 - "Remounting root filesystem read/write"
 - Here is some module loaded, not remember wich one. :(
 - "Starting up RAID devices"
 - "Creating RAID device partitions"
 - "Checking all filesystems"
 - "A full fsck has been forced"
After this going check of all filesystems, except root.

> 2. Do you see any other messages about the root filesystem during the boot
> runlevel?
I see only message about remounting roorfs in rw mode.
> 3. Are you using an initrd at all? (genkernel or others)
Yes. I have used genkernel's initrd. But I have add overlay to it. 

# ls -lR ~/initrd-overlay 
/root/initrd-overlay:
итого 12
drwxr-xr-x 2 root root 4096 Мар  3 05:50 bin
drwxr-xr-x 2 root root 4096 Мар  2 22:40 etc
drwxr-xr-x 2 root root 4096 Мар 23 13:32 sbin

/root/initrd-overlay/bin:
итого 0
lrwxrwxrwx 1 root root 13 Мар  3 05:50 mdadm -> ../sbin/mdadm

/root/initrd-overlay/etc:
итого 4
-rw-r--r-- 1 root root 2273 Мар 23 11:28 mdadm.conf

/root/initrd-overlay/sbin:
итого 728
-rwxr-xr-x 1 root root    191 Мар 23 13:32 mdadm
-rwxr-xr-x 1 root root 733788 Мар  3 00:07 _mdadm

_mdadm - it is a static linked mdadm. 
# cat ~/initrd-overlay/sbin/mdadm
#!/bin/sh

cfg='/etc/mdadm.conf'
mdadm=/sbin/_mdadm
IFS='
'

md_all=$(grep '^ARRAY' $cfg | sed -e 's/^ARRAY //' -e 's/[[:space:]].*$//')
for md in $md_all ; do
    $mdadm --assemble $md
done

Original mdadm compiled into busybox does not create devices for partitions in raid array, it create only "main" array device. Or perhaps I don't found way how to make it do them. 
So I need to use such overlay and wrapper.

> 4. When checkroot runs, does /dev/md_d0p1 exist?
I think - no. I will check it, when I come home... in 8 hour.
And what should I do, if it does not exist? Copy them from initrd's /dev?
Comment 5 SpanKY gentoo-dev 2008-03-24 09:28:59 UTC
the root filesystem is checked before all of the messages you just posted

it should say:
Checking root filesystem ...
Remounting root filesystem read/write ...
Comment 6 Dmitriy Bogun 2008-03-24 10:42:54 UTC
(In reply to comment #5)
> the root filesystem is checked before all of the messages you just posted
> 
> it should say:
> Checking root filesystem ...
> Remounting root filesystem read/write ...
> 

I knew it. I have read /etc/init.d/checkroot /lib/rcscripts/addons/raid-start etc...
I will add something like "ls -l /dev/md*" into /etc/init.d/checkroot to see if there are required device files or they are missing.

But what to do if they are missing?
Comment 7 SpanKY gentoo-dev 2008-03-24 11:01:11 UTC
it doesnt really matter if the device node exists ... you should have gotten some sort of output

put like 'set +x' at the beginning of the start() func at then  put 'set -x' before the 'remounting root filesystem read/write' part (so line ~70)
Comment 8 Dmitriy Bogun 2008-03-24 18:36:53 UTC
Created attachment 147153 [details]
boot-log

Here I made log you have asked.
Is it show something useful?
Comment 9 SpanKY gentoo-dev 2008-03-24 19:24:49 UTC
yes, that is exactly what i wanted, thanks

it would appear your root filesystem is being flagged as being unionfs-ized

try doing this after booting:
unionctl / --list
echo $?
and posting the output

i imagine if you did `emerge -C unionfs` and rebooted, it'd check your root filesystem just fine ...
Comment 10 Dmitriy Bogun 2008-03-24 19:45:22 UTC
# unionctl / --list; echo $?
0

I am using unionfs... but i can unmerge unionfs-utils, unionctl belong to it, this is outdated and not using now utilites. 
And check is it help.
Comment 11 Dmitriy Bogun 2008-03-24 19:50:13 UTC
You are right. 
after unmerging unionfs-utils it begin work correct.

Thanks.
Comment 12 SpanKY gentoo-dev 2008-03-24 20:01:20 UTC
but you arent using unionfs on your / are you ?

ive never used unionfs at all myself, so i cant speak to the logistics ... all the code in baselayout was donated by someone else
Comment 13 Dmitriy Bogun 2008-03-24 20:20:18 UTC
No. I don't use unionfs on rootfs. 
I use it for user's "sandboxes".

In official portage tree there is no unionfs-utils... it was my old copy in my local overlay. So this bug can be closed... 

Maybe should remove unionfs-utils related code from baselayout. Newer unionfs managets via "mount -o remount,... interface". I think that unionctl will not be used any more.