Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: [SOLVED] Reformat /boot

  1. #1
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Question [SOLVED] Reformat /boot

    I have GRUB on a floppy all backed up, and I want to remove or reformat /boot so when the system boots, it will say there is no operating system, instead of taking me to a GRUB prompt.

    What is the safest way to do this?

    I plan to just open gParted and reformat /dev/sda1. Will that accomplish what I want to do ?

    Dr Small
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  2. #2
    Join Date
    Apr 2008
    Beans
    3,317
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: Reformat /boot

    it will say there is no operating system,
    Why?

    Anyway, if you deleted the boot folder, or say just the grub folder, you will get a grub error (Probably Error 22)

    "No operating system" would be a message from the bios. To get this you would have to delete the Grub code from the MBR. For example you could write zeroes to the first 440 bytes of the hard drive. (In this case it would not matter whether you still have your grub folder)

    Some bios actually will report this error if none of your primary partitions have a boot flag. That can be easily achieved with "gparted" or "cfdisk".

  3. #3
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Reformat /boot

    Well here's the thing. I do have /boot/grub renamed to /boot/grub_bak, and it used to give me an error on Ubuntu, but now with it, it takes me to a grub prompt where I enter commands to boot it, rather that simply giving me an error.
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  4. #4
    Join Date
    Apr 2008
    Beans
    3,317
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: Reformat /boot

    Are you just try playing around to learning purposes? (I do that all the time)

    it used to give me an error on Ubuntu, but now with it,
    Did you change anything, which could have caused the different behavior?


    it takes me to a grub prompt where I enter commands to boot it, rather that simply giving me an error.
    This means that grub can still find the stage2 files, but cannot find menu.lst. Doesn't make much sense, since the stage2 files are also in /boot/grub. I had a similar experience once: I replace the stage2 file with the stage2 files from supergrub, but grub still used my old stage2 files. Only after reinstalling grub, the supergrub stage2 files were used. So I made up the theory that the grub code in the mbr contains the physical address for the stage2 files. So grub does not look for the file via the "/boot/grub/stage2" but goes right to the place on the hard drive, the stage2 files are stored. Renaming the grub folder does not change the physical location of the stage2 file. But I did same more experiment which seem to contradict this theory. So I'm not sure what really is going on.

  5. #5
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Reformat /boot

    Well, it certainly must be using Grub Stage 2 file somehow. I no longer have any 'grub' directory in /boot, as I moved it it my home folder, yet I am still taken to the 'grub>_' prompt at bootup.

    So now the question, how would I go about reinstalling GRUB, so I can get this to work right?

    I did this back on Ubuntu and never had a slightest problem. Just renamed 'grub' and then it gave me a GRUB File missing error. So I thought it should do similar on Arch. Apparently I have been proven wrong.

    Yes, I am tinkering and playing around. Like to try different odd things at times that makes my friends look at me bewilderment

    Basically, I like to have my system unbootable without the GRUB floppy. Sorta like an extra access key to get the system running, if you bypassed my BIOS bootup password

    Dr Small
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  6. #6
    Join Date
    Mar 2008
    Location
    Republic of Texas
    Beans
    Hidden!

    Re: Reformat /boot

    Here's a reinstall guide for grub in the Arch wiki:
    http://wiki.archlinux.org/index.php/Reinstalling_GRUB
    ..and the writing's on the wall,
    but the walls have all come down,
    if you can't see past the truth,
    I love to let you down..

  7. #7
    Join Date
    Apr 2008
    Beans
    3,317
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: Reformat /boot

    Basically, I like to have my system unbootable without the GRUB floppy.
    Writing zeros to the first 440 bytes of the hard drive and removing all boot flags will definitely do that. (But of course you could still boot your system with all kinds of external media other than a Grub floppy.)

    I won't tell you how to write zeros to the MBR. If you can't figure that out by yourself, you shouldn't be doing it.

  8. #8
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Reformat /boot

    Ok. I found the command (or created it as I went, anyhow):
    Code:
    sudo dd if=/dev/zero of=/dev/sda1 bs=446 count=1
    Didn't do squat, as I was still getting the same stuff after running it, so I reformatted sda1, and now I can't boot!!!!

    Just kidding of course.
    I moved all of the files in /boot over to /kernels and edited my menu.lst around to point to /kernels/vmlinuz sort of stuff, so now it works.

    I then just flat out deleted sda1, resized sda2 and moved the remaining space into sda5, as my swap. Now when I reboot without the floppy in, I get:
    Code:
    GRUB _
    (only the underscore blinks very fast )

    I would have rather it not said GRUB, but I guess I can live with it. Thanks for all the help.

    Dr Small
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  9. #9
    Join Date
    Apr 2008
    Beans
    3,317
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: Reformat /boot

    Didn't do squat,
    That's because you are doing it wrong.
    Last edited by meierfra.; May 30th, 2008 at 11:18 PM.

  10. #10
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Reformat /boot

    Thanks for the information. Maybe you could explain how I was doing it wrong, so I could learn from my mistakes?
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •