dd if=/dev/zero leaves drive contents in-tact? Bad USB stick?How to mount sdb directly or using LVM...
Found and corrected a mistake on someone's else paper -- praxis?
Is it okay to roll multiple attacks that all have advantage in one cluster?
Why is Nibbana referred to as "The destination and the path leading to the destination"?
Chorophyll and photosynthesis in plants with coloured leaves
When I press the space bar it deletes the letters in front of it
Is this a reference to the film Alien in the novel 2010 Odyssey Two?
Why do you use the "park" gear to park a car and not only the handbrake?
Why does wrapping Aluminium foil around my food help it keep warm, aluminium be good conductor should have no effect?
What the real concept of Static keyword in perspective of Embedded C. See below code
The three greedy pirates
How do you move up one folder in Finder?
Credit score and financing new car
What would +1/+2/+3 items be called in game?
What is the correct parsing of お高くとまる?
Write a function
A horrible Stockfish chess engine evaluation
Postgres trigram match acting strange for specific characters
How can I effectively communicate to recruiters that a phone call is not possible?
How can a dictatorship government be beneficial to a dictator in a post-scarcity society?
Is there a minimum field size for peah to apply?
What is this little owl-like bird?
Why did Harry Potter get a bedroom?
In Spider-Man: Far From Home, is this superhero name a reference to another comic book?
To what extent would a wizard be able to combine feats to learn to mimic unknown spells?
dd if=/dev/zero leaves drive contents in-tact? Bad USB stick?
How to mount sdb directly or using LVM partitions on sda?How can I extend VMware Partition on Centos 7 using GParted?Accidentally ejected sd card physically while ddwhy does does windows run checkdisk after I clone into a vm disk it using dd?How to extend logical & extended partition with fdiskA part of my hard drive isn't accessible and doesn't seem to be mounted. It happens if I reduce the size of thePartitioning an Arch-Linux over multiple drivesHow can I partition so that most of my data lives on the SSD, and only when I run out of space do I go to the HDD?Why can't I see NTFS partitions on a specific drive?Extend /dev/sdb3 partition
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I thought I could nuke all partitions of a drive by using dd if=/dev/zero of=/dev/sdX. In the past this has always worked for me, but in this case it is not working as expected.
#check the partitions
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part /media/james/Gentoo amd64 20190703T214502Z
└─sdb2 8:18 1 6.3M 0 part /media/james/GENTOOLIVE
#unmount and confirm the drive is still seen.
➜ ~ sudo umount "/media/james/Gentoo amd64 20190703T214502Z"
➜ ~ sudo umount "/media/james/GENTOOLIVE"
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part
└─sdb2 8:18 1 6.3M 0 part
#Run dd
➜ ~ sudo dd if=/dev/zero of=/dev/sdb bs=3M
dd: error writing '/dev/sdb': No space left on device
2649+0 records in
2648+0 records out
8330620928 bytes (8.3 GB, 7.8 GiB) copied, 5.50879 s, 1.5 GB/s
#the partitions are still there!
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part
└─sdb2 8:18 1 6.3M 0 part
➜ ~ lsblk
#after unplugging and replugging the drive, the old partition still mounts and still contains files. I was able to open several and read the contents.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part
└─sdb2 8:18 1 6.3M 0 part /media/james/GENTOOLIVE
What is really confusing me is that if I look in Gparted, the device is shown as 8GB unallocated, but this is a 16GB drive.
I ran badblocks -wsv, which passed but did so suspiciously quickly (minutes instead of hours). After unplugging and replugging, the drive shows up as /dev/sdc, and Gparted sees 14.56GB partition called "gentoo"
Testing with pattern 0xaa: set_o_direct: Invalid argument/0/0 errors)
done
Reading and comparing: done
Testing with pattern 0x55: done
Reading and comparing: done
Testing with pattern 0xff: done
Reading and comparing: done
Testing with pattern 0x00: done
Reading and comparing: done
Pass completed, 0 bad blocks found. (0/0/0 errors)
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdc 8:32 1 14.6G 0 disk
├─sdc1 8:33 1 292M 0 part
└─sdc2 8:34 1 6.3M 0 part
I'm guessing I should just put this flash drive out to pasture, but it seems to me such an odd sequence of events, I'm curious as to what sort of failure might have caused it (not really looking for a fix).
partition dd gparted flash-memory badblocks
add a comment |
I thought I could nuke all partitions of a drive by using dd if=/dev/zero of=/dev/sdX. In the past this has always worked for me, but in this case it is not working as expected.
#check the partitions
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part /media/james/Gentoo amd64 20190703T214502Z
└─sdb2 8:18 1 6.3M 0 part /media/james/GENTOOLIVE
#unmount and confirm the drive is still seen.
➜ ~ sudo umount "/media/james/Gentoo amd64 20190703T214502Z"
➜ ~ sudo umount "/media/james/GENTOOLIVE"
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part
└─sdb2 8:18 1 6.3M 0 part
#Run dd
➜ ~ sudo dd if=/dev/zero of=/dev/sdb bs=3M
dd: error writing '/dev/sdb': No space left on device
2649+0 records in
2648+0 records out
8330620928 bytes (8.3 GB, 7.8 GiB) copied, 5.50879 s, 1.5 GB/s
#the partitions are still there!
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part
└─sdb2 8:18 1 6.3M 0 part
➜ ~ lsblk
#after unplugging and replugging the drive, the old partition still mounts and still contains files. I was able to open several and read the contents.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part
└─sdb2 8:18 1 6.3M 0 part /media/james/GENTOOLIVE
What is really confusing me is that if I look in Gparted, the device is shown as 8GB unallocated, but this is a 16GB drive.
I ran badblocks -wsv, which passed but did so suspiciously quickly (minutes instead of hours). After unplugging and replugging, the drive shows up as /dev/sdc, and Gparted sees 14.56GB partition called "gentoo"
Testing with pattern 0xaa: set_o_direct: Invalid argument/0/0 errors)
done
Reading and comparing: done
Testing with pattern 0x55: done
Reading and comparing: done
Testing with pattern 0xff: done
Reading and comparing: done
Testing with pattern 0x00: done
Reading and comparing: done
Pass completed, 0 bad blocks found. (0/0/0 errors)
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdc 8:32 1 14.6G 0 disk
├─sdc1 8:33 1 292M 0 part
└─sdc2 8:34 1 6.3M 0 part
I'm guessing I should just put this flash drive out to pasture, but it seems to me such an odd sequence of events, I'm curious as to what sort of failure might have caused it (not really looking for a fix).
partition dd gparted flash-memory badblocks
1
The lsblk result doesn't show much change. Seems like no data was ever written to the disk at all.
– 炸鱼薯条德里克
19 mins ago
Yes it does appear that way. But it said "no space left on device", which is what usually happens after I have successfully run dd.
– Stonecraft
16 mins ago
add a comment |
I thought I could nuke all partitions of a drive by using dd if=/dev/zero of=/dev/sdX. In the past this has always worked for me, but in this case it is not working as expected.
#check the partitions
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part /media/james/Gentoo amd64 20190703T214502Z
└─sdb2 8:18 1 6.3M 0 part /media/james/GENTOOLIVE
#unmount and confirm the drive is still seen.
➜ ~ sudo umount "/media/james/Gentoo amd64 20190703T214502Z"
➜ ~ sudo umount "/media/james/GENTOOLIVE"
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part
└─sdb2 8:18 1 6.3M 0 part
#Run dd
➜ ~ sudo dd if=/dev/zero of=/dev/sdb bs=3M
dd: error writing '/dev/sdb': No space left on device
2649+0 records in
2648+0 records out
8330620928 bytes (8.3 GB, 7.8 GiB) copied, 5.50879 s, 1.5 GB/s
#the partitions are still there!
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part
└─sdb2 8:18 1 6.3M 0 part
➜ ~ lsblk
#after unplugging and replugging the drive, the old partition still mounts and still contains files. I was able to open several and read the contents.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part
└─sdb2 8:18 1 6.3M 0 part /media/james/GENTOOLIVE
What is really confusing me is that if I look in Gparted, the device is shown as 8GB unallocated, but this is a 16GB drive.
I ran badblocks -wsv, which passed but did so suspiciously quickly (minutes instead of hours). After unplugging and replugging, the drive shows up as /dev/sdc, and Gparted sees 14.56GB partition called "gentoo"
Testing with pattern 0xaa: set_o_direct: Invalid argument/0/0 errors)
done
Reading and comparing: done
Testing with pattern 0x55: done
Reading and comparing: done
Testing with pattern 0xff: done
Reading and comparing: done
Testing with pattern 0x00: done
Reading and comparing: done
Pass completed, 0 bad blocks found. (0/0/0 errors)
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdc 8:32 1 14.6G 0 disk
├─sdc1 8:33 1 292M 0 part
└─sdc2 8:34 1 6.3M 0 part
I'm guessing I should just put this flash drive out to pasture, but it seems to me such an odd sequence of events, I'm curious as to what sort of failure might have caused it (not really looking for a fix).
partition dd gparted flash-memory badblocks
I thought I could nuke all partitions of a drive by using dd if=/dev/zero of=/dev/sdX. In the past this has always worked for me, but in this case it is not working as expected.
#check the partitions
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part /media/james/Gentoo amd64 20190703T214502Z
└─sdb2 8:18 1 6.3M 0 part /media/james/GENTOOLIVE
#unmount and confirm the drive is still seen.
➜ ~ sudo umount "/media/james/Gentoo amd64 20190703T214502Z"
➜ ~ sudo umount "/media/james/GENTOOLIVE"
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part
└─sdb2 8:18 1 6.3M 0 part
#Run dd
➜ ~ sudo dd if=/dev/zero of=/dev/sdb bs=3M
dd: error writing '/dev/sdb': No space left on device
2649+0 records in
2648+0 records out
8330620928 bytes (8.3 GB, 7.8 GiB) copied, 5.50879 s, 1.5 GB/s
#the partitions are still there!
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part
└─sdb2 8:18 1 6.3M 0 part
➜ ~ lsblk
#after unplugging and replugging the drive, the old partition still mounts and still contains files. I was able to open several and read the contents.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdb 8:16 1 14.6G 0 disk
├─sdb1 8:17 1 292M 0 part
└─sdb2 8:18 1 6.3M 0 part /media/james/GENTOOLIVE
What is really confusing me is that if I look in Gparted, the device is shown as 8GB unallocated, but this is a 16GB drive.
I ran badblocks -wsv, which passed but did so suspiciously quickly (minutes instead of hours). After unplugging and replugging, the drive shows up as /dev/sdc, and Gparted sees 14.56GB partition called "gentoo"
Testing with pattern 0xaa: set_o_direct: Invalid argument/0/0 errors)
done
Reading and comparing: done
Testing with pattern 0x55: done
Reading and comparing: done
Testing with pattern 0xff: done
Reading and comparing: done
Testing with pattern 0x00: done
Reading and comparing: done
Pass completed, 0 bad blocks found. (0/0/0 errors)
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 476.4G 0 part /
sdc 8:32 1 14.6G 0 disk
├─sdc1 8:33 1 292M 0 part
└─sdc2 8:34 1 6.3M 0 part
I'm guessing I should just put this flash drive out to pasture, but it seems to me such an odd sequence of events, I'm curious as to what sort of failure might have caused it (not really looking for a fix).
partition dd gparted flash-memory badblocks
partition dd gparted flash-memory badblocks
edited 22 mins ago
Stonecraft
asked 1 hour ago
StonecraftStonecraft
2251 silver badge13 bronze badges
2251 silver badge13 bronze badges
1
The lsblk result doesn't show much change. Seems like no data was ever written to the disk at all.
– 炸鱼薯条德里克
19 mins ago
Yes it does appear that way. But it said "no space left on device", which is what usually happens after I have successfully run dd.
– Stonecraft
16 mins ago
add a comment |
1
The lsblk result doesn't show much change. Seems like no data was ever written to the disk at all.
– 炸鱼薯条德里克
19 mins ago
Yes it does appear that way. But it said "no space left on device", which is what usually happens after I have successfully run dd.
– Stonecraft
16 mins ago
1
1
The lsblk result doesn't show much change. Seems like no data was ever written to the disk at all.
– 炸鱼薯条德里克
19 mins ago
The lsblk result doesn't show much change. Seems like no data was ever written to the disk at all.
– 炸鱼薯条德里克
19 mins ago
Yes it does appear that way. But it said "no space left on device", which is what usually happens after I have successfully run dd.
– Stonecraft
16 mins ago
Yes it does appear that way. But it said "no space left on device", which is what usually happens after I have successfully run dd.
– Stonecraft
16 mins ago
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f529066%2fdd-if-dev-zero-leaves-drive-contents-in-tact-bad-usb-stick%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f529066%2fdd-if-dev-zero-leaves-drive-contents-in-tact-bad-usb-stick%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
The lsblk result doesn't show much change. Seems like no data was ever written to the disk at all.
– 炸鱼薯条德里克
19 mins ago
Yes it does appear that way. But it said "no space left on device", which is what usually happens after I have successfully run dd.
– Stonecraft
16 mins ago