Hello,
I have a problem defining persistent device naming on a Debian Lenny server.
I have:
RAID1 controller on the server machine with two SCSI disks.
external storage with RAID5. I have / mount on the first partition on the server SCSI disk and /storage mount on the external storage.
I'm experiencing a problem: The system recognizes the system disk (RAID 1), as sda or sdb – randomly.
I want: To control the recognition, and tell the system that sda (sda1) will always be the system disk.
The motivation: GRUB is configured to work with sda, and when the system disk doesn't, boot process fails, and I end up in the initramfs shell-like interface.
Code:
Booting the kernel
.
.
.
mount:mounting /dev on /root/dev failed: No such file or directory
mount:mounting /sys on /root/sys failed: No such file or directory
mount:mounting /proc on /root/proc failed: No such file or directory
target filesystem does not have /sbin/init . No init found. Try passing init=bootarg.
(initramfs): <--this is the prompt I get
Some more information:
Code:
# fdisk -l
Disk /dev/sda: 73.4 GB, 73406611456 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000b1511
Device Boot Start End Blocks Id System
/dev/sda1 * 1 8681 69730101 83 Linux
/dev/sda2 8682 8924 1951897+ 82 Linux swap / Solaris
Disk /dev/sdb: 1497.3 GB, 1497314099200 bytes
255 heads, 63 sectors/track, 182038 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x8aa13146
Device Boot Start End Blocks Id System
/dev/sdb1 1 182038 1462220203+ 83 Linux
GRUB boot options:
Code:
kernel /boot/vmlinuz-2.6.26-2-686 root=/dev/sda1 ro quiet
Sometimes I can boot the system when I change the 'root=' option to /dev/sdb1, and if I'm lucky enough the system disk is recognized as /dev/sdb and then I can boot.
What I tried to do:
1. Tried to configure /etc/fstab with UUID option (instead of mentioning sda or sdb).
The following is the contents of /etc/fstab (scsi disks are defined too - with UUID)
Code:
proc /proc proc defaults 0 0
UUID=18fa3d1a-b401-4274-8bb5-35df0847f413 / ext3 errors=remount-ro 0 1
#/dev/sda1 / ext3 errors=remount-ro 0 1
/dev/sda2 none swap sw 0 0
/dev/hda /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
UUID=0148f6d2-d3fd-47c4-b0da-c4e6f3520460 /storage/ ext3 defaults 0 0
#/dev/sdb1 /storage ext3 defaults 0 0
2. I tried solving the problem by creating a new rules file under /etc/udev/rules.d so that the file name will be read first (in lexical order).
This is the file content - (each rule in one line of course, the attributes and values are taken from
udevadm info –name=<dev-name> --attribute-walk ,when the disks names was O.K)
Code:
#rule for /dev/sda (server disk [RAID1])
SUBSYSTEM=="block" , ATTR{size}=="143372288" , SUBSYSTEMS=="scsi" , ATTRS{model}=="SERVERAID" , NAME="sda"
#rule for /dev/sda1 (first bootable partition on server)
SUBSYSTEM=="block" , ATTR{size}=="139460202" , SUBSYSTEMS=="block" , ATTRS{size}=="143372288" , NAME="sda1"
#rule for /dev/sda2 (swap partition on server)
SUBSYSTEM=="block" , ATTR{size}=="3903795" , SUBSYSTEMS=="block" , ATTRS{size}=="143372288" , NAME="sda2"
#rule for /dev/sdb (external storage)
SUBSYSTEM=="block" , ATTR{size}=="2924441600" , SUBSYSTEMS=="scsi" , ATTRS{model}=="1726-4xx FAStT" , NAME="sdb"
#rule for /dev/sdb1 (external storage, has only one partition)
SUBSYSTEM=="block" , ATTR{size}=="2924440407" , SUBSYSTEMS=="block" , ATTRS{size}=="2924441600" , NAME="sdb1"
when I reboot the system again I get the same problem!!
One more important question:
What is the reason Linux is not recognizing the system disk always as /dev/sda?
I will appreciate your help,
D-niX.