pfSense Gold Subscription

Author Topic: Clear eMMC on SG-2440 with SSD installed  (Read 369 times)

0 Members and 1 Guest are viewing this topic.

Offline A.Bursell

  • Jr. Member
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Clear eMMC on SG-2440 with SSD installed
« on: October 12, 2017, 01:05:03 pm »
I am acquiring a pre-owned SG-2440 to try. I want to have the device fresh, just like it came out of the factory. It has a SSD which should be easy enough to install pfSense on, and I'm aware that during installation the SSD will be cleared. So, that part is handled. However, I want to be sure that the eMMC in the device is also cleared in case anything may have been installed there at one point and I'm not sure how to do that.

Can someone walk me through the commands to erase the eMMC? I'm assuming it would be easiest to enter commands from the serial console or maybe just dropt to a command prompt from the Web GUI? Or, if this is not the best way, please make suggestions.

Thanks,
Adam

Offline NineX

  • Jr. Member
  • **
  • Posts: 38
  • Karma: +7/-0
    • View Profile
Re: Clear eMMC on SG-2440 with SSD installed
« Reply #1 on: October 13, 2017, 10:18:30 am »
if your device came with factory installed pfSense, eMMC is already clear, pfSense is installed on SSD.


Offline NineX

  • Jr. Member
  • **
  • Posts: 38
  • Karma: +7/-0
    • View Profile
Re: Clear eMMC on SG-2440 with SSD installed
« Reply #2 on: October 13, 2017, 10:23:32 am »
if your device came with factory installed pfSense, eMMC is already clear, pfSense is installed on SSD.
If you wish to clean device it's quite simle
boot pfsense installer from usb stick
and install (it will install on ssd by default)

reboot

enable ssh on new instalation
log in via ssh
shell

verify if there are partitions on eMMC:

gpart list da0

if you get an error like:

gpart: No such geom: da0.

mean you havve clean eMMC , no need any actions.

otherwise run:

gpart delete -i 3 da0
gpart delete -i 2 da0
gpart delete -i 1 da0
gpart destroy -F da0

reboot

now you have fresh install of pfsense on ssd , and totally clean emmc

Offline A.Bursell

  • Jr. Member
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: Clear eMMC on SG-2440 with SSD installed
« Reply #3 on: October 13, 2017, 10:54:19 am »
Thanks for the reply.

I'm not sure if SSD was factory or added so this is helpful.

pfSense is currently installed, though my intention is to do a fresh install. I assume I can just pick up from the ssh steps in your instructions? However, I'm not sure what you mean by "enable ssh" and "log in via ssh". I can go through the serial console or from the web GUI, can you be a little more specific please?
Thanks again,
Adam

Offline A.Bursell

  • Jr. Member
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: Clear eMMC on SG-2440 with SSD installed
« Reply #4 on: October 14, 2017, 04:39:59 pm »
if your device came with factory installed pfSense, eMMC is already clear, pfSense is installed on SSD.
If you wish to clean device it's quite simle
boot pfsense installer from usb stick
and install (it will install on ssd by default)

reboot

enable ssh on new instalation
log in via ssh
shell

verify if there are partitions on eMMC:

gpart list da0

if you get an error like:

gpart: No such geom: da0.

mean you havve clean eMMC , no need any actions.

otherwise run:

gpart delete -i 3 da0
gpart delete -i 2 da0
gpart delete -i 1 da0
gpart destroy -F da0

reboot

now you have fresh install of pfsense on ssd , and totally clean emmc

I wasn't sure about the SSH (still not), so I logged in through the web GUI and ran the commands through Diagnostics>Command Prompt in the Execute Shell Command section.

gpart list da0 = listed a bunch of disk information
gpart delete -i 3 da0 = did not find anything
gpart delete -i 2 da0 = did not find anything
gpart delete -i 1 da0 = deleted successful
gpart destroy -F da0 = destroyed successful

Then I ran gpart list da0 again and received gpart: No such geom: da0. back as a reply.

So now my question is, if running gpart list da0 and receiving gpart: No such geom: da0. as a reply is a verification that the eMMC is wiped clean?

