Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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-data
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.
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.
Last edited by marianaf; 11-03-2020 at 02:04 PM.
Reason: added full code on command
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.
This might be a clue!
Was anything on the device mounted or in use when you ran gdisk? It says 4 partitions were busy.
Did you delete all the partitions or just modify something. I am not thoroughly familiar with the expert mode so your shorthand commands are greek to me. Looking at the commands for expert mode it seems you wrote a new protective mbr, but did not change any partitions. If you wanted a new partition table then an "o" from the standard menu gives that.
Did you reboot as suggested?
Last edited by computersavvy; 11-03-2020 at 01:03 PM.
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,510
Rep:
Remove & re insert the card, the changes should then show - otherwise use dd to clear the first 4MB or so of the card, & then create a new partition table.
Today I just learned that when SD cards get corrupted or damaged, they can go into some kind of read-only mode. If a SD card is giving you problems, please discard it and get a new one.
Today I just learned that when SD cards get corrupted or damaged, they can go into some kind of read-only mode. If a SD card is giving you problems, please discard it and get a new one.
Yes, in that respect SD cards are similar to flash drives. When they get old and begin to reach EOL they go to read only (apparently to protect your remaining data)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.