Article 59XCW SD card keeps restoring partitions

SD card keeps restoring partitions

by
marianaf
from LinuxQuestions.org on (#59XCW)
Hello,

My SD card refuses to update the changes I 'write' with fdisk or gdisk. After making modifications (such as deleting or creating partitions) & rebooting or calling 'partprobe', the SD card old contents are back.
Anyone has an idea how to wipe everything out so to use it again? Thanks.

Code:sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.5

Partition table scan:
MBR: hybrid
BSD: not present
APM: not present
GPT: present

Found valid GPT with hybrid MBR; using GPT.

Command (? for help): p
Disk /dev/sdb: 31422464 sectors, 15.0 GiB
Model: Storage Device
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): BF40D979-29F5-429B-B57F-29690F8CB39A
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 31422430
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number Start (sector) End (sector) Size Code Name
1 2048 67583 32.0 MiB 0C01 hassos-boot
2 67584 116735 24.0 MiB 8300 hassos-kernel0
3 116736 641023 256.0 MiB 8300 hassos-system0
4 641024 690175 24.0 MiB 8300 hassos-kernel1
5 690176 1214463 256.0 MiB 8300 hassos-system1
6 1214464 1230847 8.0 MiB 8300 hassos-bootstate
7 1230848 1427455 96.0 MiB 8300 hassos-overlay
8 1427456 31422430 14.3 GiB 8300 hassos-dataCode:sudo fdisk /dev/sdb

Welcome to fdisk (util-linux 2.35.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

A hybrid GPT was detected. You have to sync the hybrid MBR manually (expert command 'M').(to remove the 'A hybrid GPT was detected. You have to ...' message on gdisk I do:

Code:Command (? for help): x

Expert command (? for help): n

Expert command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sdb.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.which seems to work, but then when attempting to delete the partitions with fdisk I get the error message:

Code:sudo fdisk /dev/sdb

Welcome to fdisk (util-linux 2.35.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): p
Disk /dev/sdb: 14.101 GiB, 16088301568 bytes, 31422464 sectors
Disk model: Storage Device
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: BF40D979-29F5-429B-B57F-29690F8CB39A

Device Start End Sectors Size Type
/dev/sdb1 2048 67583 65536 32M Microsoft reserved
/dev/sdb2 67584 116735 49152 24M Linux filesystem
/dev/sdb3 116736 641023 524288 256M Linux filesystem
/dev/sdb4 641024 690175 49152 24M Linux filesystem
/dev/sdb5 690176 1214463 524288 256M Linux filesystem
/dev/sdb6 1214464 1230847 16384 8M Linux filesystem
/dev/sdb7 1230848 1427455 196608 96M Linux filesystem
/dev/sdb8 1427456 31422430 29994975 14.3G Linux filesystem

Command (m for help): d
Partition number (1-8, default 8):

Partition 8 has been deleted.

Command (m for help): d
Partition number (1-7, default 7):

Partition 7 has been deleted.

Command (m for help): d
Partition number (1-6, default 6):

Partition 6 has been deleted.

Command (m for help): d
Partition number (1-5, default 5):

Partition 5 has been deleted.

Command (m for help): d
Partition number (1-4, default 4):

Partition 4 has been deleted.

Command (m for help): d
Partition number (1-3, default 3):

Partition 3 has been deleted.

Command (m for help): d
Partition number (1,2, default 2):

Partition 2 has been deleted.

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): p
Disk /dev/sdb: 14.101 GiB, 16088301568 bytes, 31422464 sectors
Disk model: Storage Device
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: BF40D979-29F5-429B-B57F-29690F8CB39A

Command (m for help): w
The partition table has been altered.
Failed to remove partition 2 from system: Device or resource busy
Failed to remove partition 3 from system: Device or resource busy
Failed to remove partition 7 from system: Device or resource busy
Failed to remove partition 8 from system: Device or resource busy

The kernel still uses the old partitions. The new table will be used at the next reboot.
Syncing disks.and, after calling 'partprobe', I'm back with having 8 partitions & MBR:hybrid in gdisk)

Any hint would be highly appreciated.latest?d=yIl2AUoC8zA latest?i=-idSFacEFq8:A-X5FuuLgak:F7zBnMy latest?i=-idSFacEFq8:A-X5FuuLgak:V_sGLiP latest?d=qj6IDK7rITs latest?i=-idSFacEFq8:A-X5FuuLgak:gIN9vFw-idSFacEFq8
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments