Help I accidentally deleted the first partion on my USB boot drive

Status
Not open for further replies.

tris

Cadet
Joined
Jan 15, 2015
Messages
5
Hi , please help while trying to figure out why my 3tb drive's in enclosures where showing as 800gb instead of there full amount I ran the following . gpart delete -i1 da0 . it should have been da1 . Any way I can recover the partion , this is a live box on site , so a bit worried at the moment.
 

Fraoch

Patron
Joined
Aug 14, 2014
Messages
395
I don't believe there's anything you can do other than reinstall FreeNAS onto another USB key (or that USB key). I can't think of any way around going to the site and getting physical access.

While it's still up, make sure you take a backup of the configuration. Once you reinstall FreeNAS, use that backup file.

Also you may want to take two USB keys to the site and use another one to mirror the boot drive. If boot mirroring was used here, you wouldn't require physical access to the server if this happened again - you would just detach the drive and re-attach it from the GUI, causing a resilver.
 
S

sef

Guest
You can try:
  1. gpart add -i 1 -s 512k -t bios-boot da0
  2. grub-install --modules="zfs part_gpt" /dev/da0
No guarantees, but if all you did was accidentally delete the partition, that's got a reasonable chance of working.

Be sure to backup your configuration first.
 

tris

Cadet
Joined
Jan 15, 2015
Messages
5
Just wondering , went on site today , rebooted the box , and used F2 to boot into freenas , my config and everything was there . Is da0s1 duplicated on da0s2 . What is on each of the 4 partions FreeNas creates.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
No, each of the two partitions take turns being bootable. For example, on first install s1 is bootable. When you do an upgrade s2 is made bootable. This is so that if you do an upgrade and it goes sideways you can easily revert.
 

Fraoch

Patron
Joined
Aug 14, 2014
Messages
395
No, each of the two partitions take turns being bootable. For example, on first install s1 is bootable. When you do an upgrade s2 is made bootable. This is so that if you do an upgrade and it goes sideways you can easily revert.

That's actually pretty awesome - mirroring on the same drive!
 
Status
Not open for further replies.
Top