You are not logged in.
I am following the Wiki to setup full disk encryption on an external hard drive. When I run
dd if=/dev/urandom of=/dev/sda1
I get
dd: writing to '/dev/sda1': Input/output error
Can anyone advise on a way to get the drive filled? Is it still safe to use this drive for dmcrypt/luks setup? I'm unsure how to proceed or what this means for the feasibility of using the drive for what I'm trying to accomplish.
Offline
Which wiki page are you following? I can't find that command listed. The containers are randomized in one place, but not the partition (as far as I can tell).
But in either case, is the drive partitioned and that partition unmounted? What is the output of `lsblk`?
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
I created an unformatted partition over the entire drive.
next I am to overwrite everything. I'll see if I can find what I read. I followed the exact same procedure on a different drive a few months back and had no problems. i wrote it all out in my notes, step by step, and I am replicating it on a new drive.
Offline
https://wiki.archlinux.org/index.php/Securely_wipe_disk
Isn't the error do to problems on the hard drive itself? Anyone experienced this before when setting up dmcrypt/luks?
Last edited by bzpnbx (2014-11-04 13:09:41)
Offline
That command isn't on that page. There is a similar command that writes to the device not to a partition. What about that lsblk output??
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
what's in dmesg after that error occurs?
usually it should say no space left on device (when it finishes)
Note that overwriting a hard disk with this command will take ages. It's faster to use shred -n 1 (for pseudorandom data), or cryptsetup luksFormat, luksOpen, zero the encryption device (resulting in "random" encrypted data on the disk), luksClose and finally luksFormat again for a new encryption key so cleartext is not zero either.
also when using dd you should really use a larger blocksize, like bs=64k, or bs=1M for human-readable (x blocks = x MiB).
Last edited by frostschutz (2014-11-04 13:45:26)
Offline
That command isn't on that page. There is a similar command that writes to the device not to a partition.
???
Do you mean
# dd if=/dev/urandom of=/dev/sdX
I copied above from the page.
Offline
also when using dd you should really use a larger blocksize, like bs=64k, or bs=1M for human-readable (x blocks = x MiB).
fdisk -l shows it uses the default 512
Offline
lsblk
the external drive shows as:
NAME MAJ:MIN RM TYPE
sdb 8:16 0 disk
|_sdb1 8:17 0 part
Offline
dmesg output for the external drive is full of below errors:
Buffer I/O error
lost page write due to I/O error
Offline
bs= of dd is not about physical blocksize of a hdd...
so it's sdb and not sda?
what does ls -lh /dev/sd* show?
if you used a wrong name, you filled your devtmpfs with crap, instead of actually writing to a device
if you get errors writing to a device, you have a hardware issue
Last edited by frostschutz (2014-11-04 14:01:27)
Offline
if you get errors writing to a device, you have a hardware issue
Yes, it is a hardware issue. I'm sorry if I didn't make this clear enough in my original post. I'm seeking guidance on if there is a work around for this hardware issue and/or if the hardware issue creates "security problems" because parts of the disk can't be overwritten. Do you recommend scrapping the drive? Is there something I can do to correct for the hardware problems, that sort of thing.
Offline
You could check SMART data of the device (smartctl -a /dev/sda). If it has bad sectors (reallocated/pending/uncorrectable), get a replacement. Otherwise it could also be an issue with cables / power supply / etc.
Offline
It has bad sectors. It's not a very old drive either. Just wanted to check if you guys recommended scrapping the drive or if there was still a way to use it.
Offline
As you've just quoted, the wiki says to use that command with /dev/sdX like /dev/sda. This is to write to the device. You are using /dev/sda1 trying to write to the partition. This is not suggested in the wiki.
Also please answer *all* the questions posed to you (and learn to edit posts rather than posting 4-5 posts in series). I asked for lsblk output. Then I had to ask for it again. Then you gave me only *part* of the output, and not the relevant part! If you refuse to cooperate, no one here will be able to help you (let alone want to).
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
here's the entire output of lsblk:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 298.6G 0 disk
sda5 8:5 0 3.7G 0 part [SWAP]
sda6 8:6 0 8.4G 0 part /
sdb 8:16 0 465.8G 0 disk
sdb1 8:17 0 465.8G 0 part
sdb is the external drive.
Offline
You're trying to write to sda1, there is no such partition. That is likely why it fails.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
You're trying to write to sda1, there is no such partition. That is likely why it fails.
no. it writes fine. I used sda1 earlier because the way it was connected was different. That's why I wasn't putting all that you asked so quickly. I should be using sdX because in all my examples, I'm writing to the correct device, but it's not always receiving the same letter depending on what else I have connected to the computer at the same time.
I'm doing it correctly, to correct target etc. It's the hardware that's the problem.
Offline
I'm doing it correctly ...
Eh .. ok, then why ask here. Good luck finding help. I give up.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
bzpnbx wrote:I'm doing it correctly ...
Eh .. ok, then why ask here. Good luck finding help. I give up.
I appreciate all the help so far. With utmost respect, I only meant to say that I was aware of the change in device names. The help I was hoping for was in how to solve or manage the hardware problems with the drive.
"It has bad sectors. It's not a very old drive either. Just wanted to check if you guys recommended scrapping the drive or if there was still a way to use it."
Offline