Deleting hard disk entirely, from Unix

Discussion in 'macOS' started by cool11, Mar 18, 2014.

  1. cool11 macrumors 65816

    cool11

    Joined:
    Sep 3, 2006
    #1
    My mbp has a serious problem and cannot boot or proceed to a normal osx startup.
    I can only get into unix, pressing command-s during startup.
    From this unfriendly(for me) environment, I want to find a way to completely delete the hard disk, before I sell my mbp for spare parts.
    I don't want to give the ssd with my personal information inside it, at least I want to trash everything and disappear anything from my data.

    Last time I tried to type some commands, I remember having several 'denies' from system, due to permissions matters, as I just got into unix, I am not administrator or anything like that.
    But, I think I should have a way to delete my files.

    So please give me all the alternative ways, commands, pathways, to be able, in any case, to proceed to extermination of my files inside the internal mbp disk. I 'll write them down, and I will try them all.
    I hope that some of these commands could do the job.
     
  2. Fishrrman macrumors G3

    Joined:
    Feb 20, 2009
    #2
    How old is the MBPro?

    Have you thought about replacing the internal hard drive?

    It may have years of life left...
     
  3. cool11 thread starter macrumors 65816

    cool11

    Joined:
    Sep 3, 2006
    #3
    There is a logic board failure. MBP 15' early 2011...
    I can't repair it, it costs too much, it doesn't reserve it.
    I am thinking of selling it 'as is'.
    But I want to delete my files from hard disk.
     
  4. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #4
    You should be able to use Internet recovery with that machine. Just hold command-option-r (all three keys at once) when you boot to get to the recovery screen. From there just use Disk Util to erase the drive.
     
  5. smithrh macrumors 68020

    smithrh

    Joined:
    Feb 28, 2009
    #5
    Or, you could just physically remove the drive entirely if you can't boot far enough to follow Weasleboy's suggestion.

    You could just keep the drive, or smash it, or hook it up to an enclosure to re-use it...
     
  6. cool11 thread starter macrumors 65816

    cool11

    Joined:
    Sep 3, 2006
    #6
    Even internet recovery failed.

    ----------

    I don't have an ssd enclosure, I am not going to buy one for this task.
     
  7. Fishrrman macrumors G3

    Joined:
    Feb 20, 2009
    #7
    [[ I don't have an ssd enclosure, I am not going to buy one for this task. ]]

    Wasting what is probably a perfectly good computer because you don't want to change out the drive.

    It's your money, do what you want...
     
  8. cool11 thread starter macrumors 65816

    cool11

    Joined:
    Sep 3, 2006
    #8
    I gave my mbp to an authorized apple service.
    They told me it is a logic board problem.
    It is not about change out drive.
     
  9. boast macrumors 65816

    boast

    Joined:
    Nov 12, 2007
    Location:
    Phoenix
  10. smithrh macrumors 68020

    smithrh

    Joined:
    Feb 28, 2009
    #10
    Using that method will possibly result in recoverable files. I haven't tried anything like DiskWarrior on an SSD, but all 'rm' will do is remove the pointer to the data.

    If it were me, I'd take the drive out and then sell whatever is left. I am assuming the OP is looking for info security.
     
  11. boast macrumors 65816

    boast

    Joined:
    Nov 12, 2007
    Location:
    Phoenix
    #11
    Ah, right. Should be srm instead of rm
     
  12. cool11 thread starter macrumors 65816

    cool11

    Joined:
    Sep 3, 2006
    #12
    sudo srm -rf /*

    As I said I just get into unix, I have not found any way to gain administrator privileges.
    So, will this command work, or I will see 'denied' by system?
     
  13. bradl macrumors 68040

    bradl

    Joined:
    Jun 16, 2008
    #13
    Better than that. Do a 'df' to see what filesystems you have mounted.

    From that, do a 'sudo cat /dev/zero > /dev/disk0' where "/dev/disk0 is your first disk holding your / partition.

    Or, you could do a "sudo dd bs=8192 if=/dev/zero of=/dev/disk0 count=1" (again, where /dev/disk0 is your first disk). Both will zero out your disk, whereas dd could also get your boot sector.

    Ultimately, if it works for OS X (not sure why it wouldn't since it is x86 based), you could go grab DBAN (Dave's Boot And Nuke) and completely wipe your drive, from a simple basic reformat, to multiple runs across your disk, to DoD standard wiping.

    BL.
     
  14. smithrh macrumors 68020

    smithrh

    Joined:
    Feb 28, 2009
    #14
    You can simply try it.

    If it asks you for a password, supply the password for the machine.

    Perhaps I should ask another question:

    What are you trying to do? Protect your personal information, or something else?
     
  15. cool11 thread starter macrumors 65816

    cool11

    Joined:
    Sep 3, 2006
    #15
    Ι want to empty the disk, before I sell the machine.
    But as I said it does not boot to osx (due to logic board failure), so I have to do it from unix.
     
  16. smithrh macrumors 68020

    smithrh

    Joined:
    Feb 28, 2009
    #16
    I know that - but why?

    Personal information?

    There are things you can do without sudo, such as removing all of the content in your home directory - actually, all user directories.
     
  17. bradl macrumors 68040

    bradl

    Joined:
    Jun 16, 2008
    #17
    If you seriously want to sell it without any way of recovering any other data, I would definitely suggest DBAN. at least a 2 or 3 pass wipe of your drive with something more than just the simple format algorithm, and you should be good to go.

    BL.
     
  18. cool11 thread starter macrumors 65816

    cool11

    Joined:
    Sep 3, 2006
    #18
    There are personal files inside disk. Not crucial ones, but even my family's photos, I don't want to be in everyone's hands.

    I do not know about all these in unix environment, so it would be helpful if you could give me 'plain lines' with the right commands, just to type in.

    At this moment, I am waiting to get back my mac from service, but I want to be able to make the deletion immediately after I get it back.
    I made some tries before giving it to service, with some commands I found on internet, but with no luck.
    I remember, the system did not allow me to delete files.
    So, I gave it to them, as is.
    But now I 'm gonna sell it.

    So, I want to write all the commands you tell me, to be ready to apply them.

    As I said, I am locked out my system, and I can't imagine that I have no choice to complete my erasing tasks using the only option left, unix.

    Please help me to write down all the alternative commands, bypassing permissions problems, in order to make the deletion with some way.
     
  19. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #19
    You will not be able to erase the entire disk because you are booted to that very disk in single user mode. You should be able to delete specific folders though.

    First run this command to mount the disk.

    Code:
    mount -uw /
    How many user accounts are there? Try this to delete the entire user account substituting the real account name for "accountname".

    Code:
    sudo rm -rf /Users/accountname/*
    I'm not sure if it will let you kill the entire account this way.

    If it won't, drill down and delete the specific folders you know hold the data. Do the same for Music, Photos, Movies folders etc.

    Code:
    sudo rm -rf /Users/accountname/Documents/*
    Do you have access to another Mac temporarily? You could use this tool from Apple with a 1GB or larger USB key to make a recovery key, then option key boot your Mac to that key and use Disk Util to erase.
     
  20. cool11 thread starter macrumors 65816

    cool11

    Joined:
    Sep 3, 2006
    #20
    I discussed these matters with a friend, and he told me that I should try write:
    su
    to be able to manage everything as 'root'.
    I never dealt with such thing while in osx.
    Which is supposed to be the root password?
    Can I guess there is a default one?
     
  21. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #21
    su is the same as the sudo command I gave you. By default your own admin account password is added to the root level password list.

    So entering "sudo whatever_command" then return will prompt for your admin password then execute that command as root.
     
  22. Fishrrman macrumors G3

    Joined:
    Feb 20, 2009
    #22
    Why not just take the existing hard drive OUT of the Macbook, and replace it with another, even an empty one?
     
  23. cool11 thread starter macrumors 65816

    cool11

    Joined:
    Sep 3, 2006
    #23
    Because I do not have a spare ssd to do it.

    ----------


    I just had a default 'macuser' account, and a password for this account.
    That's all.

    What is the 'root'/admin password in my mac? That I don't even know it?
     
  24. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #24
    It is whatever password you normally use to login to your user account.
     
  25. cool11 thread starter macrumors 65816

    cool11

    Joined:
    Sep 3, 2006
    #25
    I tried most of the things you told above.
    And other ones I found on internet.
    Nothing worked.
    It does not ask me for password in any case.
    'Deny' or 'read-only' in most cases.
    My last chances is to be able to boot from live cd/usb with linux, so that I could have control to delete anything I want.
    Trying it inside mac's unix seems useless.
    The only constraint is that it should be text-based, with no graphics at all, since the problem of my mac does not allow any graphics.
    Just in case you have some idea about it, here is the other topic
    http://forums.macrumors.com/showthread.php?t=1723293
    I need a way to achieve it.
     

Share This Page