I am not a real system IT person; just a broken-down engineer. But, I have tried gparted and various terminal commands to format an sd card used previously for a phone. The sd card has a boot partition and one other partition for rest of the volume. All approaches keep saying DEVICE BUSY. E.G.,
(base) tom@mydesktop:~> sudo mkfs -t fat /dev/sde
mkfs.fat 4.1 (2017-01-24)
mkfs.fat: unable to open /dev/sde: Device or resource busy
I think that the reason is because the device is mounted. But if it is not mounted then nothing can find it. If I try to unmount it, that command also says BUSY.
I have tried gparted as user and as root. I have tried several commandline processes as root and as user. Nothing gets past the “BUSY” message.
Suggestions, please. thanks, tom kosvic
Add disk data from fdisk below:
Disk /dev/sde: 238.3 GiB, 255869321216 bytes, 499744768 sectors
Disk model: MassStorageClass
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: 82F71D98-7EAE-4012-8211-094AD5EDA528
Device Start End Sectors Size Type
/dev/sde1 62500 500000 437501 213.6M Microsoft basic data
/dev/sde2 500001 499744734 499244734 238.1G Linux filesystem
You might have a defective or slow SD card. Or maybe also fraudulent.
You can check the capacity of the SD with f3.
You can delete everything on the SD and check the capacity of it. But careful to choose the right drive. And it might take several minutes.
./f3probe --destructive --time-ops /dev/sdX
This will destroy any previously stored data on your disk!
Correcting capacity to actual size with f3fix
f3fix creates a partition that fits the actual size of the fake drive. Use f3probe’s output to determine the parameters for f3fix:
./f3fix --last-sec=16477878 /dev/sdX