Jump to content

How to Safely Format a Hard Drive using Linux utils?


jeh-vin

Recommended Posts

I messed up my main system real bad a week ago (specifications attached to my profile). I installed and used the wipe command preceded by shred -v /dev/sda . I read many blog posts about these commands to make sure they dont make my laptop unusable. Unfortunately, these two commands also removed ath10k AMD GPU Firmware from my system and now I am figuring out a way to burn the firware into the system and reinstall Arch Linux.
My question(s):
1. Apart from these two commands, do any of you Linux nerds know how to wipe a disk without having drastic repurcussions afterwards?
2. How do I get back my missing AMD GPU Firware onto the system?

Link to comment
Share on other sites

securitybreach

Well it depends on how you want to go about it. You can simply use gparted to format the drive and create partitions or you can use dd to erase a drive completely. Now you will need to create the partition table and such afterwards as dd does a low level format.

 

dd if=/dev/zero of=/dev/sdX bs=1M

 

Replace X with drive letter.

 

If you go the dd route, be EXTREMELY CAREFUL to choose the correct drive and look at the command closely before executing as there is no turning back once its started.

 

Gparted would be the safest route.

  • Like 1
  • Agree 1
  • +1 1
Link to comment
Share on other sites

If you reinstall Arch, a simple format would suffice to overwrite whatever is on the partition, no need for wipe or anything. I'm not familiar with Arch install routine being a Debian user, but most distros will format the partition as part of the installation process. @securitybreachknows all about Arch. 😉🤓

Firmware is included in the operating system, so you will have to add that during or after installation.

 

As mentioned already, Gparted is great for managing, creating, deleting disks and partitions. Easy to use from a live USB or CD such as SystemRescue, Gparted Live, or PartedMagic. First 2 are free, last one is a few bucks.

  • Like 2
  • +1 1
Link to comment
Share on other sites

Linux firmware is not flashed like a BIOS update; it is simply software that is loaded in memory during boot, to work with devices like a wifi chipset. Most of what you need will be in a linux-firmware package you can install if it isn't on the Arch iso. I usually install Arch using a wired connection and get wifi working after the basic Arch software is in place.

  • Like 1
  • Agree 1
  • +1 1
Link to comment
Share on other sites

V.T. Eric Layton

By definition, "wiping a drive" means just that. When you use tools/commands that are meant to wipe a drive clean, this is exactly what you will get... a totally wiped clean drive.

 

I'm not sure why you would bother with doing something like this, though? Personally, I would just clean the individual partitions of data or I would remove all partitions and re-partition the drive, then install whatever "new" items need installing.

 

When I upgrade my Slackware OS on my machines, all I do is install the new version of the OS onto my /(root) partition. I NEVER format or change my /home partition. By doing it this way, it saves me much work with regards to my personal data and customizations.

 

Anyway, GNU/Linux is about choices. Find what method is best for you and use that. :)

 

Welcome to Scots and BATL, by the way!

  • Like 3
  • Agree 1
Link to comment
Share on other sites

securitybreach
7 hours ago, linux screwed me up sadly said:

I messed up my main system real bad a week ago (specifications attached to my profile). I installed and used the wipe command preceded by shred -v /dev/sda . I read many blog posts about these commands to make sure they dont make my laptop unusable. Unfortunately, these two commands also removed ath10k AMD GPU Firmware from my system and now I am figuring out a way to burn the firware into the system and reinstall Arch Linux.
My question(s):
1. Apart from these two commands, do any of you Linux nerds know how to wipe a disk without having drastic repurcussions afterwards?
2. How do I get back my missing AMD GPU Firware onto the system?

 

The linux-firmware package will provide the ath10k module.

  • Like 1
Link to comment
Share on other sites

securitybreach

For the AMD GPU firmware, you have two choices:

 

xf86-video-ati for opensource driver

xf86-video-amdgpu for proprietary driver.

 

The opensource one is from the normal arch repos but the proprietary one is available via the AUR.

  • Like 2
Link to comment
Share on other sites

securitybreach
1 minute ago, raymac46 said:

I was a bit confused here as ath10k is really a wifi driver not GPU. Nevertheless both can be installed at the time of Arch installation.

 

They are different, the ATH10k module is provided by the linux-firmware package.

  • Like 1
Link to comment
Share on other sites

Hey everyone! Answered a bit late cuz I was busy with school haha ^~^ Thanks for your answers. Will try all of these steps out to fix the ATH10k module n other firmware. Also will try my best to not be freaked out when I try nerdy stuff. Will post a screenshot or message under this thread when my Arch is setup once again.

  • Like 1
  • +1 3
Link to comment
Share on other sites

V.T. Eric Layton

Good for you! That's the proper attitude. After you "tweak till it breaks", as they say, it's always good to get back on the horse. Heh! How's that for mix-and-match analogies? :)

  • Haha 2
  • Agree 2
Link to comment
Share on other sites

It's also prudent, nay, essential to back up your system to another drive for if/when you "tweak till it breaks" so you can revert a catastrophe in a few minutes.

I back up my root filesystem petition with fsarchiver and other data partitions with rsync to external USB HD. Best to run fsarchiver from a separate system such as another dual-boot OS on your same computer or from a live USB system. If that's too geeky you can use something like BackInTime https://wiki.archlinux.org/title/Back_In_Time

  • Like 1
  • +1 2
Link to comment
Share on other sites

securitybreach

I just use Clonzilla (via their live iso) every few months to take a snapshot of my root partition. It's menu driven and easy to use.

  • Like 1
  • +1 1
Link to comment
Share on other sites

16 minutes ago, securitybreach said:

I just use Clonzilla (via their live iso) every few months to take a snapshot of my root partition. It's menu driven and easy to use.

 

I used Clonezilla religiously for years. Its menu is ok but I found its "mount drive as Clonezilla home" paradigm to be really clumsy, so much that if I wanted to start again or do a second backup it was easier to just reboot the live system than try to unmount/remount.

fsarchiver is much simpler, mount the drives and do something like

fsarchiver -j3 savefs /backup/location.fsa /dev/sdaX

Obviously modify the location and source to suit.

  • Like 1
  • Agree 1
Link to comment
Share on other sites

  • 1 month later...
On 12/16/2021 at 8:28 AM, jeh-vin said:

Hey everyone! Answered a bit late cuz I was busy with school haha ^~^ Thanks for your answers. Will try all of these steps out to fix the ATH10k module n other firmware. Also will try my best to not be freaked out when I try nerdy stuff. Will post a screenshot or message under this thread when my Arch is setup once again.

I would look for my motherboard pc install disk for such items; you won't need any special tools to install it. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...