Friday, May 3, 2019

linux - How to change partition order in MBR?



I have a 16 GB USB stick, and I want to use as an Ubuntu installer, but I also want to have a data partition. For that I created have two partitions:



Model: Kingston DT Elite 3.0 (scsi)
Disk /dev/sdd: 30867456s
Sector size (logical/physical): 512B/512B
Partition Table: msdos


Number Start End Size Type File system Flags
2 2048s 26673151s 26671104s primary ntfs
1 26673152s 30867455s 4194304s primary fat32 boot


First I have first created the FAT32 partition and I used UNetbootin to make the bootable installer. (note: I have created only the first partition because UNetbootin works only if I have only one partition on the usb stick).



After that I created the second, NTFS partition, which I want to use as a data partition.



The installers works and data partition is mounted correctly in Linux.




The problem is that in Windows is mounted the Ubuntu install (FAT32) partition instead of the data partition (NTFS). It seems that the partition number 1 (the ubuntu installer) is mounted.



Is it possible to swap the partition entries (1, 2) in the Master Boot Record (MBR) to make the data (NTFS) partition the first?



Thanks!


Answer



I managed to solve the problem in the following way.





  1. Deleted the data partition

  2. Created a NTFS partition for the data.

  3. Created a new FAT32 partition with the same size as the old FAT32 one.

  4. Cloned the old FAT32 content to the new FAT32 partition. (using partclone)

  5. Deleted old FAT32 partition.



As result the first partition in the MBR is the data partition.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...