Going crazy with "mount root from" error

Status
Not open for further replies.

ulbador

Cadet
Joined
Jul 7, 2011
Messages
4
No matter what I do, I can not get any version of FreeNAS 8 (RELEASE or any of the betas) to boot after the install.

First, immediately after the install, whether I use a USB stick or actual drive, I get:
GEOM: ada0: the primary GPT is corrupt
GEOM: ada0: using secondary instead -- recovery...


Then, after the reboot, I get the same message, followed by this:

Screen shot 2011-07-07 at 7.50.27 PM.jpg


The kicker of it is, no matter what I type: ufs:/dev/ada0p2 ufs:/dev/ada0p1 ada0 /dev/ada0p2, etc etc etc, it still tells me it can't mount the root.


I have honestly tried everything:

using a physical computer
using VirtualBox/Parallels
using a hard drive
using two or three different USB sticks
zeroing the start of the drive with "dd"
killing the partition table with fdisk
Zeroing the WHOLE drive

In fact, the only time it actually installed AND booted was when I created a blank virtual image from within VirtualBox and used that instead of a physical disk.

Thanks in advance for anybody that can point out what I might be doing wrong.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
That really sucks, that's pretty much what I went thru trying to get beta3 to work, but it sounds like you've covered almost everything.

Are you able to boot any other OS from USB flash, say something like Ubuntu?
 

ulbador

Cadet
Joined
Jul 7, 2011
Messages
4
The machine I'm trying to install this on is currently running FreeNAS 7 just fine.

I suppose that's the next thing to try. Install something like ubuntu to my drive and boot from it, then try to install over it. I am at a total loss.

I guess one question is, based on that screenshot, what should I actually be typing to boot it? I would think something like:

ufs:/dev/ada0p1 or 2
 

ulbador

Cadet
Joined
Jul 7, 2011
Messages
4
After *FAR* too many hours of messing around with this, I found the solution. I'll post it here, so it can hopefully help someone else.

Basically, in all the formatting, fdisking and everything else, something with the drives I was using (both hard drive and USB sticks) got "corrupted". I've been dealing with computers for a lot of years and while doing a simple "dd" over the partition table SHOULD have fixed it, clearly it didn't. I assume this has something to do with the fact that a normal format usually just rearranges the partition tables; the actual data on the disk stays intact until it is overwritten.

The solution was simple, download a copy of Ubuntu, install it on the drive, then try to install FreeNAS 8. I have no idea why zeroing the drive didn't work, but clearly this is a much quicker solution. I also don't know why FreeNAS 7 didn't care and FreeNAS 8 threw a fit.

I have no idea why this worked and everything else above didn't, but now I feel silly for wasting the last 3 or 4 days playing with this.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I've been down that same type of rat hole waaay too many times, so I feel for ya. I'm glad your persistence paid off and you're finally able to move on to the more interesting stuff. I don't know why dd didn't work either, I've done the same thing and thought there's no way dd didn't clean it off good enough to keep causing problems and gave up. Keep an eye out, beta 4 should hopefully be out soon, it should hopefully fix a lot of the stuff that broke between beta2 and beta3.
 

ulbador

Cadet
Joined
Jul 7, 2011
Messages
4
I wanted to add to this quickly because I found out the exact reason this happens.

With GPT partitioning scheme, the partition table is stored at the beginning (primary) and end (backup) of the disk. So if you don't zero out the WHOLE disk, which takes forever, the backup GPT table is loaded.

So to fix the above problem you have to do something like:

dd if=/dev/zero of=/dev/theDrive bs=512 count=2

AND


dd if=/dev/zero of=/dev/theDrive bs=512 skip=sectors


where sectors is the length of your disk as reported in fdisk (usually the big long number), minus 1 or 2. These two commands invalidate the primary AND secondary partition tables in a few seconds and saves the time of zeroing the whole disk.

FreeBSD, and subsequently FreeNAS is NOT very good at doing this. Even going between FreeBSD and FreeNAS versions can be troublesome. I upgraded to FreeBSD 9 temporarily and it would not let me downgrade to a fresh install of 8 or 7 until I did this.

This is also the cause when the installer tells you it can't find the slice that it supposedly just made.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Wow, very helpful, thanks for posting that. I went thru this same game with beta-4, but this time I tried a new flash drive (which was actually a little larger). Both drives were 2GB, but the first one formatted out to 1.8 and the second one 1.9, so I thought I was on to something, but I think your explanation nailed it.

Maybe your method should be incorporated into the whole installation process just to make sure this problem doesn't occur.
 

plq

Dabbler
Joined
Sep 2, 2011
Messages
20
I have run into the same problem as part of the learning curve of zfs, e.g. need to start over.

Tried your commands above, but on the first one I get the following response:
dd: /dev/ada0: Operation not permitted
(also tried with sudo in front, but the systems tells me there is no sudo command).

How do I circumvent this?

How do I zero the disks (even if it takes days)?

Is the best way to set up the zpool through the command line, or should the Web Gui be used?

(Apart from being denied entrance as in the example above, the commands are pretty clear).

Many thanks for some help along the way,

peter
 

Durkatlon

Patron
Joined
Aug 19, 2011
Messages
414
Instead of "sudo", just "su -" and type the root password. This gives you a root shell and you can enter as many privileged commands as you need. The just "exit" to drop back to your own non-privileged shell.
 

kynan

Cadet
Joined
Oct 8, 2011
Messages
1
I'm seeing the exact same problem with 8.0.1-RELEASE and am just trying your proposed fix.

So to fix the above problem you have to do something like:

dd if=/dev/zero of=/dev/theDrive bs=512 count=2

AND

dd if=/dev/zero of=/dev/theDrive bs=512 skip=sectors

where sectors is the length of your disk as reported in fdisk (usually the big long number), minus 1 or 2. These two commands invalidate the primary AND secondary partition tables in a few seconds and saves the time of zeroing the whole disk.
The last command was presumably meant to be
Code:
dd if=/dev/zero of=/dev/theDrive bs=512 seek=sectors

Otherwise it'll skip input blocks (which has no effect for /dev/zero), but zero the entire disk.

Edit: Alas, that didn't work for me, it's still stuck at
Code:
mountroot>
 

cargobra

Cadet
Joined
Oct 10, 2011
Messages
4
I went to same problem as yours. To clean the disks I used a live CD of debian and format all partitions. I haven't find a best way to do...
 

heuwitt

Cadet
Joined
Oct 3, 2012
Messages
1
me too - but was due to corrupt gpart

Thanks Ulbador. I was having the same problem.

Somehow I had corrupt gpart and I must clean it up before it'd go pass "mountroot>"

Here is what I did:
1) reinserted FreeNAS 8.3.0-Beta3, and choose going to shell
2) gpart show -l ada0 (ada0 is my disk, yours may vary)
3) gpart destroy -F ada0 (this will destroy your partition - you might want to use 'recover' if you have something important)

and when exit, I installed FreeNAS 8.3 without a issue.
 

Hobbers

Cadet
Joined
Oct 5, 2013
Messages
1
Cheers heuwitt - had the same problem and your solution worked. Annoying that the installer doesn't do this in the fist place.
 

mysticpete

Contributor
Joined
Nov 2, 2013
Messages
148
This exact problem has just happened on a new install of FreeNAS9.1.1 CD Image, thought someone would have fixed this by now in the build image, I mean... It's ONLY Been 2 Years since reported here!!!!

Cheers Heuwitt, your actions did the trick.
 

rhinok

Dabbler
Joined
Mar 22, 2013
Messages
18
This exact problem has just happened on a new install of FreeNAS9.1.1 CD Image, thought someone would have fixed this by now in the build image, I mean... It's ONLY Been 2 Years since reported here!!!!

Cheers Heuwitt, your actions did the trick.

Just installed 9.1.1 last night (and 8.3.2 due to some other issues) using the USB image and dd on both used and new USB keys.
What I did was to unmount the disk and dd the img file to the USB. It works every time, never needed zeroing the disk. For the used USB key, I deleted the 4 partitions and left only one, unmount and dd. If you want to know how is going issue a killall -INFO dd (Mac) on a separate terminal window. It takes a cool 22 minutes (at least in my case, with both a SanDisk and TDK USB keys) to write those 2 GB.

Hope this helps.
 

mysticpete

Contributor
Joined
Nov 2, 2013
Messages
148
And the requested bug report number is?

Sorry..... but it's obviously not that important an issue if it's been left for 2 years!
 

mysticpete

Contributor
Joined
Nov 2, 2013
Messages
148
Just installed 9.1.1 last night (and 8.3.2 due to some other issues) using the USB image and dd on both used and new USB keys.
What I did was to unmount the disk and dd the img file to the USB. It works every time, never needed zeroing the disk. For the used USB key, I deleted the 4 partitions and left only one, unmount and dd. If you want to know how is going issue a killall -INFO dd (Mac) on a separate terminal window. It takes a cool 22 minutes (at least in my case, with both a SanDisk and TDK USB keys) to write those 2 GB.

Hope this helps.

Sorry rhinok but I fail to see the relevance in your situation when as stated I was performing a clean install from an imaged CD of the downloaded software, if FreeNAS is being tuned for the masses then I would have thought that getting the image build right (i.e. working) would be a priority, everyday uses will just shrug and go back to what they know best.

Anyway at least we All have working versions now.... Thanks to the users contributions on the forums :smile:
 
Status
Not open for further replies.
Top