Thanks again,

Adam

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21404
  • Karma: +1437/-26
    • View Profile
Re: Clear eMMC on SG-2440 with SSD installed
« Reply #5 on: October 14, 2017, 08:21:32 pm »
You can certainly use gpart to work with partitions but if you want to ensure a drive is completely wiped, the most certain way is with dd.

Code: [Select]
dd if=/dev/zero of=/dev/da0 bs=1m
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline A.Bursell

  • Jr. Member
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: Clear eMMC on SG-2440 with SSD installed
« Reply #6 on: October 14, 2017, 08:36:51 pm »
You can certainly use gpart to work with partitions but if you want to ensure a drive is completely wiped, the most certain way is with dd.

Code: [Select]
dd if=/dev/zero of=/dev/da0 bs=1m

Thank you!
Can I run this from the GUI command prompt execute shell?
What should I see for a response and/or how do I verify it is wiped?
Thanks again,
Adam

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21404
  • Karma: +1437/-26
    • View Profile
Re: Clear eMMC on SG-2440 with SSD installed
« Reply #7 on: October 14, 2017, 08:39:57 pm »
I wouldn't run it from the GUI, run it from a shell prompt over ssh or the console.

At the end it will output the total amount written. If it doesn't show any errors and the total is about the same size as the disk, then it worked.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline A.Bursell

  • Jr. Member
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: Clear eMMC on SG-2440 with SSD installed
« Reply #8 on: October 14, 2017, 08:45:59 pm »
Excellent- thank you!

Offline A.Bursell

  • Jr. Member
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: Clear eMMC on SG-2440 with SSD installed
« Reply #9 on: October 20, 2017, 04:06:30 pm »
Excellent- thank you!

Finally got around to trying this from console>shell

The response I received is
Quote
dd: /dev/da0: Operation not supported

I don't know anything about this command to know what might be wrong or why it might have given me this message.

Help?

Thanks!

Offline NineX

  • Jr. Member
  • **
  • Posts: 38
  • Karma: +7/-0
    • View Profile
Re: Clear eMMC on SG-2440 with SSD installed
« Reply #10 on: October 20, 2017, 07:20:07 pm »
Excellent- thank you!

Finally got around to trying this from console>shell

The response I received is
Quote
dd: /dev/da0: Operation not supported

I don't know anything about this command to know what might be wrong or why it might have given me this message.

Help?

Thanks!


did you reboot after gpart destroy?

Offline A.Bursell

  • Jr. Member
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: Clear eMMC on SG-2440 with SSD installed
« Reply #11 on: October 21, 2017, 10:54:27 am »
Excellent- thank you!

Finally got around to trying this from console>shell

The response I received is
Quote
dd: /dev/da0: Operation not supported

I don't know anything about this command to know what might be wrong or why it might have given me this message.

Help?

Thanks!


did you reboot after gpart destroy?

I'm 99.9% sure that I did but it's been several days do I really don't remember. Just for clarification the first set of commands suggested in here I followed but per Jimp's suggestion I wanted to try another and that's where I ran into potential trouble. I really don't know anything about these commands. Maybe the eMMC is already cleared and just a command to view free space would be all that I need now? I just wanted to clear it so it's just like it left the factory is all.

Offline A.Bursell

  • Jr. Member
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: Clear eMMC on SG-2440 with SSD installed
« Reply #12 on: October 22, 2017, 07:24:59 pm »
Ok, so I made a bonehead move and realized I was actually into the console on the wrong device (more than one connected to this PC so I can play with them). Anyway, I got into the correct one and re-ran the commands. Same results on the gpart commands. When using dd I was finally rewarded with:

Quote
[2.4.0-RELEASE][root@pfSense.localdomain]/root: dd if=/dev/zero of=/dev/da0 bs=1m
dd: /dev/da0: end of device
3649+0 records in
3648+0 records out
3825205248 bytes transferred in 310.579761 secs (12316338 bytes/sec)
[2.4.0-RELEASE][root@pfSense.localdomain]/root:

Total ends up pretty close to 4gb. I would say that is a success!

Thank you!

Adam