Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
devfs -> udev migration + ReiserFS + RAID1 == FS corrupti
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
burlie
n00b
n00b


Joined: 06 Sep 2004
Posts: 14

PostPosted: Mon Aug 22, 2005 2:59 am    Post subject: devfs -> udev migration + ReiserFS + RAID1 == FS corrupti Reply with quote

I followed the direction for migrating from devfs to udev from the http://www.gentoo.org/doc/en/udev-guide.xml reference. When I rebooted I got an "unable to open initial console" error, which I have since found out that you might be able to fix by doing this:

cd /dev
mknod -m 660 console c 5 1
mknod -m 660 null c 1 3


However, the problem is, when I reboot to a LiveCD or to the old kernel, /dev/md1 which is the / partition, has filesystem corruption. I had to do fsck.reiserfs --rebuild-tree /dev/md1 which unfortunately, put everything in /lost+found =[ I painstakingly recovered everything out of lost+found and rebuild system with "emerge -e system" from the liveCD to make sure that any missing/corrupt file was replaced. I fsck'd the filesystems again and rebooted. When I rebooted to the udev kernel, same problem "unable to open initial console", then something about swap device, then reboot. On next reboot, / was corrupted and required --rebuild-tree again. I didn't find out about the mknod step until after the second time because its not in the gentoo guide. The guide states:

If you want to use the udev-tweaks Gentoo added to make your life comfortable, then read no more. Gentoo will use udev but keep a static /dev so that you will never have any missing device nodes. The Gentoo init scripts won't run the devfsd daemon and will deactivate devfs when you boot up.

Additionally, while it does mention a potential problem with missing devices, I am above all the necessary package versions and it never mentions anything about potential filesystem corruption.

What can I do to make SURE that the next time I boot, I do so successfully with no filesystem corruption?
Back to top
View user's profile Send private message
burlie
n00b
n00b


Joined: 06 Sep 2004
Posts: 14

PostPosted: Mon Aug 22, 2005 3:37 am    Post subject: Reply with quote

Ahh yes, the ol' reply to yourself routine.

Here is what I did to get by this:

Code:

Boot off LiveCD

# Enable RAID1 (and in my case RAID5 as well) support
modprobe raid1
modprobe raid5

# Create the device for md[0-4]
mknod /dev/md0 b 9 0
mknod /dev/md1 b 9 1
mknod /dev/md2 b 9 2
mknod /dev/md3 b 9 3

# Assemble the arrays ( yours will depend on your setup, in order mine is /boot, /, swap, /home)
madm --assemble /dev/md0 /dev/hda1 /dev/hdc1
madm --assemble /dev/md1 /dev/hda3 /dev/hdc3
madm --assemble /dev/md2 /dev/hda2 /dev/hdc2
madm --assemble /dev/md3 /dev/hdg1 /dev/hdi1 /dev/hdk1

#Repair filesystem corruption to the point of normal system filetree on / (this will vary with your FS type)
fsck.reiserfs --rebuild--tree /dev/md1

# Mount the necessary partitions  on /mnt/gentoo
mount /dev/md1 /mnt/gentoo

# Update the madm.conf file
mdadm --detail --scan > /mnt/gentoo/etc/mdadm.conf

# Chroot
mount -t proc none /mnt/gentoo/proc
chroot /mnt/gentoo/ /bin/bash
env-update && source etc-profile

# Fix /dev
rm -rf /dev/*
cd /dev
mknod -m 660 console c 5 1
mknod -m 660 null c 1 3

# Pass the nodevfs flag to the kernel
mount /boot
vim /boot/grub/grub.conf
title=Vanilla Sources 2.6.12.5 - HD0
root (hd0,0)
kernel /kernel-2.6.12.5 root=/dev/md1 mem=1024M gentoo=nodevfs

title=Vanilla Sources 2.6.12.5 - HD1
root (hd1,0)
kernel /kernel-2.6.12.5 root=/dev/md1 mem=1024M gentoo=nodevfs


# Leave chroot
umount /boot
exit

# Umount filesystems
umount /mnt/gentoo/proc
umount /mnt/gentoo

# Stop raid arrays
mdadm --manage -S /dev/md0
mdadm --manage -S /dev/md1
mdadm --manage -S /dev/md2
mdadm --manage -S /dev/md3

# Reboot
shutdown -r now

# Remove LiveCD and boot normally



Doing that, I was able to boot normally, with no file system corruption and with all the proper devices found.


If you are upgrading from devfs to udev, the important thing to take from this is:

Besides the normal info you found here on the upgrade: http://www.gentoo.org/doc/en/udev-guide.xml
You also want to do the following to remove all static devices before the reboot, relink /dev/console and /dev/null because they are required to boot, and to boot the kernel with the nodevfs option:
Code:

# Fix /dev
 rm -rf /dev/*
cd /dev
mknod -m 660 console c 5 1
mknod -m 660 null c 1 3

# Pass the nodevfs flag to the kernel
mount /boot
vim /boot/grub/grub.conf
title=Vanilla Sources 2.6.12.5 - HD0
root (hd0,0)
kernel /kernel-2.6.12.5 root=/dev/md1 mem=1024M gentoo=nodevfs

title=Vanilla Sources 2.6.12.5 - HD1
root (hd1,0)
kernel /kernel-2.6.12.5 root=/dev/md1 mem=1024M gentoo=nodevfs
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum