FreeNAS Data disk

Status
Not open for further replies.

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
I don't know if this should go into "Storage" or "General Help" forum. Please move it in case it shouldn't be here.

I upgraded my 1TB drives with 6TB drives recently. I was hoping to use the 1TB in my desktop. I went through with the installation of Archlinux on it, but after I remove the installation media and when it tries to boot up from the HDD, I get the "This is a freenas data disk and cannot boot system"

I did overwrite the GPT partition header on the disk using gdisk too. How would I be able to use this disk for Linux? Funny thing is, that during Archlinux installation, it allows me to go through the entire installation process. I created partitions and also LVM volumes to install Archlinux on. But when I try to boot from the HDD, it gives me the above error indicating that the MBR didn't get overwritten somehow. I went through the Archlinux installation process twice, assuming I must have done something wrong on the first try, but the second time I got the same error message again.

I have already checked my BIOS and it is pointing to the only disk that my SFF desktop can hold as the first to boot from.

Do I have to put the disk back in my FreeNAS system and then wipe it before I can use it for other purposes?
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
No, it is not necessary to put the disk back in the FreeNAS system. At a minimum, you need to write new bootcode to that disk. How to do that depends on the system being used. I prefer gpart on FreeBSD or FreeNAS, because it knows many different partitioning standards and handles them correctly. Second choice would be one of several Linux utilities, but they vary greatly in whether they understand GPT.
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
At a minimum, you need to write new bootcode to that disk.
Hmmm. I would have thought that "option o" in gdisk would do exactly that. I might have to try this again and see if I messed up -- probably because I was doing this late in the night.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
The man page says it "clears out" all partition data. That's not very clear. But it does not even suggest that it writes new bootcode. It also appears that it requires a w to actually write the changes after using o.
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
The man page says it "clears out" all partition data. That's not very clear. But it does not even suggest that it writes new bootcode. It also appears that it requires a w to actually write the changes after using o.
Yes. I did do a 'w' as well. After that I went on my merry way creating physical partition for the /boot as well as LVM partitions for root, home, data etc. Obviously followed by 'w' again to write all of the changes to the partition table.

I will check again later tonight, or maybe try a different partitioning software -- maybe parted.
 

saikee

Explorer
Joined
Feb 7, 2017
Messages
77
The safest way I found to re-use a ex-FreeNAS disk, that has been formatted to a gpt parttition system, is to remove the partition table like using parted in a Linux terminal with a simple command
Code:
sudo parted /dev/sda

or sdb, sdc etc and then
Code:
mklabel msdos

Reboot the system and do whatever you wish afterward. A gpt partition table has one copy in the disk front and another copy at the end of the disk so it is quite messy if it isn't properly configured.

It is also common that some kernels may not be able to use a changed partition table immediately and a warning is usually displayed. A reboot is a safer approach.

Most installers do not always report problem if Grub fails to install as it is a standard 3rd party program not the responsibility of the featured Linux distribution so do not be surprised if the boot code isn't implemented.

I believe FreeNAS uses the gpt table in a way foreign to Linux. I said this after connecting two ex-FreeNAS disks to Ubuntu both Gparted and fdisk complained both disks " The backup GPT table is corrupt, but the primary appears OK, so that will be used" after initially reported "end of file while reading /dev/sdd", yet these two disks boot perfectly in my FreeNAS box.
 
Last edited:

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
During the install, my Archlinux installer read the drive correctly as FreeBSD partitions.

But the one thing I did not do is reboot after mklabel. Maybe, like you mentioned, it needs a reboot before trying to install linux on that drive.

I will try this tonight and report back.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
I believe FreeNAS uses the gpt table in a way foreign to Linux. I said this after connecting two ex-FreeNAS disks to Ubuntu both Gparted and fdisk complained both disks " The backup GPT table is corrupt, but the primary appears OK, so that will be used" after initially reported "end of file while reading /dev/sdd", yet these two disks boot perfectly in my FreeNAS box.
Carefully said. I'd trust gpart to be more standards-complaint than about anything else. But with Linux (and Apple, for that matter), standards are what they want them to be.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
Since the backup gpt table is stored at the end of the disk, and the dd hit the end unexpectedly, it's not surprising that it was corrupt, since it wasn't the original 'end'
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
OK. Seems like using GPT as the partition table was a problem. Even after using GPT and then rebooting as saikee suggested, it didn't work. I still got the FreeNAS data disk message. So it seems like since FreeNAS was using GPT, overwriting it with another GPT partition table didn't really do anything. Why? I have no clue.:confused:

However, when I used dos partition table and rebooted, the FreeNAS message went away and all I got was a blinking cursor. So progress.:)

I went ahead and installed Archlinux and was able to boot up in MBR mode.

I was hoping to use GPT partitioning, so I will probably do a reinstall and try that out later tonight.
 
Last edited by a moderator:

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
It's not the partition format, it's the bootcode. Changing to MBR overwrote the GPT bootcode.
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
It's not the partition format, it's the bootcode. Changing to MBR overwrote the GPT bootcode.
I thought that's what option 'o' in gdisk does -- overwrite the GPT bootcode
Same with
Code:
mklabel gpt
in parted. But neither of those worked until I changed it to MBR.

Also after installing Archlinux on the MBR partitioning scheme, last evening, I went in and changed it to GPT and re-installed Archlinux and this time it worked.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Well, that's what it claims to do. I think the description is vague. As implied above, I've had less than perfect results with various partitioning tools. I have used gpart with success. It can be run from a live USB or CD with mfsBSD.
 
Last edited:

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
Well, that's what it claims to do. I think, the description is vague. As implied above, I've had less than perfect results with various partitioning tools. I have used gpart with success. It can be run from a live USB or CD with mfsBSD.
Fair enough. I am glad it worked out eventually. Since I was re-installing Archlinux fresh, I didn't care too much about having to reinstall it a few times. :)
 
Status
Not open for further replies.
Top