Repair my partitions and reinstall Grub2
I messed up my partitions because I wanted to increase my Ubuntu disk space (I had a boot partition between the two partitions I wanted to merge, so tried to delete merge partitions and re-install grub2) I used gparted.
But I am not able to re-install grub2 facing errors
GRUB failed to install to the following devices: /dev/nvme0n1
I have/had dual-boot configuration with a partition for windows and Ubuntu (I took some space from Windows partition to increase Ubuntu partition)
➜ ~ sudo parted -l
Model: ATA TOSHIBA MQ01ACF0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 500GB 500GB Basic data partition msftdata
Model: PC300 NVMe SK hynix 256GB (nvme)
Disk /dev/nvme0n1: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
I tried to purge/reinstall grub:
sudo apt-get purge grub grub-pc grub-common
sudo apt-get install grub-common grub-pc
The problem is that GParted don't see any partition anymore :-/ so how can I create my bios-boot partition without damaging the other partitions ?
Disks how a little better view lol but my windows partition is detected as free space...
Thanks
boot dual-boot grub2 partitioning gparted
New contributor
|
show 5 more comments
I messed up my partitions because I wanted to increase my Ubuntu disk space (I had a boot partition between the two partitions I wanted to merge, so tried to delete merge partitions and re-install grub2) I used gparted.
But I am not able to re-install grub2 facing errors
GRUB failed to install to the following devices: /dev/nvme0n1
I have/had dual-boot configuration with a partition for windows and Ubuntu (I took some space from Windows partition to increase Ubuntu partition)
➜ ~ sudo parted -l
Model: ATA TOSHIBA MQ01ACF0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 500GB 500GB Basic data partition msftdata
Model: PC300 NVMe SK hynix 256GB (nvme)
Disk /dev/nvme0n1: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
I tried to purge/reinstall grub:
sudo apt-get purge grub grub-pc grub-common
sudo apt-get install grub-common grub-pc
The problem is that GParted don't see any partition anymore :-/ so how can I create my bios-boot partition without damaging the other partitions ?
Disks how a little better view lol but my windows partition is detected as free space...
Thanks
boot dual-boot grub2 partitioning gparted
New contributor
2
When you said you deleted the Boot partition did you delete /boot partition which most desktops do not have, or the ESP - efi system partition which is required for UEFI boot. With gpt partitioning you have to either have the ESP (FAT32) or bios_grub partition (unformatted) for grub to install. Did you leave Windows fast start up on? Then Linux NTFS driver cannot see the NTFS partition(s). askubuntu.com/questions/743095/… If you left fast start up on, you may need to use your Windows repair disk first.
– oldfred
2 days ago
Gparted works fine. You're looking at the wrong partition. If you click on the up-down arrow in the top right corner you should see the 32 GB partition. It looks like that you removed the EFS boot partition. First make a new 150MB FAT32 partition, then boot into Live Ubuntu and perform a Boot-Repair.
– Paul Benson
2 days ago
@oldfred this what I shouldn't have done unix.stackexchange.com/questions/401002/… (the deleted partition was grub2 core.img).
– rad
2 days ago
1
First edit question. Delete theblkid
output and thepurge grub
image stuff. Start Terminal (ctrl+alt+t) and runsudo parted -l
. Post up output from that.
– Paul Benson
2 days ago
1
Boot-Repair does not create partitions, it assumes you have correct partition for version you are using, or an ESP for UEFI or bios_grub for BIOS boot mode. And if Windows issues, you must fix those first and cannot do that from Ubuntu.
– oldfred
2 days ago
|
show 5 more comments
I messed up my partitions because I wanted to increase my Ubuntu disk space (I had a boot partition between the two partitions I wanted to merge, so tried to delete merge partitions and re-install grub2) I used gparted.
But I am not able to re-install grub2 facing errors
GRUB failed to install to the following devices: /dev/nvme0n1
I have/had dual-boot configuration with a partition for windows and Ubuntu (I took some space from Windows partition to increase Ubuntu partition)
➜ ~ sudo parted -l
Model: ATA TOSHIBA MQ01ACF0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 500GB 500GB Basic data partition msftdata
Model: PC300 NVMe SK hynix 256GB (nvme)
Disk /dev/nvme0n1: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
I tried to purge/reinstall grub:
sudo apt-get purge grub grub-pc grub-common
sudo apt-get install grub-common grub-pc
The problem is that GParted don't see any partition anymore :-/ so how can I create my bios-boot partition without damaging the other partitions ?
Disks how a little better view lol but my windows partition is detected as free space...
Thanks
boot dual-boot grub2 partitioning gparted
New contributor
I messed up my partitions because I wanted to increase my Ubuntu disk space (I had a boot partition between the two partitions I wanted to merge, so tried to delete merge partitions and re-install grub2) I used gparted.
But I am not able to re-install grub2 facing errors
GRUB failed to install to the following devices: /dev/nvme0n1
I have/had dual-boot configuration with a partition for windows and Ubuntu (I took some space from Windows partition to increase Ubuntu partition)
➜ ~ sudo parted -l
Model: ATA TOSHIBA MQ01ACF0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 500GB 500GB Basic data partition msftdata
Model: PC300 NVMe SK hynix 256GB (nvme)
Disk /dev/nvme0n1: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
I tried to purge/reinstall grub:
sudo apt-get purge grub grub-pc grub-common
sudo apt-get install grub-common grub-pc
The problem is that GParted don't see any partition anymore :-/ so how can I create my bios-boot partition without damaging the other partitions ?
Disks how a little better view lol but my windows partition is detected as free space...
Thanks
boot dual-boot grub2 partitioning gparted
boot dual-boot grub2 partitioning gparted
New contributor
New contributor
edited 2 days ago
rad
New contributor
asked 2 days ago
radrad
1011
1011
New contributor
New contributor
2
When you said you deleted the Boot partition did you delete /boot partition which most desktops do not have, or the ESP - efi system partition which is required for UEFI boot. With gpt partitioning you have to either have the ESP (FAT32) or bios_grub partition (unformatted) for grub to install. Did you leave Windows fast start up on? Then Linux NTFS driver cannot see the NTFS partition(s). askubuntu.com/questions/743095/… If you left fast start up on, you may need to use your Windows repair disk first.
– oldfred
2 days ago
Gparted works fine. You're looking at the wrong partition. If you click on the up-down arrow in the top right corner you should see the 32 GB partition. It looks like that you removed the EFS boot partition. First make a new 150MB FAT32 partition, then boot into Live Ubuntu and perform a Boot-Repair.
– Paul Benson
2 days ago
@oldfred this what I shouldn't have done unix.stackexchange.com/questions/401002/… (the deleted partition was grub2 core.img).
– rad
2 days ago
1
First edit question. Delete theblkid
output and thepurge grub
image stuff. Start Terminal (ctrl+alt+t) and runsudo parted -l
. Post up output from that.
– Paul Benson
2 days ago
1
Boot-Repair does not create partitions, it assumes you have correct partition for version you are using, or an ESP for UEFI or bios_grub for BIOS boot mode. And if Windows issues, you must fix those first and cannot do that from Ubuntu.
– oldfred
2 days ago
|
show 5 more comments
2
When you said you deleted the Boot partition did you delete /boot partition which most desktops do not have, or the ESP - efi system partition which is required for UEFI boot. With gpt partitioning you have to either have the ESP (FAT32) or bios_grub partition (unformatted) for grub to install. Did you leave Windows fast start up on? Then Linux NTFS driver cannot see the NTFS partition(s). askubuntu.com/questions/743095/… If you left fast start up on, you may need to use your Windows repair disk first.
– oldfred
2 days ago
Gparted works fine. You're looking at the wrong partition. If you click on the up-down arrow in the top right corner you should see the 32 GB partition. It looks like that you removed the EFS boot partition. First make a new 150MB FAT32 partition, then boot into Live Ubuntu and perform a Boot-Repair.
– Paul Benson
2 days ago
@oldfred this what I shouldn't have done unix.stackexchange.com/questions/401002/… (the deleted partition was grub2 core.img).
– rad
2 days ago
1
First edit question. Delete theblkid
output and thepurge grub
image stuff. Start Terminal (ctrl+alt+t) and runsudo parted -l
. Post up output from that.
– Paul Benson
2 days ago
1
Boot-Repair does not create partitions, it assumes you have correct partition for version you are using, or an ESP for UEFI or bios_grub for BIOS boot mode. And if Windows issues, you must fix those first and cannot do that from Ubuntu.
– oldfred
2 days ago
2
2
When you said you deleted the Boot partition did you delete /boot partition which most desktops do not have, or the ESP - efi system partition which is required for UEFI boot. With gpt partitioning you have to either have the ESP (FAT32) or bios_grub partition (unformatted) for grub to install. Did you leave Windows fast start up on? Then Linux NTFS driver cannot see the NTFS partition(s). askubuntu.com/questions/743095/… If you left fast start up on, you may need to use your Windows repair disk first.
– oldfred
2 days ago
When you said you deleted the Boot partition did you delete /boot partition which most desktops do not have, or the ESP - efi system partition which is required for UEFI boot. With gpt partitioning you have to either have the ESP (FAT32) or bios_grub partition (unformatted) for grub to install. Did you leave Windows fast start up on? Then Linux NTFS driver cannot see the NTFS partition(s). askubuntu.com/questions/743095/… If you left fast start up on, you may need to use your Windows repair disk first.
– oldfred
2 days ago
Gparted works fine. You're looking at the wrong partition. If you click on the up-down arrow in the top right corner you should see the 32 GB partition. It looks like that you removed the EFS boot partition. First make a new 150MB FAT32 partition, then boot into Live Ubuntu and perform a Boot-Repair.
– Paul Benson
2 days ago
Gparted works fine. You're looking at the wrong partition. If you click on the up-down arrow in the top right corner you should see the 32 GB partition. It looks like that you removed the EFS boot partition. First make a new 150MB FAT32 partition, then boot into Live Ubuntu and perform a Boot-Repair.
– Paul Benson
2 days ago
@oldfred this what I shouldn't have done unix.stackexchange.com/questions/401002/… (the deleted partition was grub2 core.img).
– rad
2 days ago
@oldfred this what I shouldn't have done unix.stackexchange.com/questions/401002/… (the deleted partition was grub2 core.img).
– rad
2 days ago
1
1
First edit question. Delete the
blkid
output and the purge grub
image stuff. Start Terminal (ctrl+alt+t) and run sudo parted -l
. Post up output from that.– Paul Benson
2 days ago
First edit question. Delete the
blkid
output and the purge grub
image stuff. Start Terminal (ctrl+alt+t) and run sudo parted -l
. Post up output from that.– Paul Benson
2 days ago
1
1
Boot-Repair does not create partitions, it assumes you have correct partition for version you are using, or an ESP for UEFI or bios_grub for BIOS boot mode. And if Windows issues, you must fix those first and cannot do that from Ubuntu.
– oldfred
2 days ago
Boot-Repair does not create partitions, it assumes you have correct partition for version you are using, or an ESP for UEFI or bios_grub for BIOS boot mode. And if Windows issues, you must fix those first and cannot do that from Ubuntu.
– oldfred
2 days ago
|
show 5 more comments
1 Answer
1
active
oldest
votes
You want to avoid using apt purge
or apt remove
on packages involving GRUB since it can leave your system in an unbootable state. Instead, there are two commands that exist to resolve these kinds of problems:
sudo update-grub
takes an already installed GRUB and updates it's configuration so that it can find bootable partitions and put them into menu, create separate menu entries for all the available kernels, etc.
grub-install some_disk
will install GRUB into the provided disk and update the Master Boot Record (MBR) of the system.
To further complicate things Windows has a very nasty habit of not actually shutting down, but instead hibernating. This causes serious problems because you shut windows down, go into Ubuntu or some other operating system, make changes to the disk, then go back into Windows. However, since you never actually "shutdown" Windows it stayed in memory and when shutting down clobbered the disk overwriting the changes you've made to the partition layout.
I have also seen a bug with GParted where some changes made to the disk while the system was booted weren't reflected in GParted until after restarting.
My suggestion is use the System Rescue CD to resolve the problem. In specific it contains Test Disk which can help recover deleted partitions, which is effectively what has likely happened.
Thanks for your answer, I tried testdisk but it didn't see my disk (/dev/nvm0n1 it sees only /dev/sda). I also tried update-grub and grub-install which failed with the same error message: grub-install: error: cannot find a GRUB drive for /dev/nvme0n1p6. Check your device.map.
– rad
2 days ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
rad is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1113841%2frepair-my-partitions-and-reinstall-grub2%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You want to avoid using apt purge
or apt remove
on packages involving GRUB since it can leave your system in an unbootable state. Instead, there are two commands that exist to resolve these kinds of problems:
sudo update-grub
takes an already installed GRUB and updates it's configuration so that it can find bootable partitions and put them into menu, create separate menu entries for all the available kernels, etc.
grub-install some_disk
will install GRUB into the provided disk and update the Master Boot Record (MBR) of the system.
To further complicate things Windows has a very nasty habit of not actually shutting down, but instead hibernating. This causes serious problems because you shut windows down, go into Ubuntu or some other operating system, make changes to the disk, then go back into Windows. However, since you never actually "shutdown" Windows it stayed in memory and when shutting down clobbered the disk overwriting the changes you've made to the partition layout.
I have also seen a bug with GParted where some changes made to the disk while the system was booted weren't reflected in GParted until after restarting.
My suggestion is use the System Rescue CD to resolve the problem. In specific it contains Test Disk which can help recover deleted partitions, which is effectively what has likely happened.
Thanks for your answer, I tried testdisk but it didn't see my disk (/dev/nvm0n1 it sees only /dev/sda). I also tried update-grub and grub-install which failed with the same error message: grub-install: error: cannot find a GRUB drive for /dev/nvme0n1p6. Check your device.map.
– rad
2 days ago
add a comment |
You want to avoid using apt purge
or apt remove
on packages involving GRUB since it can leave your system in an unbootable state. Instead, there are two commands that exist to resolve these kinds of problems:
sudo update-grub
takes an already installed GRUB and updates it's configuration so that it can find bootable partitions and put them into menu, create separate menu entries for all the available kernels, etc.
grub-install some_disk
will install GRUB into the provided disk and update the Master Boot Record (MBR) of the system.
To further complicate things Windows has a very nasty habit of not actually shutting down, but instead hibernating. This causes serious problems because you shut windows down, go into Ubuntu or some other operating system, make changes to the disk, then go back into Windows. However, since you never actually "shutdown" Windows it stayed in memory and when shutting down clobbered the disk overwriting the changes you've made to the partition layout.
I have also seen a bug with GParted where some changes made to the disk while the system was booted weren't reflected in GParted until after restarting.
My suggestion is use the System Rescue CD to resolve the problem. In specific it contains Test Disk which can help recover deleted partitions, which is effectively what has likely happened.
Thanks for your answer, I tried testdisk but it didn't see my disk (/dev/nvm0n1 it sees only /dev/sda). I also tried update-grub and grub-install which failed with the same error message: grub-install: error: cannot find a GRUB drive for /dev/nvme0n1p6. Check your device.map.
– rad
2 days ago
add a comment |
You want to avoid using apt purge
or apt remove
on packages involving GRUB since it can leave your system in an unbootable state. Instead, there are two commands that exist to resolve these kinds of problems:
sudo update-grub
takes an already installed GRUB and updates it's configuration so that it can find bootable partitions and put them into menu, create separate menu entries for all the available kernels, etc.
grub-install some_disk
will install GRUB into the provided disk and update the Master Boot Record (MBR) of the system.
To further complicate things Windows has a very nasty habit of not actually shutting down, but instead hibernating. This causes serious problems because you shut windows down, go into Ubuntu or some other operating system, make changes to the disk, then go back into Windows. However, since you never actually "shutdown" Windows it stayed in memory and when shutting down clobbered the disk overwriting the changes you've made to the partition layout.
I have also seen a bug with GParted where some changes made to the disk while the system was booted weren't reflected in GParted until after restarting.
My suggestion is use the System Rescue CD to resolve the problem. In specific it contains Test Disk which can help recover deleted partitions, which is effectively what has likely happened.
You want to avoid using apt purge
or apt remove
on packages involving GRUB since it can leave your system in an unbootable state. Instead, there are two commands that exist to resolve these kinds of problems:
sudo update-grub
takes an already installed GRUB and updates it's configuration so that it can find bootable partitions and put them into menu, create separate menu entries for all the available kernels, etc.
grub-install some_disk
will install GRUB into the provided disk and update the Master Boot Record (MBR) of the system.
To further complicate things Windows has a very nasty habit of not actually shutting down, but instead hibernating. This causes serious problems because you shut windows down, go into Ubuntu or some other operating system, make changes to the disk, then go back into Windows. However, since you never actually "shutdown" Windows it stayed in memory and when shutting down clobbered the disk overwriting the changes you've made to the partition layout.
I have also seen a bug with GParted where some changes made to the disk while the system was booted weren't reflected in GParted until after restarting.
My suggestion is use the System Rescue CD to resolve the problem. In specific it contains Test Disk which can help recover deleted partitions, which is effectively what has likely happened.
answered 2 days ago
Kristopher IvesKristopher Ives
2,53711322
2,53711322
Thanks for your answer, I tried testdisk but it didn't see my disk (/dev/nvm0n1 it sees only /dev/sda). I also tried update-grub and grub-install which failed with the same error message: grub-install: error: cannot find a GRUB drive for /dev/nvme0n1p6. Check your device.map.
– rad
2 days ago
add a comment |
Thanks for your answer, I tried testdisk but it didn't see my disk (/dev/nvm0n1 it sees only /dev/sda). I also tried update-grub and grub-install which failed with the same error message: grub-install: error: cannot find a GRUB drive for /dev/nvme0n1p6. Check your device.map.
– rad
2 days ago
Thanks for your answer, I tried testdisk but it didn't see my disk (/dev/nvm0n1 it sees only /dev/sda). I also tried update-grub and grub-install which failed with the same error message: grub-install: error: cannot find a GRUB drive for /dev/nvme0n1p6. Check your device.map.
– rad
2 days ago
Thanks for your answer, I tried testdisk but it didn't see my disk (/dev/nvm0n1 it sees only /dev/sda). I also tried update-grub and grub-install which failed with the same error message: grub-install: error: cannot find a GRUB drive for /dev/nvme0n1p6. Check your device.map.
– rad
2 days ago
add a comment |
rad is a new contributor. Be nice, and check out our Code of Conduct.
rad is a new contributor. Be nice, and check out our Code of Conduct.
rad is a new contributor. Be nice, and check out our Code of Conduct.
rad is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1113841%2frepair-my-partitions-and-reinstall-grub2%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
When you said you deleted the Boot partition did you delete /boot partition which most desktops do not have, or the ESP - efi system partition which is required for UEFI boot. With gpt partitioning you have to either have the ESP (FAT32) or bios_grub partition (unformatted) for grub to install. Did you leave Windows fast start up on? Then Linux NTFS driver cannot see the NTFS partition(s). askubuntu.com/questions/743095/… If you left fast start up on, you may need to use your Windows repair disk first.
– oldfred
2 days ago
Gparted works fine. You're looking at the wrong partition. If you click on the up-down arrow in the top right corner you should see the 32 GB partition. It looks like that you removed the EFS boot partition. First make a new 150MB FAT32 partition, then boot into Live Ubuntu and perform a Boot-Repair.
– Paul Benson
2 days ago
@oldfred this what I shouldn't have done unix.stackexchange.com/questions/401002/… (the deleted partition was grub2 core.img).
– rad
2 days ago
1
First edit question. Delete the
blkid
output and thepurge grub
image stuff. Start Terminal (ctrl+alt+t) and runsudo parted -l
. Post up output from that.– Paul Benson
2 days ago
1
Boot-Repair does not create partitions, it assumes you have correct partition for version you are using, or an ESP for UEFI or bios_grub for BIOS boot mode. And if Windows issues, you must fix those first and cannot do that from Ubuntu.
– oldfred
2 days ago