You are not logged in.
Hello,
I would like to restore grub to mbr.
This is what I have done so far.
I mounted the target partition into /mnt.
I arch-chroot-ed into /mnt
I issued the command: grub-install /dev/sda
I got the message: rm cannot remove /boot/grub/i386-pc/core.img: Operation not permitted
Could anyone help how to proceed?
Thanks.
Last edited by jmak (2012-10-07 22:15:14)
Offline
Offline
How did you install grub the first time? Did you set the immutable flag on core.img when you installed grub? Did you issue this command:
# chattr +i /boot/grub/i386-pc/core.img
?
How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.
Offline
How did you install grub the first time? Did you set the immutable flag on core.img when you installed grub? Did you issue this command:
# chattr +i /boot/grub/i386-pc/core.img
?
Yes, I did because, the first time I installed grub in its own partition, rather than mbr.
Offline
You will need to unset that flag. "immutable" means "don't allow this file to be changed or deleted."
# chattr -i /boot/grub/i386-pc/core.img
How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.
Offline
From man 1 chattr :
A file with the `i' attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file and no data can be written to the file.
Offline
You will need to unset that flag. "immutable" means "don't allow this file to be changed or deleted."
# chattr -i /boot/grub/i386-pc/core.img
How should I do that? Or you think it is better not to mess with grub and leave as it is now?
Offline
Use the command in my post (the one you quoted). You set it with +i, so unset it with -i.
Last edited by 2ManyDogs (2012-10-07 21:31:02)
How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.
Offline
Use the command in my post (the one you quoted). You set it with +i, so unset it with -i.
One more question before I go ahead and do that. After instlling grub:
# grub-install --target=i386-pc --recheck --debug /dev/sda
Do I still have to do:
# mkdir -p /boot/grub/locale
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
I already have done these when intalled arch at first time.
I already have the "locale" directory on my system.
Im asking these questions just to make sure I won't mess up my system.
Offline
I'm not absolutely sure. I suspect you do not have to do those steps again if the directory exists and you ran the cp command.
Just so we're clear, I never promised that anything I recommended would not "mess up your system." But if it does, I'm sure WonderWoofy will be happy to help you fix it
(And breaking things and fixing them is a learning opportunity)
Last edited by 2ManyDogs (2012-10-07 21:51:01)
How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.
Offline
I'm not absolutely sure. I suspect you do not have to do those steps again if the directory exists and you ran the cp command.
Just so we're clear, I never promised that anything I recommended would not "mess up your system."
But if it does, I'm sure WonderWoofy will be happy to help you fix it
(And breaking things and fixing them is a learning opportunity)
Thanks for everybody the help.
Grub now, successfully installed in mbr.
One more question before I mark the thread solved.
Should I issue the: # chattr +i ... command to make the directory "immutable" again, or just leave as it is?
Offline
You can leave it unset. That command is not part of the instructions for installing grub to the mbr.
By the way, if you're wondering how I knew the answer to this question, I just did an Ixquick search on the exact error message you got, and I found a topic on another board that discussed how to fix it.
How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.
Offline