Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


[Tutorial] Recovering GRUB in HC2


Vallefor
 Share

Recommended Posts

Hello.

 

I wanted post it here: 

Please login or register to see this link.

 but i have no rights for it.

 

First of all I want to say that it is totally not recommended to do it. If you have similar problems - ask for support first!
DO IT ON YOUR OWN RISK! Probably this will end your warranty (but my already ended).

 

Two days ago a need to do some electric works and I shutdown my HC2 by pressing power button.

Then, when I finished - I switch it on leds start to blinking... but nothing hapened. I tried to boot to recovery but it did not boot also.

 

I unscrewed left panel of HC and attach monitor to see whtats hapening. And I sawed that it is immediatly reboot after selcecting a boot device. 

 

It was a GRUB problem. This tutorial is for linux users.

Btw, my HC2 version is  4.550.

 

1. You need:

>=1Gb flash drive

Keyboard

Monitor with VGA connector

Linux PC (you can prepare USB drive on Windows, but I do not know how, sorry)

 

2. Preparing flash drive

Download Debian 6 image:

Please login or register to see this link.

And flash it to usb drive (this will erase all your data on flash drive):

Please login or register to see this code.

/dev/sdc - is your USB Flash.

 

3. Boot with prepared flash drive

Power off HC2.

Insert USB Flash.

Remove fibaro recovery usb-drive.

Press F10 like crazy after power on.

Select your USB flash in menu.

 

4. Fixing grub

When GRUB of flash drive appering - select failsafe mode and press enter

After boot sequence will compleate you have about 5 minutes to fix your problem (after sometime something will reboot your HC2).

 

Determine system drive device:

Please login or register to see this code.

 

You will see something like: 

Please login or register to see this code.

So, sdb is your target drive.

 

Mount SystemFS with write permissions:

Please login or register to see this code.

Install GRUB to your target device.

Please login or register to see this code.

Now you need to fix grub.cfg

Please login or register to see this code.

grub.cfg should become like this:

Please login or register to see this code.

5. Reboot

Do not forget to remove your flash drive.

It shodl boot normaly now.

  • Like 4
  • Thanks 1
Link to comment
Share on other sites

  • 1 year later...

You are a lifesaver!

I had the same issue and was able to get the HC2 running again.
I do have some remarks as the instrutions aren't fully correct.
For step 2 this is the correct location:

Please login or register to see this link.


The 64 bits version doesn not work on mine. This one did.

In step 4 the install grub command should be:

Please login or register to see this code.

 

After this my HC2 rebooted again without problems.

 

Link to comment
Share on other sites

@Vallefor:

Only one issue I have I can't boot into recovery anymore.
How can I fix that?
I guess the recovery needs an entry too into GRUB.
Can you give me instructions for that too?
When I try to boot now into recovery it just boots like normal.

Edited by SDeath
Link to comment
Share on other sites

first of alll the recovery-usb drive is not used anymore in 4.5xx, so one should better remove it on older HC2, they breaks at some point and might lock usb or power supply.

 

Anyway, mounted os-flash drive from my old HC, it looks like:

 

Please login or register to see this image.

/monthly_2021_02/image.png.6bfbd35a62e999b4434e6fb3778be661.png" />

 

 content of sda1/boot/grub/grub.cfg:

 

Please login or register to see this code.

 

 content of sda2/boot/grub/grub.cfg:

 

Please login or register to see this code.

 

  • Like 1
Link to comment
Share on other sites

@tinman
Thanks for the reply!

I have removed the Recovery drive when these problems started.
Would something like this work:
Follow the initial instructions, find the RecoveryFS and just install GRUB to that?
My grub.cfg on the SystemFS looked exactly the same as yours did, but I changed it according the instructions. Wasn't needed I guess?
Just the installation of GRUB fixed the problem, could that also fix the Recovery to boot?
I have some Linux experience but not this much.

Edited by SDeath
Link to comment
Share on other sites

no idea, grub multiboot is stupid thing, especially when files are gone from one of the systems.

Before you play a week with that, make it simple:

- enable Remote Support

- create support case ([email protected] )

 

  • Like 1
Link to comment
Share on other sites

It wasn't that easy indeed.
I tried but it didn't work like I thought it would.

I will open a support case, would that be something they could fix remotely? It is not something I am going to send it back for to Poland.
I'd rather do it myself if I can find the right instructions.

I am using my HC2 for 8 years already, eventhough my Label says Learner, I have some experience with the HC2. ;-)
I do all my LUA programming myself.

Edited by SDeath
Link to comment
Share on other sites

12 hours ago, SDeath said:

I will open a support case, would that be something they could fix remotely?

 

maybe, in principle your HC2 is booting, so you can create cloud backup with last configuration.

 

The HC2 can be then restored/repaired (as long the os flash drive is not physically broken) in multiple ways:

- remote fix grub
- disassemble HC2, remove, format and rewrite os flash drive with 4.5xx factory image - support can provide it (and then after first boot restore your cloud backup)
- downgrade (support can do it) to 4.170, downgrade Atmel firmware (to support boot from recovery flash drive and old zwave db format), factory reset and recovery to 4.170, update to 4.5xx, restore your cloud backup

 

 

Edited by tinman
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

The OS after GRUB install is booting fine, like before. First thing I did was make backups locally and in the cloud.
In all those years I maybe had to use the restore once or twice and probably last time in the early years.
So it maybe is useless trying to fix this but I hate not having the option anymore.

How is the restore these days, will it be a full restore? So would everything be restored, devices, scenes, VD, etc?

 

The 2nd option looks to be the best option as it would be a fresh start, making sure everything is like it should.
Are there any instructions for this?
I am on 4.600.

Link to comment
Share on other sites

As I thought, support isn't of much use.
They just plainly say we don't do remote sessions to fix things like this.
They have done so in the past 7-8 years ago.

So anybody can help me any further with instructions in how I can re-write the firmware on the USB?
So I can start over and get Recovery working again?

Link to comment
Share on other sites

So I have the factory image from Fibaro.
How can I flash this to the internal USB stick so that all GRUB info is back to original?

Link to comment
Share on other sites

1 hour ago, SDeath said:

So I have the factory image from Fibaro.

 

did you got it from FIBARO or other source?

Which one, 4.1xx or 4.5xx ?

 

 

1 hour ago, SDeath said:

How can I flash this to the internal USB stick so that all GRUB info is back to original?

 

depends on operating system. 

 

On windows you need first cleanup the flash drive with diskpart (select, clean, cre pre part, format) then when the drive has been formated write the image with Rufus or Win32Diskimager. On Linux dd is sufficient.

 

  • Thanks 1
Link to comment
Share on other sites

I got the image from Fibaro support:

Please login or register to see this link.


Does that look correct?

Link to comment
Share on other sites

3 minutes ago, SDeath said:

I got the image from Fibaro support:

Please login or register to see this link.


Does that look correct?

 

no, this is only firmware file (which will get burned during update - with help of recovery system,which is not running for you to sda2), not the whole image (with boot sector and all partitions).

  • Thanks 1
Link to comment
Share on other sites

I’ll try and see if support is willing to send a full image to me. Probably not. Basically also rendering the unit not able to update anymore. 
Maybe I need to start a new topic for others to pitch in that can help in getting grub multibooting again. 

Link to comment
Share on other sites

I made a clone of the internal USB drive and copied it to a SSD I had laying around, removed the internal USB drive and plugged in the SSD in the external USB.
The system booted up without issue, and also quite some faster too.
At least this way I have something to experiment with and maybe get things fixed.
And an easy way to go back to the semi working state, by just flashing the image to the SSD or plugging the original USB stick internally.

I played around with GRUB and an Debian Live USB.
I managed to get things into dual booting the SystemFS and RecoveryFS pretty easy to be honest, just added another menu entry to the 2nd grub.cfg.
And I could choose during booting which to load, but only with a keyboard attached, the button on the back does nothing to this bootmenu.
Was able to boot into recovery just fine, so that works, tried a repair which messed up the Grub system on the next boot after, GRUB rescue was prompted.
Didn't know what to do with that, so I just flashed the original image to the SSD to try again from scratch tomorrow probably.
But without the help from anybody who has more experience than me with Linux this isn't going to work probably.
It's frustrating because It's close to working just need to find the right GRUB commands and I am sure it'll work like normal.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...