Grub and External Hard Disk

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
gismondo
Level 1
Level 1
Posts: 12
Joined: Wed Nov 21, 2007 11:09 am

Grub and External Hard Disk

Post by gismondo »

Hi !
I have a doubt, I hope you can help me...
I have an external Hard Disk partitioned like this:
59 GB ext3 / (Linux Mint)
1 GB swap
100 GB ntfs (Files...)

I Installed Grub on this Hard Disk and I think the installer has intalled it in the MBR of this Disk (with Mepis I could choose to install on MBR or on the Partition)

Now my question is: if I delete the Swap and Ext3 partition and give all the space to the NTFS parition, what will happen to Grub??? I think it would remain in the MBR but then It would be useless because I have nothing to load.....

Can you help me? Thanks

P.S.:sorry for my bad english :)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Husse

Re: Grub and External Hard Disk

Post by Husse »

Don't be sorry - your english is good
This is a bit tricky - as you suspect grub (stage 1) will remain in MBR
And boot loaders don't have an uninstall command (why should they?)
I haven't checked what "Supergrub" can do (5 MB download) google for it
Otherwise fixmbr from windows - but do think twice at least so you get it done on the right disk
Or wipe the disk entirely (google for that)
gismondo
Level 1
Level 1
Posts: 12
Joined: Wed Nov 21, 2007 11:09 am

Re: Grub and External Hard Disk

Post by gismondo »

Hi !
Thanks for the reply....
This is the problem, with fixmbr you can fix a windows Installation but, in my case, windows is not installed on the external hard disk...
all I want to do is remove Grub from MBR and I think this should be Ok:

# install -mbr /dev/sdb

I think this should give me a new MBR....what do you think???

Or maybe I'd better do this:

# dd if=/dev/zero of=/dev/hda bs=446 count=1

This should zero the MBR but not the partition Table (because the other 64 bytes aren't erased)
I think the second is correct but I'm not sure...what do you think???

EDIT: I googled for the first command and it seems is not correct while here they say the second should be OK:
http://www.linuxquestions.org/questions ... y.-606489/
Can someone confirm this?

P.S.: my intention is not to criticize, but why don't we have the option of installing Grub on a specified partition in the Mint Installer (instead of installing it in the MBR)?
Fred

Re: Grub and External Hard Disk

Post by Fred »

gismondo,

My question would be: Why do you wish to erase the mbr on that hard drive? If you ever want to use that mbr again, whatever you put on it will over write the existing mbr anyway.

But, to answer your question. To erase the mbr type:

Code: Select all

sudo dd if=/dev/zero of=/dev/sdx bs=446 count=1
Adjust /dev/sdx to what applies to you.

If you wish to erase the mbr and the partition tables so you have all unallocated space on the drive type:

Code: Select all

sudo dd if=/dev/zero of=/dev/sdx bs=512 count=1
Again, adjust /dev/sdx to what applies to you.

Be very careful to get the right hard disk. Once you have done this you can't undo it. :-)

Hope this helps,

Fred
gismondo
Level 1
Level 1
Posts: 12
Joined: Wed Nov 21, 2007 11:09 am

Re: Grub and External Hard Disk

Post by gismondo »

Hi Fred !
Thanks for the reply....
as I've already said, if I want to delete all the Linux-related partition and leave all the HDD to the NTFS partition, what will be then the need of having grub installed??
All I'd like to have is no bootloader so that's why I need to erase the MBR....
Anyway after erasing the MBR with dd, I could always reinstall Grub in future right??
Fred

Re: Grub and External Hard Disk

Post by Fred »

Well, you don't need to erase grub from the mbr, but it won't hurt if you do. If you erase the mbr you can always put grub back, that's true. I just want you to understand that you gain nothing by erasing it. It will have no effect on your using the entire drive as an extra Windows ntfs drive.

To use the entire drive as ntfs you will have to use something like Gparted to destroy the Linux partitions and create another partition from the unallocated space and formate it ntfs.

If you already have an ntfs partition on that drive you could also just expand it to take all the newly freed space.

I hope I have not confused you and this is helpful. I am sorry but I only speak English. And not so good at that. :-)

Fred
gismondo
Level 1
Level 1
Posts: 12
Joined: Wed Nov 21, 2007 11:09 am

Re: Grub and External Hard Disk

Post by gismondo »

Ok, thanks a lot Fred!

EDIT: sorry, I have a last question...
let's suppose I have an Hard disk (/dev/sdb) of 100 Gb partitioned like this:
1 Gb Swap
59 GB ext3 / Linux Mint
40 GB ext3
Grub is installed in the MBR, in grub language (hd1,0)
Let's say I want to install another distro in the 40Gb partition and I choose to reinstall Grub....
Obviously it will overwrite the grub which is installed now, but then what will happen to the /boot/grub folder which I have now on the 59Gb partition??
I know it's a bit complicated but I really need to know what will happen in case like this...
I hope you can help me
Locked

Return to “Installation & Boot”