Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]Is there any way to change partition type after full
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
whjeon
n00b
n00b


Joined: 20 Nov 2017
Posts: 70
Location: Seoul,Korea(Republic of)

PostPosted: Tue Feb 18, 2020 4:05 pm    Post subject: [SOLVED]Is there any way to change partition type after full Reply with quote

Someone who I know noticed now that he's done wrong after reboot.

He booted with UEFI, but the /dev/sda was formatted with 'dos'.
I understand that could be saved, however,
/dev/sda2 was not 'ESP', but 'Linux'.
/dev/sda3 was 'Linux Swap' - OK.
/dev/sda4 'Linux' - OK.

then, he installed grub:2 as the UEFI system.

Is there any way to revive this installation? or should I suggest reinstall?


Last edited by whjeon on Sun Feb 23, 2020 10:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 45451
Location: 56N 3W

PostPosted: Tue Feb 18, 2020 4:19 pm    Post subject: Reply with quote

whjeon,

If it works, leave it. I suspect that its a non problem as UEFI system cannot read a MSDOS partition table.
The partition types are not used by Linux ... except for 0xEF, which is raid auto assemble.

Post the
Code:
fdisk -l /devsda
from this system.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
whjeon
n00b
n00b


Joined: 20 Nov 2017
Posts: 70
Location: Seoul,Korea(Republic of)

PostPosted: Tue Feb 18, 2020 4:29 pm    Post subject: Reply with quote

NeddySeagoon wrote:
whjeon,

If it works, leave it. I suspect that its a non problem as UEFI system cannot read a MSDOS partition table.
The partition types are not used by Linux ... except for 0xEF, which is raid auto assemble.

Post the
Code:
fdisk -l /devsda
from this system.


OK, so now the situation is like below.
It doesn't boot.

Label: dos
/dev/sda1 : 2M: 83(Linux)
/dev/sda2 : 128M: 83(Linux)
/dev/sda3: 512M: 82(swap)
/dev/sda4: rest: 83(Linux)

Grub:2 installed with --efi options (efi-64 / efi-directory)

Sorry for the texts, but I also am communicating via SNS with this guy.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7686
Location: Saint Amant, Acadiana

PostPosted: Tue Feb 18, 2020 5:01 pm    Post subject: Reply with quote

sda2 seems to be planned as ESP partition. It must be FAT32 (FAT16 may or may not work). I don't think sda1 is used at all for EFI boot. Converting to FAT may suffice, or may not. Your motherboard firmware may require GPT partition table. You can use gfdisk to convert.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1879

PostPosted: Tue Feb 18, 2020 8:20 pm    Post subject: Reply with quote

Open it with gdisk, it will automagically convert to GPT.
Set EFI partition type to EF02. This operation does not affect any data on said partition
Write changes to disk (even if you didn't "change" anything yourself, it will write GPT)

EFI partition should also probably be formatted as vfat. Reformatting is destructive to the data, but all that data in /boot/efi should be easily recovered by reinstalling whatever bootloader you have there.
Back to top
View user's profile Send private message
C1REX
l33t
l33t


Joined: 02 Jan 2004
Posts: 774
Location: Poland/UK

PostPosted: Sun Feb 23, 2020 10:44 pm    Post subject: Reply with quote

Windows and maybe some distros create that 2MB partition if boot option in bios is set to legacy mode.
I had the same automatically created for me like 2 days ago.
_________________
CLICK HERE to help move gentoo up on distrowatch.

If you like Gentoo you can thank devs here - https://www.gentoo.org/donate/
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 45451
Location: 56N 3W

PostPosted: Sun Feb 23, 2020 10:58 pm    Post subject: Reply with quote

C1REX,

In BIOS (legacy) mode, most boot loaders write something to the unused space before the first partition.

With BIOS (legacy) mode and a GPT filesystem, that's not possible an the first copy of a GPT partition table starts in LBA1.
The 2M partition gives boot loaders a home of their own.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
whjeon
n00b
n00b


Joined: 20 Nov 2017
Posts: 70
Location: Seoul,Korea(Republic of)

PostPosted: Sun Feb 23, 2020 10:59 pm    Post subject: Reply with quote

Thanks for all your help, but this guy decided to do it again from scratch.
Actually, when he tried to change the MBR to GPT, all partitions are crashed.

So, thanks again!

P.S. I'll change the title to [SOLVED].
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum