Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

Which way is the fastest to `dd` to the last 512 kilobytes of disk

As already pointed out, dd accepts the seek=BLOCKS parameter, which skips BLOCKS blocks in the output file.

Now you need to know the exact size of the disk, if you want to write the last 512kB. On linux, you can use the blockdev --getsz DEVICE command to get the size, in units of 512B.

So the command-line becomes something like:

dd if=/dev/zero of=$YOUR_DEV bs=512 seek=$(( $(blockdev --getsz $YOUR_DEV) - 1 )) count=1

Tags:

Unix

Dd

Related

How can I change the hard disk name in Ubuntu? How can I force Windows 7 to update the user profile path? SSD -- Special settings for SSD as secondary drive? Ubuntu + latest samba version, symlinks no longer work on share mounted in windows Midnight Commander (MC) installer for Mac OS X How do you use 4GB of RAM? How can I export an evernote account into Emacs.org? Scrolling mouse sets windows sound volume How to export an individual bookmark folder in Google Chrome? Is looking for Wi-Fi access points purely passive? Make headphone output mono Windows Text Editor With SCP Support and No Install

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy