Przywracanie GRUB’a

Przywracanie bootloadera GRUB za pomocą systemu systemu linux LiveCD na przykładzie Ubuntu.

Aby móc przywrócić nasz boot loader po pierwsze musimy zaopatrzyć się w jakąkolwiek wersję linuxa dostępną na LiveCD, najpopularniejszą i chyba najbardziej znaną jest Ubuntu. Najnowszą wersję tego systemu możemy pobrać tutaj. Jeżeli wolimy Ubuntu w ojczystym języku pobieramy go stąd.

Jeżeli już posiadamy wspomniany wcześniej system, uruchamiamy nasz komputer bootując go z płyty CD.

Po uruchomieniu systemu włączamy terminal i wpisujemy:

$ sudo fdisk -l

Polecenie to wylistuje wszystkie dostępne partycje w naszym komputerze. W wyświetlonej liście poszukujemy partycji, na której zainstalowaliśmy naszą dystrybucję systemu linux i zapamiętujemy, które do urządzenie. W moim przypadku będzie to /dev/sda1.

Kolejnym krokiem jest zamontowanie wybranej partycji w wybranym katalogu, co robimy poleceniem:

$ sudo mount /dev/sda1 /mnt

Jak widzimy montujemy naszą partycję linuksową w katalogu /mnt.

Jeżeli posiadamy katalog /boot na oddzielnej partycji musimy ją również zamontować (na przykład przyjmijmy, że katalog ten znajduje sie na /dev/sda2):

$ sudo mount /dev/sda2 /mnt/boot

Następnie montujemy pozostałe elementy, które będą nam potrzebne przy zmianie głównego katalogu systemu:

$ sudo mount –bind /dev /mnt/dev
$ sudo mount –bind /proc /mnt/proc
$ sudo mount –bind /sys /mnt/sys

Teraz możemy przystąpić do zmiany głównego katalogu w jakim będzie pracował system. Zmiany dokonujemy poleceniem chroot.

$ sudo chroot /mnt

Dzięki komendzie chroot możemy pracować na plikach zainstalowanej dystrybucji linuxa na naszej zamontowanej partycji.

Obecnie posiadamy prawa root’a w systemie i nie musimy już wywoływać polecenia sudo.

Możemy teraz przystąpić do naprawy naszego bootloadera. Edytujemy plik /etc/default/grub aby zmienić konfigurację GRUB’a.

$ nano /etc/default/grub

Kiedy skończymy edycję musimy wykonać polecenie:

$ update-grub

w celu stworzenia nowego pliku konfiguracyjnego.

Jeżeli chcemy dokonać instalacji GRUB 2 w MBR, musimy uruchomić polecenie grub-install i wskazać partycję, na której dokonujemy instalacji:

$ grub-install /dev/sda

Jeżeli podczas wykonywania powyższego polecenia wystąpią jakieś błędy możemy spróbować wykonać polecenie:

$ grub-install –recheck /dev/sda

Jeżeli wszystko przebiegło pomyślnie wciskamy Ctrl+D aby powrócić do wcześniejszego katalogu głównego systemu.

Przed zakończeniem pracy musimy odmontować wszystkie wcześniej zamontowane urządzenia zaczynając od:

$ sudo umount /mnt/dev
$ sudo umount /mnt/sys
$ sudo umount /mnt/proc

Teraz już możemy odmontować główny system plików, ale jeśli montowaliśmy oddzielną partycję bootującą (/boot) musimy ją pierwszą odmontować i dopiero potem główny system plików:

$ sudo umount /mnt

Gdy odmontujemy już wszystkie urządzenia możemy wyłączyć komputer i wyjąć płytę z Ubuntu. Po ponownym włączeniu komputera powinien ukazać się naszym oczom ekran wyboru systemu GRUB’a.

SuperGrubDisk

Alternatywnym rozwiązaniem jest wykorzystanie niedużej dystrybucji linuxa SuperGrubDisk umożliwia ona wykrywanie i bootowanie systemu, jak również przywrócenie i instalację GRUB’a. Na stronie projektu znajdziemy również wiele przydatnych informacji dotyczących problemów z bootowanie systemu i GRUB’em.


Tekst powstał na podstawie: Recover Grub 2 via LiveCD

7,939 thoughts on “Przywracanie GRUB’a”

  1. When people started with inventions and discoveries they never thought that science could turn out to be so disastrous.

    Martin Main LIne Honda supplies Honda Automotive Sales, Service and Leasing.
    In fact the work describes only about two dozen positions, and most of these are relatively easy to accomplish
    if the woman is reasonably supple.

  2. I’m truly enjoying the design and layout of your site.
    It’s a very easy on the eyes which makes it much more enjoyable for me to come
    here and visit more often. Did you hire out a developer
    to create your theme? Excellent work!

  3. Great beat ! I wish to apprentice while you amend your site, how can i subscribe for a blog website? The account helped me a acceptable deal. I had been a little bit acquainted of this your broadcast provided bright clear concept

  4. I would like to thnkx for the efforts you’ve put in writing this website. I’m hoping the same high-grade website post from you in the upcoming as well. Actually your creative writing abilities has encouraged me to get my own web site now. Really the blogging is spreading its wings quickly. Your write up is a great example of it.

  5. The organization make, Jordan and 2014 high level “wealth” compilation of
    fresh Jordan in addition transferred currently to typically the 2014 individuals “platinum” saga, the country’s most potent on the behalf of
    each NBA TEAM LeBron 3 leading members of your số 11,
    KD vår hemsida furthermore Kobe 9 development under the interesting dept.
    Together with company champ given to desire said, apart from enduring ones own colors,
    made component in common is definitely enrolled
    with the halcyon facts increase, the actual who owns really horseshoe LeBron river,
    Kevin entières in addition to Kobe Bryant,
    Kevin still have to initiative of championship our own run, nevertheless the range will likely technique of huang
    3 illustrates. Trainers might be issued concerning Gregorian calendar
    month 6, satisfy you should listen.

  6. I know this website presents quality depending content and
    additional information, is there any other web site which presents such things in quality?

  7. An interesting discussion is worth comment. I believe that you need
    to write more on this issue, it may not be a taboo matter but usually people don’t
    speak about such topics. To the next! All the best!!

  8. Howdy very cool site!! Man .. Excellent .. Wonderful .. I’ll bookmark your web site and take the feeds also¡KI am glad to search out numerous useful info here within the post, we want work out extra strategies on this regard, thanks for sharing. . . . . .

  9. I will immediately snatch your rss as I can not find your e-mail subscription hyperlink or newsletter service. Do you’ve any? Please permit me recognise in order that I may just subscribe. Thanks.

  10. Hi, i read your blog occasionally and i own a similar one and i was just wondering if you get a lot of spam responses?
    If so how do you reduce it, any plugin or anything you can advise?
    I get so much lately it’s driving me insane so any assistance is very much appreciated.

  11. I have read several excellent stuff here.
    Definitely price bookmarking for revisiting. I wonder how a lot effort you place
    to make the sort of fantastic informative website.

  12. Hiya, I am really glad I have found this info. Nowadays bloggers publish just about gossips and internet and this is actually irritating. A good site with interesting content, this is what I need. Thank you for keeping this web site, I’ll be visiting it. Do you do newsletters? Can not find it.

  13. Good day very cool blog!! Guy .. Excellent .. Amazing .. I’ll bookmark your
    site and take the feeds additionally? I am satisfied to search
    out a lot of helpful information right here in the submit, we want work out more strategies in this regard, thanks for sharing.
    . . . . .

  14. Hello my friend! I want to say that this article is amazing, nice written and include almost all important infos. I would like to look more posts like this .

  15. Similarly, traveling with style, luxury and comfort is every person’s dream.

    In such cases the Router self establishes the connection with the other devices.

    In fact limousines are the world’s most expensive vehicles
    which are designed for sheer luxury and style.

  16. I need to to thank you for this fantastic
    read!! I certainly enjoyed every little bit of it. I have got
    you saved as a favorite to look at new things you post…

  17. I absolutely love your website.. Very nice colors & theme.
    Did you build this amazing site yourself? Please reply
    back as I’m looking to create my own site and want to find out where you got this from or just what the theme is
    named. Many thanks!

  18. I think this is one of the most important info for me. And i’m glad reading your article. But should remark on few general things, The website style is great, the articles is really excellent : D. Good job, cheers

  19. The memory slots are slightly hidden behind a door on the leading panel.
    Dancers support which they feel younger than non-dancers as
    well as the the fact is that they can do look better. Shoes are usually a really
    significant accessory presenting personality with style.

  20. I simply wanted to say thanks again. I’m not certain the things I would’ve carried out in the absence of these points provided by you regarding such field. It was before a real daunting difficulty in my view, nevertheless considering the very skilled style you treated the issue took me to jump with fulfillment. Extremely grateful for the advice and then expect you comprehend what a great job that you’re putting in training the rest all through your site. Most likely you’ve never met all of us.

  21. Very nice post. I just stumbled upon your blog and wanted to say that I’ve really enjoyed browsing your blog posts. In any case I’ll be subscribing to your feed and I hope you write again soon!

  22. Howdy! This post couldn’t be written much better! Goin through this poist reminds me of my previous roommate!
    He continually kept preaching about this. I’ll forward
    this informayion to him. Pretty surre he will have a great
    read. Many thanks for sharing!

  23. Undeniably believe that which you said. Your favorite justification appeared to be on the net the easiest thing to be aware of. I say to you, I definitely get annoyed while people consider worries that they just don’t know about. You managed to hit the nail upon the top and also defined out the whole thing without having side effect , people could take a signal. Will probably be back to get more. Thanks

  24. Flexsteel doesn’t always make it clear how all their groups and collections fit together and many furniture stores
    don’t mark their pieces in a way that makes it easy for buyers to understand what they are looking at.
    Luxury seat cushions consist of high resilient foam for optimal comfort.
    This method allows the natural details of the leather to remain visible while offering superior
    durability.

  25. Pretty nice post.I just stumbled upon yojr weblog and wanted to say that I hve truly enjoyed browsing yourr blg posts.

    In anny case I’ll be subscribing to your feed and I hope
    you wrote again very soon!

  26. Hey there! This is my 1st comment here so I just wanted to
    give a quick shout out and tell you I genuinely enjoy reading through your posts.
    Can you suggest any other blogs/websites/forums that deal with
    the same topics? Thanks!

Leave a Reply