4

I'm working on old distro ( slackware 8.1 ) using a kernel 2.4.37.9 and I have the following problem.

I want to use a custom name for boot device, say for example /dev/root1, which can replace the standard IDE device ( /dev/hdc1 ).

In the standard case I have

  title Linux-2.4.37.9 hdc
    root (hd0,0)
    kernel /boot/vmlinuz-2.4.37.9 ro root=/dev/hdc1 console=ttyS0,9600 console=tty0 apm=off

I wanto to replace it as show belowe:

  title Linux-2.4.37.9 ccl-Test
    root (hd0,0)
    kernel /boot/vmlinuz-2.4.37.9 ro root=/dev/ccl1 console=ttyS0,9600 console=tty0 apm=off

Both /dev/hdc1 and /dev/ccl1 are block device with major/minor 22,1 See here:

# ls -la /dev/hdc1 /dev/ccl1
brw-rw----    1 root     disk      22,   1 Jun  9  2002 /dev/hdc1
brw-rw-rw-    1 root     root      22,   1 Feb 20 15:04 /dev/ccl1

In the standard case the boot works well while in te second case, when I'm using the dev /dev/ccl1, I got the following error :

VFS: connot open root device "ccl1" or 00:00
Please append a correct "root=" boot option
Kernel panic: VFS: Unable to mount root fs on 00:00

I also added an initrd which set the real-root-dev

echo 0x2201 > /proc/sys/kernel/real-root-dev

but I got the same error , with a different device value

VFS: connot open root device "ccl1" or 22:01
Please append a correct "root=" boot option
Kernel panic: VFS: Unable to mount root fs on 22:01

I also tried to use the device ccl1 as a simple mount when the PC is already running and it works, see belowe

# mount -o -ro -t ext2 /dev/ccl1  /mnt/tmp
# df
Filesystem           1k-blocks      Used Available Use% Mounted on
LABEL=Flash-Root        242678    169769     65399  73% /
/dev/shm                452620      9308    443312   3% /var
/dev/ccl1               242678    169769     65399  73% /mnt/tmp

Any suggestions ?

erch
  • 4,890
  • 17
  • 49
  • 81
enzo1959
  • 373
  • 1
  • 4
  • 11
  • *"Both /dev/hdc1 and /dev/ccl1 are block device with major/minor 22,1"* ie, they refer to the same device, correct? 1st question: So where did `ccl1` come from? 2nd question (hunch): Are you aware of UUID's? – goldilocks Feb 20 '13 at 16:01
  • I already tried to boot using UUID and LABEL but it seems that the root didn't alloow the option root=LABEL=xxx and root=UUID=xxxx – enzo1959 Feb 20 '13 at 16:09
  • The reason of the custom ccl1 is because I need to create it at startup inside initrd script in order to mach with the right device wich should change depending of the mother board used. I need somethng to populate the root=xxxx parameter at run-time, and label adn uuid is not working with this kernel. – enzo1959 Feb 20 '13 at 16:12
  • "_So where did ccl1 come from?_" I create myself manually – enzo1959 Feb 20 '13 at 16:21
  • 2.4? Jesus, that's almost 10 years old! – psusi Oct 06 '13 at 03:39
  • At kernel initialization time [when the `root` option is interpreted](http://kernelnewbies.org/RootFileSystem), there is an instance of a minimal `ramfs` filesystem called `rootfs` mounted as the root for the initial process running `start_kernel()`. The actual interpretation of the `root` option parameter is done in a routine called `name_to_dev_t()`. One of the supported syntaxes is the `/dev/name` format, where the _name_ is interpreted by doing a temporary mount of the `sysfs` filesystem in the `rootfs` root, and looking for a block device entry matching _name_ under `/sys/block`. – Thomas Nyman Jan 13 '14 at 09:29
  • Guys correct please if i'm wrong but there's a tool that only runs on windows, easybcd, it can change the grub title, i used to use it when it was a windows user https://neosmart.net/EasyBCD I don't know about linux, isn't that his question? – Lynob Feb 18 '14 at 15:43

1 Answers1

0

Can you maintain /dev/hdc1? If so, create a link named /dev/ccl1 pointing to /dev/hdc1.
I've got some SuSE 8.2 machines with scripts using /dev/hdaX that now work on /dev/hdcX: I created the links and modified grub to hdc. I have no problems with all the mounting/unmounting scripts and it works fine.

asclepix
  • 149
  • 3
  • "_create a link named /dev/ccl1_" I have already tried with a link but I have the same problem. It seems to me that the kernel made some check on value passed to "root=" and allowed only predefined value. – enzo1959 Feb 20 '13 at 16:28
  • You're right, some names were hard coded: http://unix.stackexchange.com/a/18055/32493 – asclepix Feb 20 '13 at 17:00