SG-5100: Completely wipe eMMC after M.2 installation
-
Hi,
I have installed an M.2 drive and reinstalled the Netgate pfSense factory image which worked great, everything is up and running fine.
During the installation I also deleted mmcsd0 and after the installation I also did a "dd if=/dev/zero of=/dev/mmcsd0 bs=1M" which also succeeded (said it had written about 8GB) and rebooted. However dmesg still shows the partitions:
mmcsd0: 8GB <MMCHC M32508 5.2 SN xxxxxxxx MFG 08/2018 by 112 0x0000> at mmc0 50.0MHz/8bit/65535-block mmcsd0boot0: 4MB partion 1 at mmcsd0 mmcsd0boot1: 4MB partion 2 at mmcsd0 mmcsd0rpmb: 4MB partion 3 at mmcsd0
And I also see them at /dev/.
What else do I have to do to remove them? gpart doesn't see them, but I must admit that I'm not exactly an expert with gpart on FreeBSD. As the kernel still sees these partitions, I'm also not sure if my dd was successful? I would have expected that it wiped everything including partition table etc.
I already read https://forum.netgate.com/topic/121270/clear-emmc-on-sg-2440-with-ssd-installed but this didn't really help me except for confirming that what I did wasn't so wrong.
-
Hmm, curious. What does
geom label status
show? -
It shows:
Name Status Components diskid/DISK-xxxxxxxx N/A mmcsd0 ufsid/xxxxxxxxxxxxxxxx N/A ada0s1a label/swap0 N/A ada0s1b
-
Sorry for bringing this up again... Any idea anyone?
I also did a hexdump -n 104857600 /dev/mmcsd0 and it shows that at least the first 100 MB are all zero:
0000000 0000 0000 0000 0000 0000 0000 0000 0000 * 6400000
So no partition table or something... Is there something special about these eMMCs that they always report these partitions to the kernel somehow?
-
You sometimes see a backup partition table at a later point in the drive that is not removed by erasing the primary table. Sometimes that is detected and read.
Is this actually causing a problem for you though?Steve
-
Thanks Steve.
@stephenw10 said in SG-5100: Completely wipe eMMC after M.2 installation:
You sometimes see a backup partition table at a later point in the drive that is not removed by erasing the primary table. Sometimes that is detected and read.
I should then find this when I do a full hexdump of /dev/mmcsd0, right? If it's still somewhere there, that then probably also means that I did something wrong with my dd...
@stephenw10 said in SG-5100: Completely wipe eMMC after M.2 installation:
Is this actually causing a problem for you though?
No, no actual problem in terms of misbehavior. Just want to make sure that I have wiped everything correctly and also want to understand the state I currently have which feels a bit "unclean".
-
Just did a full hexdump:
[2.4.5-RELEASE][admin@...]/root: hexdump /dev/mmcsd0 0000000 0000 0000 0000 0000 0000 0000 0000 0000 * 1d2000000
The strange thing is that it returned exactly 7GB instead of 8GB.
-
Ok, try
gpart list
I think that will show the three partitions on there.You should be able to remove them by index number using
gpart delete -i 1 diskid/DISK-xxxxxxxx
.You don't need to though. And you'd better be sure you are removing the right thing.
Steve
-
Already tried that as well, also when i do
gpart list -a
. It only shows my ada0 stuff from the SSD, but no trace of mmcsd0. Same forgpart status
orgpart status -a
. Really don't understand where the kernel gets this from.gpart delete -i 1 diskid/DISK-xxxxxxxx
(with my ID fromgeom label status
of course) returnsgpart: arg0 'diskid/DISK-xxxxxxxx': Invalid argument
. -
Hmm, well you might try creating a partition with gpart. I would think that will create a new table if it cannot read one.
You could then just leave that or try removing it.Steve