# Busybox newroot errors in initramfs

## regomodo

I don't know what the hell happened but all I did was whipped out an extraneous drive, swapped /dev/sde7 for /dev/sdd7 and now I cannot boot any more.

Here is a screengrab of the error

What's happened? /mnt/root does exist in my initramfs directory.

----------

## BradN

Are you sure your grub.conf has the right drives set?  Also I'm not extremely familiar with gentoo's initrd, but it would it be possible that it's hardcoding sdd7 into itself?  (it should be using sde7, correct?)

Does init=/bin/bb let you run a shell from the initrd?  If so, you may be able to use that to investigate what devices are seen from there (you would have to load modules manually).  If it doesn't, there may be another parameter to set the init program for a ramdisk.

----------

## regomodo

 *BradN wrote:*   

> Are you sure your grub.conf has the right drives set?  Also I'm not extremely familiar with gentoo's initrd, but it would it be possible that it's hardcoding sdd7 into itself?  (it should be using sde7, correct?)

 

I'm not quite sure what you mean. if I use and initrd I don't need to set the root= option.

This is what my grub entry looks like

```

menuentry Funtoo {

    insmod ext2

    set root='(hd3,5)'

    search --no-floppy --fs-uuid --set de8587f4-9fd7-499f-9e0e-bbd1b307cc82

    linux   /linux-2.6.34.1 ro fastboot

    initrd  /initramfs.cpio.gz

}

```

This is what my init looks like

```
#!/bin/busybox sh

rescue_shell() {

    echo "Something went wrong. Dropping you to a shell."

    busybox --install -s

    exec /bin/sh

}

# Mount the /proc and /sys filesystems.

mount -t proc none /proc

mount -t sysfs none /sys

# Btrfs stuff

echo "Trying to run btrfsctl"

/bin/btrfsctl -A /dev/sda /dev/sdb 

# Mount the root filesystem.

mount -o ro /dev/sdd7 /mnt/root

# Clean up.

umount /proc

umount /sys

# Boot the real thing.

exec switch_root /mnt/root /sbin/init || rescue_shell

```

I've just added the recue_shell section.

----------

## BradN

I see, your root partition is specified manually in your boot script.  For whatever reason, your root partition apparently isn't showing up as /dev/sdd7.  Does that node exist in /dev?  Does dmesg show that it's been detected (I suppose you may have to add dmesg to your initrd unless you can scroll up to see the boot messages)

----------

## regomodo

 *BradN wrote:*   

> For whatever reason, your root partition apparently isn't showing up as /dev/sdd7.  Does that node exist in /dev?  

 

Ah cock, that'll be it. Totally overlooked that. Cheers

----------

