You are not logged in.

#1 2012-10-20 00:57:50

Masterion
Member
Registered: 2012-07-18
Posts: 8

[SOLVED] Unable to find root device '/dev/sda2'.

Before I begin, allow me to give you a general background that's lead me up to this error that I've received numerous times throughout my attempts to successfully boot into Arch Linux.

One of my buddies bought a ten-year-old laptop off a guy with pretty much no hard drive. To test to see if an operating system would boot otherwise (and considering the limited resources the laptop would have), I thought it would be nice to try and install Arch Linux onto a flash drive (and to be honest, I would've installed Arch to the hard drive too if it were working). However, I have been puzzled by one seemingly minuscule issue that prevents me from carrying through my testing.

Thus far, I have been able to run through all of the steps on the Arch LiveCD to install the operating system. However, once I get to initially booting off of the flash drive, it has lead me to trouble. Currently, I'm using GRUB Legacy (to fall back on in the case that GRUB2 or Syslinux was the reason that I was not able to properly boot into the flash drive) and it gives me an error after booting the kernel of "Unable to find root device '/dev/sda2".

I have tried manually configuring the /boot/grub/menu.lst file to reflect the partition table I have laid out. The partition table on the flash drive is as follows:

/dev/sda1 = /boot
/dev/sda2 = / (ROOT)
/dev/sda5 = /var
/dev/sda6 = /tmp
/dev/sda7 = /home
/dev/sda8 = swap

whereas the text in the /boot/grub/menu.lst file is as follows (minus the header):

root (hd0,0)
kernel /vmlinuz-linux root=/dev/sda2 ro quiet splash
initrd /initramfs-linux.img

To make a long story short, I am getting an error stating "Unable to find root device '/dev/sda2'" when attempting to boot into Arch Linux from my flash drive.

My question to you is: How is it that I can work around this? I have already tried re-installing systemd and the kernel, but I still get the same error. The same goes for trying to boot up using the fallback initial ramdisk. Additionally, being that this laptop lacks a working hard drive, it needs to be set on /dev/sda and not /dev/sdb.

Last edited by Masterion (2012-10-20 02:13:38)

Offline

#2 2012-10-20 01:02:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,547
Website

Re: [SOLVED] Unable to find root device '/dev/sda2'.

If there is a harddrive there - even if completely nonfunctional, the flash drive is probably being assigned to sdb.

In either case though, you should really use UUID especially for booting from a flash drive.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2012-10-20 01:12:11

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: [SOLVED] Unable to find root device '/dev/sda2'.

Not sure about hard drives, but my machine assigns sdb to the sd card (making usb start at sdc) even though there is no sd card in the machine and, indeed, there never has been. So even if the hard drive has been removed, it might still give it sda.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#4 2012-10-20 01:13:29

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Unable to find root device '/dev/sda2'.

I think trilby is right... why not use labels or uuids.  Also, did you remember to add the usb hook your your initramfs?


Edit: @cfr, about the assignment of the sd card slow w/o it being occupied.  Have you also checked to make sure that it is not constantly polling?  My laptop, I had to install a moudle from realtek, but when I did, powertop reported that it was using all kinds of power to constantly poll for a card every few seconds... okay maybe not all kinds of power, but it seemed useless, so I consider that 100% more power than was needed.  So I decided to just load the module when needed and otherwise blacklist it.

Last edited by WonderWoofy (2012-10-20 01:16:25)

Offline

#5 2012-10-20 01:25:20

Masterion
Member
Registered: 2012-07-18
Posts: 8

Re: [SOLVED] Unable to find root device '/dev/sda2'.

That's the thing - no matter what the application, the drive is totally ignored and the flash drive somehow falls on /dev/sda. I've saw this with GParted, cfdisk, and several other partitioning tools.

Additionally, when trying to use UUID instead, I get the same error.

Offline

#6 2012-10-20 01:25:42

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: [SOLVED] Unable to find root device '/dev/sda2'.

I believe that I would need to install that module (or a module anyway) as well. Since I don't have an sd card, I decided to get the module if and when. So it cannot be loaded because it is not installed. At least, that's how I understand my current configuration.

I didn't say it was "slow" - I just said that it was assigned sdb. I'm not aware of it slowing anything down.

EDIT: Then again, I guess it doesn't need an additional driver but uses rts_pstor? I'm sure when I checked this before, it basically wasn't supported without getting some additional thing. Then again, I probably didn't take all that much notice since I don't have a card...

Last edited by cfr (2012-10-20 01:32:12)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#7 2012-10-20 01:27:59

Masterion
Member
Registered: 2012-07-18
Posts: 8

Re: [SOLVED] Unable to find root device '/dev/sda2'.

@WonderWoofy

I'm not entirely sure if usb is included in the hooks; that's one thing that I need to check. Give me a couple of minutes.

Offline

#8 2012-10-20 01:29:13

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Unable to find root device '/dev/sda2'.

If you are booting off of a usb, it has to be... or compiled into the kernel or the module explicitly listed in the initramfs of course... the usb hook just makes it easy.

Offline

#9 2012-10-20 01:35:41

Masterion
Member
Registered: 2012-07-18
Posts: 8

Re: [SOLVED] Unable to find root device '/dev/sda2'.

Still gives me the same error even with the usb hook.

Offline

#10 2012-10-20 01:39:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,547
Website

Re: [SOLVED] Unable to find root device '/dev/sda2'.

I'm looking back at your partitioning scheme - you have 8 partions ....  Which are extended/logical partitions?  And which/what are sda3/4?

Edit: sorry for the red herring - this shouldn't matter as IIRC only the boot partition neads to be a primary, and this is not the present issue.

Last edited by Trilby (2012-10-20 01:45:42)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2012-10-20 01:42:19

Masterion
Member
Registered: 2012-07-18
Posts: 8

Re: [SOLVED] Unable to find root device '/dev/sda2'.

sda5, 6, 7, & 8 are all logical partitions. If I remember right, sda3 is the extended one out of the bunch.

Offline

#12 2012-10-20 01:50:15

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,547
Website

Re: [SOLVED] Unable to find root device '/dev/sda2'.

EDIT: before bothering with the below steps: you did rebuild the initramfs after adding the usb hook right?  If yes, then go on with the below steps.  If no - doing so will most likely solve the problem.

Well this is a bit odd ... If I were in your spot I'd do some exploring/testing from within the recovery shell that you should be dumped to when the mount fails.  You do get to this recovery shell right?

If so, does sda2 show up in /dev?  Can you mount /dev/sda2 manually on /mnt?  If both of those are yes, check that the contents of sda2 (now in /mnt/*) is what should be in the root partition there, like /mnt/bin /mnt/etc ...

If all of that looks good, you could even manually mount the remainder of the partitions and chroot into the system.  If any of these steps fail (I'm guessing at least one will) it may help narrow down where the problem is.

Last edited by Trilby (2012-10-20 01:56:15)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#13 2012-10-20 01:55:54

Masterion
Member
Registered: 2012-07-18
Posts: 8

Re: [SOLVED] Unable to find root device '/dev/sda2'.

@Trillby

I did get to the recovery shell, but I don't know the first thing about messing around with it. What exactly do you mean by having sda2 show up in /dev?

Edit: Didn't see the initramfs part initially. I didn't recompile after that, actually. Give me a couple of minutes.

Last edited by Masterion (2012-10-20 01:57:36)

Offline

#14 2012-10-20 01:57:01

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,547
Website

Re: [SOLVED] Unable to find root device '/dev/sda2'.

Masterion, first see my edit.

Second,  "ls /dev/"


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#15 2012-10-20 02:10:14

Masterion
Member
Registered: 2012-07-18
Posts: 8

Re: [SOLVED] Unable to find root device '/dev/sda2'.

...and sure enough, it works!

Thanks, Trillby. I owe you one.

Offline

#16 2012-10-20 02:12:03

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,547
Website

Re: [SOLVED] Unable to find root device '/dev/sda2'.

Thank WonderfulWoofy, he had the solution first - I just distracted you with other nonsense for a bit.

Edit: also please mark the thread as [SOLVED] by editing your first post and prepending that to the title.

Last edited by Trilby (2012-10-20 02:12:42)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#17 2012-10-20 02:22:40

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Unable to find root device '/dev/sda2'.

Ah yes, but those distractions were definitely legitimate possibilities.... plus I was eating dinner, so it was good you were still participating Trilby.

Offline

Board footer

Powered by FluxBB