Erasing Drives with the Mac Terminal - A Beginner's Guide

Поделиться
HTML-код
  • Опубликовано: 22 авг 2024

Комментарии • 94

  • @jsprojectandweb7540
    @jsprojectandweb7540 22 часа назад

    Disk Utility in the GUI was not allowing the drive to be erased, it kept returning an error - fortunately thanks to the terminal tutorial I have now erased the unreadable data and have full capacity of the drive again. :)

  • @TysDigitalVideoTreasures
    @TysDigitalVideoTreasures 4 месяца назад

    I needed to e-recycle an old NAS drive, and I couldn't secure erase in the GUI. This video helped me quickly learn how to start that process using terminal. Very thorough, logical and easy to follow instructions. Thank you very much for this video. Excellent instructions!

    • @EasyOSX
      @EasyOSX  4 месяца назад

      Happy to help!

  • @alanj.nicholas8198
    @alanj.nicholas8198 Год назад +2

    Ya baby, amazing video - I've subscribed - this was the best video on RUclips (by far) thank you so much!! Now I can finally re-use my old "HIVE" drive.

    • @EasyOSX
      @EasyOSX  Год назад

      Glad it helped you out!

  • @christyjohnson8181
    @christyjohnson8181 10 месяцев назад

    Thanks! This helped solve my problem with reformating a USB flash drive as Disk Utility wouldn't work. Quick and easy once I followed your advice.

  • @jamescarrico1233
    @jamescarrico1233 Год назад +2

    Outstanding video
    Thank you
    I am using Mac for the first time and this was a great tutorial
    Please keep ‘em coming
    Subbed

    • @EasyOSX
      @EasyOSX  Год назад

      Welcome to the Mac world! And thanks for the sub!

  • @muhammadarsalkhan4048
    @muhammadarsalkhan4048 Год назад +2

    Great sir you deserve millions likes

    • @EasyOSX
      @EasyOSX  Год назад

      Thank you for your kind words!

  • @lavinchi6709
    @lavinchi6709 17 дней назад

    Thank you so much one more time🌴

  • @cuevasread
    @cuevasread Год назад +2

    You are great, thank you so much for this tutorial!

    • @EasyOSX
      @EasyOSX  Год назад +1

      You're very welcome!

  • @Techlevel1534.
    @Techlevel1534. 11 месяцев назад

    Thanks for the video! I now have Catalina installed on my Mac and it works perfectly! Disk utility didn’t work so that’s why I used terminal

  • @Billy-hf9tz
    @Billy-hf9tz 16 дней назад

    You are the man!

  • @rofiihamdi1263
    @rofiihamdi1263 2 месяца назад

    Thankyou for this video man, finally i can erase my internal ssd before restore it from old ssd

  • @MrFaisal0860
    @MrFaisal0860 18 дней назад

    Thank you☺

  • @producertech
    @producertech Месяц назад

    THANKS!

  • @ChristianGrytten
    @ChristianGrytten 7 месяцев назад

    Thank you.

  • @nimishdahake1526
    @nimishdahake1526 10 месяцев назад

    That was a pretty good explanation, thank you!

  • @APIRATELOOKSATFORTY
    @APIRATELOOKSATFORTY 7 месяцев назад

    Thank you. Great tutorial. Very helpful!

  • @billycrowe4501
    @billycrowe4501 3 месяца назад

    Great video, so I have a 4TB ssd with say 70gb of data on it and it is reading as full. I ran disk drill on it and there’s a bunch of files as expected even after a regular disk utility format, as expected. To fix this problem I believe I need to fully wipe the bits off the drive so it will stop registering more storage used than what is actually on it. Would you recommend the secure erase with just writing 0? I was gonna use bleach bit but seems that it may have been integrated into Mac already.

    • @EasyOSX
      @EasyOSX  3 месяца назад +1

      Makes me a little worried that something’s wrong with the drive. That said a full write of 0’s would hopefully allow the drive to reconfigure its index of good and bad segments, so worth a shot I think

  • @MG-is5bg
    @MG-is5bg Год назад

    Great 👍 underrated work

  • @gregboyer3086
    @gregboyer3086 5 месяцев назад

    Solved my problem. Thank you.

  • @lavinchi6709
    @lavinchi6709 9 месяцев назад

    Thank you for very helpful info!!!

  • @MG-is5bg
    @MG-is5bg Год назад

    Thanks a lot, it works for me

  • @adiimvani2265
    @adiimvani2265 7 месяцев назад

    Hi there I’ve had an issue where my mac got stuck in a boot loop so I tried erasing my ssd in mac disk utility but it always says error and theres two volumes containing my data and the ssd and I am not sure what to do. Is there anyway I can recover the ssd or erase it.

    • @EasyOSX
      @EasyOSX  7 месяцев назад

      Depends on what error you get and the state/condition of the drive. What’s the error say?

  • @shibanaio
    @shibanaio 2 месяца назад

    I’m trying to change my disk from APFS to NTFS to use for windows however it says I can’t change it due to NTFS not being compatible with Mac. Is there any way to change the drive to NTFS even though I’m using a Mac?

    • @EasyOSX
      @EasyOSX  2 месяца назад

      So long as you're using the NTFS command it should let you erase a disk and format it as NTFS. I presume this is an external disk?

  • @y5rdg
    @y5rdg 8 месяцев назад

    Thank you!

  • @RadhikaSharma-oi4ne
    @RadhikaSharma-oi4ne Год назад

    Thank you for the tutorial. I tried everything (unmounting), and then erasing. However it shows an error in the end "Unable to begin erase operation: A writable disk is required (-69772)". Infact, my Mac hasn't been able to read the pendrive (says "The disk you attached was not readable by this computer." and in Windows, it shows write-protected). What to do? Help!

    • @EasyOSX
      @EasyOSX  Год назад

      That sounds like the solid state drive has hit its limit. Flash drives and SSD’s only have some many times they can be written to before the components can’t hold a charge anymore. It’s an unfortunate downside to solid state storage. It can be caused by drives not being used in a long time, they get used so much and wear out, and of course damaged or bad components.
      That drive sounds like it might have gone belly up. At best you might be able to use some more powerful apps like SpinRite to get it back up, but if the components are too worn then the drive may be dead. I’m sorry

  • @TheRon0mac
    @TheRon0mac 5 месяцев назад

    Hi EasyOSX, I am wanting to save Mac OSX High Sierra to my thumb drive to install the OS on other Macs and virtual Macs.
    I tried erasing my 128 GB thumb drive, disk util erases it. Mac OS Journaled. I was prompted that it erased it.
    I am unable to save the install media, to the drive. It fails erasing via the terminal.
    I have tried with another Thumb Drive, a 32 GB SanDisk - it erases in disk util, but not via Terminal.
    I have the installer downloaded and verified its contents - the createinstallmedia is there.
    Any suggestions would be appreciated.

    • @EasyOSX
      @EasyOSX  5 месяцев назад

      Presume you mean "Mac OS Extended Journaled" as that is an important distinction. What is the error it gives you when it fails in the Terminal? Also, it sounds like you're making a recovery drive, so is it failing with the same error when it's running the createinstallmedia command?

    • @TheRon0mac
      @TheRon0mac 5 месяцев назад

      @@EasyOSX Thank you for the reply!!
      I was not intending to create a recovery drive, but was trying to create an install USB drive - perhaps that's what you meant.
      I should have taken better notes - I believe the command below is what finally created the file.
      sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume
      I believe I changed "MyVolume" to something else, I do not recall.
      That, or something worked.
      I then converted the "cdr" file to an "ISO" image file with the command below.
      hdiutil makehybrid -iso -joliet -o Install\ Mac\ OS\ High\ Sierra.iso MacHS-install.cdr
      What I was hoping for an end result:
      I was hoping to run Mac OS High Sierra
      (that I downloaded using my mid 2011 iMac),
      on my 2017 iMac which has 13.6.5 Ventura installed - within "VirtualBox".
      I was able to create the ISO finally.
      It comes up to a black screen in VirtualBox.
      I do not know if it is a compatibility issue, or if I did something wrong. I am thinking compatibility, but am not sure.
      I did choose to use 2 CPU's, and 128 MB video, I also created an 80 GB virtual drive, and chose the High Sierra install ISO file in the virtual DVD/CD combo drive. I de-selected floppy.
      I can live without it - it was an exercise for me to try.

    • @EasyOSX
      @EasyOSX  5 месяцев назад

      So the MyVolume was intended to be filler for the name of your drive, sorry if that wasn't clear. But you would replace "MyVolume" with the name of your drive as it appeared on the OS. That's how it points to the correct USB.
      Admittedly I've not tried MacOS in VirtualBox, though I know it's possible. I do use another virtual machine app called UTM that does the job for me very well. I've not tried 10.12 in it, but I know it should be compatible.
      If you don't mind me asking, I'm curious as to what you want to run 10.12 in a VM for?

    • @TheRon0mac
      @TheRon0mac 5 месяцев назад

      @@EasyOSX Thanks very much for the reply. One reason I want to have older is for the fun of it. Second, I have a couple of apps that are not compatible with Ventura.
      I understood about the volume name.
      I am not sure what went wrong.
      I may check out the UTM. Thanks for that and all the information.
      I have used VIrtualBox for Linux, and Windows on Windows - to explore installing apps on windows and not wanting to hose the registry. :)

  • @smallsara2735
    @smallsara2735 Год назад

    Thank you for the video! Unfortunately after following all the steps, at the end it said that it was not possible to erase. Do you know if there is another solution or I should give up?
    I know that probably my SD card it's damaged because it's really old but I would like to recover some pictures from it. Thank you very much for all your help!

    • @EasyOSX
      @EasyOSX  Год назад

      Hi Sara. Just to clarify are you wanting to erase the SD card or erase it? Or are these 2 separate things? Just want to make sure I understand properly before making any suggestions.

    • @smallsara2735
      @smallsara2735 Год назад

      @@EasyOSX Hello, thank you for replying! I'm sorry, maybe I didn't explain myself well. The case is that I have a very old Memory Stick with photos and since 2 years ago my computer does not detect it anymore. What I wanted to do is that I could be able to unmount the disk and afterwards use a data recovery program to be able to recover the photos. I have tried the two methods that you have used in the video, but at the end after trying to unmount or to erase the disk, it says to me "error". So I wanted to ask you what should I do in this case, if there is any other solution> Thank you very much for your help

    • @EasyOSX
      @EasyOSX  Год назад

      Ah I think I follow now. That’s unfortunate. If it’s been bad for 2 years, that’s not a great sign as far as getting the data back. A recovery program like Disk Warrior may be able to help, but there’s not a guarantee. If it was formatted in a way that it would work on non-Mac platforms then you may be able to plug it into a Windows or Linux system and see if it can repair it, but that may not let you recover the data.
      What happens if you run First Aid from Disk Utility on your Mac?

    • @smallsara2735
      @smallsara2735 Год назад

      @@EasyOSX thank you for your answer again. If I try to run the First Aid option it says "Operation failed", so I cant really do it. I guess that doesnt have a solution. Thank you for your help nevertheless :)

    • @EasyOSX
      @EasyOSX  Год назад +1

      I'm sorry Sara. Perhaps a more powerful tool like DiskWarrior could help, but the drive just might be dead.

  • @Plastik13
    @Plastik13 2 года назад

    Hi, I had securely erased a movie (by writing 0 and 1 over the file). When I used a data recovery tool, the software found the title of the video (Titanic.avi) and the size of the video (750 Mo), but was unable to read the video saying that it was corrupted. It makes sense that the file was corrupted since the core of the file was overwritten. My question is : how come the file of the video was deleted by the secure erasing (wiping) but not the name and the size of the video ?

    • @EasyOSX
      @EasyOSX  2 года назад +1

      An excellent question. One that is partially dependent on the file system that was used, but also if you erased just the file or the entire drive. The FAT systems (ExFAT, FAT32, FAT16, etc.) have what’s called a File Allocation Table (hence the name) that maintains things like the name, size, location, etc. of the files while the system is in use. A secure erase tool, per the FAT standards, erases over the actual files themselves, but the table may maintain the record. In that case you could see a record of the file and its attributes but not the file itself.
      If the drive was previously another format such as HFS+ or NTFS, they typically have a log that they record all the actions of a drive or a particular file. In those cases the attributes are stored with the file and thus can be deleted along with the file. However the log or journaling of the file may still exist and some of those attributes stored in that log would be with it.
      So, there are 4 likely scenarios:
      1: If you only erased the file with a secure command but not the entire drive, then the drive’s FAT or Log (depending on the format) would maintain that history of the file and its attributes.
      2: If you erased the drive the drive may have saved some trouble and instead kept some of the prior records (especially if you erased it to the same format). Part of this is because drives try to be “smart” about where they move data around so as to ensure they wear out evenly or to avoid damaged sectors.
      3: Regardless of your method, it’s possible that there wasn’t a whole lot of other data in that sector of the drive so it was easier to recover that data even if the file itself was lost.
      4: The sector where the file attribute or file itself was perhaps not functioning correctly and couldn’t be fully erased.
      Going back to possibility #2 for a moment. One of things Apple (and other manufacturers) note with modern drives is that regardless of the method of secure erase you use, it’s best practice to encrypt the hard drive at rest (using something like FileVault on Mac, Bitlocker on Windows, etc.) to ensure it already looks garbled to anyone trying to access it illicitly before you intentionally try to garble the data. Something like that can help prevent something like this. Hope this helps

    • @Plastik13
      @Plastik13 2 года назад

      @@EasyOSX Thanks. I have a HFS+ format. Do you know where the logs (that record the actions of the drive and files) are located, in order the secure delete those log files ?

    • @EasyOSX
      @EasyOSX  2 года назад

      The drive controls that, so I don't know where they would be on the drive. If you're intending to still use the drive, then eventually it'll get taken out of the HFS' Journal. If you're planning to get rid of the drive, then the best thing would be to encrypt the external drive and then do another secure erase on it, preferably something with multiple passes.

  • @777fi777
    @777fi777 Год назад

    Great video!
    I tried all steps though and when I tried to erase the disk, I'm getting an error: -69877: Couldn't open device
    Looks like it's unable to create the partition map because of this error. Any tips for this??

    • @EasyOSX
      @EasyOSX  Год назад

      You might try is running the unmount command. Replace X in the command below with the number of your disk that is giving you that error
      diskutil unmountDisk /dev/diskX

  • @suzieq8379
    @suzieq8379 3 месяца назад

    what if my disk isn't showing up in diskutil? I have an ssd I can't eject and its taken over my pc using windows I don't want to use boot camp to install then delete I want windows gone, it only shows up in the system information?? can you help me?

    • @EasyOSX
      @EasyOSX  3 месяца назад

      Just so I’m on the same page, is this the internal SSD in the Mac or an SSD from another PC

    • @suzieq8379
      @suzieq8379 3 месяца назад

      @@EasyOSX I think it is the ssd from windows , windows is showing up in bootcamp but I don't what to install it on my windows the guy that worked on my Toshiba has remote access and admin over me, I got this Mac thinking he would be gone but he I connected thru my local lan ip he is 1/2 ing it subnet its so disgusting , it show up in my hardware as ms fat 32 or something like that it is not mounted that is greyed out and not sure that he hasn't taken over my Mac phone iPad, can you help me, disk utility has it as internal , says . APPLE SSD SM0128G pic internal physical disk the hardware says 121.33 GB (121,332,826,112 bytes)
      Model: APPLE SSD SM0128G
      Revision: BXZ13A0Q
      Serial Number:
      Native Command Queuing: Yes
      Queue Depth: 32
      Removable Media: No
      Detachable Drive: No
      BSD Name: disk0
      Medium Type: Solid State
      TRIM Support: Yes
      Partition Map Type: GPT (GUID Partition Table)
      S.M.A.R.T. status: Verified
      Volumes:
      EFI:
      Capacity: 209.7 MB (209,715,200 bytes)
      File System: MS-DOS FAT32
      BSD Name: disk0s1
      Content: EFI
      Volume UUID:
      disk0s2:
      Capacity: 120.99 GB (120,988,852,224 bytes)
      BSD Name: disk0s2
      Content: Apple_APFS bootcamp. say macOS 84gb and windows 37 gb I just don't want to install that I don't have room its taking all my space oh also pci connection I think he installed a card internally on Toshiba to connect to my wifi I have it took apart now the toshiba

    • @suzieq8379
      @suzieq8379 2 месяца назад

      @@EasyOSX Capacity: 121.33 GB (121,332,826,112 bytes)
      Model: APPLE SSD SM0128G
      Revision: BXZ13A0Q
      Serial Number:
      Native Command Queuing: Yes
      Queue Depth: 32
      Removable Media: No
      Detachable Drive: No
      BSD Name: disk0
      Medium Type: Solid State
      TRIM Support: Yes
      Partition Map Type: GPT (GUID Partition Table)
      S.M.A.R.T. status: Verified
      Volumes:
      EFI:
      Capacity: 209.7 MB (209,715,200 bytes)
      File System: MS-DOS FAT32
      BSD Name: disk0s1
      Content: EFI
      Volume UUID:
      disk0s2:
      Capacity: 120.99 GB (120,988,852,224 bytes)
      BSD Name: disk0s2
      Content: Apple_APFS
      this is not in disk utility

    • @suzieq8379
      @suzieq8379 2 месяца назад

      @@EasyOSX I don't know where my comments are going?

    • @EasyOSX
      @EasyOSX  2 месяца назад

      So wait it sounds like this is a drive from a Toshiba but the info reads as if it's a boot camp partition on your MacBook? As far as the guy who has access to your network/Toshiba, I think you need to speak to someone local about that sort of hacking, be it your ISP or a local tech person you trust/have a contract with. I think they'd be better able to help you with that part then I can over the web.

  • @DRETHEGREATS
    @DRETHEGREATS Год назад

    im trying to get rid of a virus on my external ssd what's the best option

    • @EasyOSX
      @EasyOSX  Год назад

      Guess it depends on the virus. Most can be knocked out with a good secure erase provided its not in the firmware. Also making sure it's not a virus that's compatible with the Mac or whatever OS you're connecting the drive to is important (especially with ransomware). Honestly the safest thing would be just to destroy it but that's not always a real solution.

    • @delta808z8
      @delta808z8 Год назад

      @@EasyOSX so basically after formatting several times my files will start disappearing and reappearing out of no where and it’s a brand new drive but I guess my first transfer of files to this new drive came from a drive with a Trojan on it and formatting doesn’t seem to solve the problems I’m tryna delete everything completely and start over as if I got the drive out the box

    • @EasyOSX
      @EasyOSX  Год назад

      Hey Delta, I apologize your comment got flagged as spam for some reason so I'm only just now seeing it. If it is a virus, it's possible it's in the drive's firmware and not on the disk. A secure erase might help if it's on the disk, but if it's in the firmware then a secure erase won't change that. It could also be the drive is faulty and keeps have to move your data to new sectors.

  • @madarab6874
    @madarab6874 2 года назад

    Unable to begin erase operation: This operation is restricted by Sandbox; check your settings in System Preferences > Security & Privacy > Privacy > Files and Folders (-69464)

    • @madarab6874
      @madarab6874 2 года назад

      i got this message ?

    • @EasyOSX
      @EasyOSX  2 года назад

      You might not have given your Terminal app permission to access removable drives. Open up System Preferences and go to the path like the error message says. See if you the box labeled "Removable Drives" is checked under Terminal. If it isn't, check that box, then restart the Terminal app (or your whole machine) and try the erase command again.

    • @madarab6874
      @madarab6874 2 года назад

      @@EasyOSX Formatting disk2s2 as Mac OS Extended with name Sucsess
      newfs_hfs: WriteBuffer: pwrite(3, 0x7fc561221000, 1048576, 272633856): Input/output error
      newfs_hfs: write (sector 532488): Input/output error
      Mounting disk
      Could not mount disk2s2 after erase
      Error: -69832: File system formatter failed

    • @madarab6874
      @madarab6874 2 года назад

      any help

    • @EasyOSX
      @EasyOSX  2 года назад

      That sounds like the hard drive might be in pretty bad shape. You can try formatting it with the Mac OS Extended (Journaled) instead and see if that helps, but typically I see those errors when the drive has some bad blocks.
      You could also try formatting it as a different type like ExFAT to see if it gives you the same results

  • @ascomputerspro
    @ascomputerspro Год назад

    Error: -69825: Wiping volume data to prevent future accidental probing failed.

    • @EasyOSX
      @EasyOSX  Год назад

      Usually when this problem comes up it's something to do with the SATA cable connecting the drive to the machine. Either the cable is defective, damaged, or incompatible. By incompatible I mean the drive or machine will only accept a certain SATA generation and not anything newer, for example if the drive is SATA II but the cable is SATA III. How are you connecting the drive to the Mac?

    • @ascomputerspro
      @ascomputerspro Год назад

      @@EasyOSX I have tested with both internal SATA III SSD Drive and USB Flash drive. same problem. Error: 69760: Unable to write to the last block of the device. (MacBookPro8,3 Late 2011)

    • @EasyOSX
      @EasyOSX  Год назад

      That’s an older Mac, but it should be SATA III compatible. You might try running Disk Utility’s First Aid command on it or use the fsck -fy command on it if you’re more Terminal oriented

  • @timmal
    @timmal Год назад

    Error: -69879: Couldn't open disk :(

    • @EasyOSX
      @EasyOSX  Год назад

      Hey Timmal. Do you know if any part of that drive you’re trying to erase is currently encrypted?

    • @timmal
      @timmal Год назад

      @@EasyOSX it was used for TimeMachine but I ejected it by mistake during backup. Now it connects unmounted by default and any attempt to mount it was failed

    • @EasyOSX
      @EasyOSX  Год назад

      Just to be clear, you're wanting to erase the drive or just mount it and try to recover it?

    • @timmal
      @timmal Год назад

      @@EasyOSX just want to erase

    • @timmal
      @timmal Год назад

      @@EasyOSX just used Disk Drill to fix mount issue

  • @Schrodinger-xd4pv
    @Schrodinger-xd4pv 2 месяца назад

    it got struck in 50%

    • @EasyOSX
      @EasyOSX  2 месяца назад

      At what stage? What kind of erase?

  • @adamjg4
    @adamjg4 2 месяца назад

    160 for u

    • @EasyOSX
      @EasyOSX  2 месяца назад

      I’m sorry, not sure I understand

  • @billgates3699
    @billgates3699 4 месяца назад

    ‼️Teaching people while not even able to pronounce “OS X” 😂

    • @EasyOSX
      @EasyOSX  4 месяца назад +2

      The reason I do that is because people misspelled the channel & site name, so I had to say it that way for traffic and search engine optimization reasons. Now it doesn’t matter as much since we moved past version 10 a long time ago, but the name still sticks.

    • @usgalsen
      @usgalsen 3 месяца назад

      You're the devil that never knows "thank you" & who sees evil everywhere🗑🐍