How do I make an image of my entire USB flash drive?Is there a way to determine the optimal value for the bs...
Shifting tenses in the middle of narration
How should I write this passage to make it the most readable?
How did Arecibo detect methane lakes on Titan, and image Saturn's rings?
Why does the cable resistance jump from a low value to high value at a particular frequency?
Causal Diagrams using Wolfram?
Weird resistor with dots around it
Do I have to cite common CS algorithms?
If you know the location of an invisible creature, can you attack it?
Dogfights in outer space
How can I find an old paper when the usual methods fail?
Are those flyers about apartment purchase a scam?
Doesn't the speed of light limit imply the same electron can be annihilated twice?
Why did Saruman lie?
Are there any other rule mechanics that could grant Thieves' Cant?
Why is tert-butoxide often used in elimination reactions when it is not necessary?
Graphs for which a calculus student can reasonably compute the arclength
Is it possible to grow new organs through exposure to radioactivity?
A torrent of foreign terms
Identifying My Main Water Shutoff Valve / Setup
Running code generated in realtime in JavaScript with eval()
Why aren't rockets built with truss structures inside their fuel & oxidizer tanks to increase structural strength?
Installing Windows to flash BIOS, then reinstalling Ubuntu
What is a layman explanation for why the wavelength of light increases when space itself expands?
What is the hottest thing in the universe?
How do I make an image of my entire USB flash drive?
Is there a way to determine the optimal value for the bs parameter to dd?Where are my copied files?Best linux recovery tool for deleted files from USB flash drive?cannot mount usbI can't access my USB device after mkfs.ntfs commandUSB flash drive formatted as “Linux Live CD” keeps the CD-ROM name after re-partitioningSet removable media (USB drive) permissions to a specific groupHow do I plug in a usb-drive?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
The message below comes from another post and I tried it the way that they stated to. First, I mounted the USB drive:
sudo mount -o ro,noexec /dev/sdb1 /media
I mounted it as read-only to prevent any damage or changes to the USB while copying it, especially if I mixed up if
and of
. In the message below, I'm not sure if they wanted to me to use sdb
or sdb#
for if
.
Before trying any recovery I would save the current state by backing up the whole device block by block:
dd if=/dev/sdb bs=16M of=/somelargedisk/rawusbdrive
where /dev/sdb is your USB drive (check which one by using lsblk) and /somelargedisk/rawusbdrive is a path and filename you choose on a disk/partition with lots of space. Then, if a recovery tool that writes to the disk makes more damage than repairing, you can go back (exchange if and of fields)."
usb
New contributor
add a comment |
The message below comes from another post and I tried it the way that they stated to. First, I mounted the USB drive:
sudo mount -o ro,noexec /dev/sdb1 /media
I mounted it as read-only to prevent any damage or changes to the USB while copying it, especially if I mixed up if
and of
. In the message below, I'm not sure if they wanted to me to use sdb
or sdb#
for if
.
Before trying any recovery I would save the current state by backing up the whole device block by block:
dd if=/dev/sdb bs=16M of=/somelargedisk/rawusbdrive
where /dev/sdb is your USB drive (check which one by using lsblk) and /somelargedisk/rawusbdrive is a path and filename you choose on a disk/partition with lots of space. Then, if a recovery tool that writes to the disk makes more damage than repairing, you can go back (exchange if and of fields)."
usb
New contributor
If you'redd
-ing the drive, why do you mount it at all?sdb1
is a partition,sdb
is the whole disk.
– Kusalananda♦
yesterday
@Kusalananda Simply, since the image is coming from a flash drive, I thought it had to be mounted like all usb's usually are. Thx.
– hddfsck777
yesterday
@Kusalananda Since the usb 'was' mounted for the original dd, do you think that I made the usb less likely to be able to retrieve the deleted, stolen files from it? Thx.
– hddfsck777
yesterday
Ned64 addressed this in a comment (to a degree). Please don't ask follow-up questions in comments. This is not a discussion forum. Your question should be answerable with finality. Additional questions should be new questions.
– Kusalananda♦
yesterday
@Kusalananda ok, good to know.
– hddfsck777
yesterday
add a comment |
The message below comes from another post and I tried it the way that they stated to. First, I mounted the USB drive:
sudo mount -o ro,noexec /dev/sdb1 /media
I mounted it as read-only to prevent any damage or changes to the USB while copying it, especially if I mixed up if
and of
. In the message below, I'm not sure if they wanted to me to use sdb
or sdb#
for if
.
Before trying any recovery I would save the current state by backing up the whole device block by block:
dd if=/dev/sdb bs=16M of=/somelargedisk/rawusbdrive
where /dev/sdb is your USB drive (check which one by using lsblk) and /somelargedisk/rawusbdrive is a path and filename you choose on a disk/partition with lots of space. Then, if a recovery tool that writes to the disk makes more damage than repairing, you can go back (exchange if and of fields)."
usb
New contributor
The message below comes from another post and I tried it the way that they stated to. First, I mounted the USB drive:
sudo mount -o ro,noexec /dev/sdb1 /media
I mounted it as read-only to prevent any damage or changes to the USB while copying it, especially if I mixed up if
and of
. In the message below, I'm not sure if they wanted to me to use sdb
or sdb#
for if
.
Before trying any recovery I would save the current state by backing up the whole device block by block:
dd if=/dev/sdb bs=16M of=/somelargedisk/rawusbdrive
where /dev/sdb is your USB drive (check which one by using lsblk) and /somelargedisk/rawusbdrive is a path and filename you choose on a disk/partition with lots of space. Then, if a recovery tool that writes to the disk makes more damage than repairing, you can go back (exchange if and of fields)."
usb
usb
New contributor
New contributor
edited 16 hours ago
Peter Mortensen
9566 silver badges9 bronze badges
9566 silver badges9 bronze badges
New contributor
asked yesterday
hddfsck777hddfsck777
295 bronze badges
295 bronze badges
New contributor
New contributor
If you'redd
-ing the drive, why do you mount it at all?sdb1
is a partition,sdb
is the whole disk.
– Kusalananda♦
yesterday
@Kusalananda Simply, since the image is coming from a flash drive, I thought it had to be mounted like all usb's usually are. Thx.
– hddfsck777
yesterday
@Kusalananda Since the usb 'was' mounted for the original dd, do you think that I made the usb less likely to be able to retrieve the deleted, stolen files from it? Thx.
– hddfsck777
yesterday
Ned64 addressed this in a comment (to a degree). Please don't ask follow-up questions in comments. This is not a discussion forum. Your question should be answerable with finality. Additional questions should be new questions.
– Kusalananda♦
yesterday
@Kusalananda ok, good to know.
– hddfsck777
yesterday
add a comment |
If you'redd
-ing the drive, why do you mount it at all?sdb1
is a partition,sdb
is the whole disk.
– Kusalananda♦
yesterday
@Kusalananda Simply, since the image is coming from a flash drive, I thought it had to be mounted like all usb's usually are. Thx.
– hddfsck777
yesterday
@Kusalananda Since the usb 'was' mounted for the original dd, do you think that I made the usb less likely to be able to retrieve the deleted, stolen files from it? Thx.
– hddfsck777
yesterday
Ned64 addressed this in a comment (to a degree). Please don't ask follow-up questions in comments. This is not a discussion forum. Your question should be answerable with finality. Additional questions should be new questions.
– Kusalananda♦
yesterday
@Kusalananda ok, good to know.
– hddfsck777
yesterday
If you're
dd
-ing the drive, why do you mount it at all? sdb1
is a partition, sdb
is the whole disk.– Kusalananda♦
yesterday
If you're
dd
-ing the drive, why do you mount it at all? sdb1
is a partition, sdb
is the whole disk.– Kusalananda♦
yesterday
@Kusalananda Simply, since the image is coming from a flash drive, I thought it had to be mounted like all usb's usually are. Thx.
– hddfsck777
yesterday
@Kusalananda Simply, since the image is coming from a flash drive, I thought it had to be mounted like all usb's usually are. Thx.
– hddfsck777
yesterday
@Kusalananda Since the usb 'was' mounted for the original dd, do you think that I made the usb less likely to be able to retrieve the deleted, stolen files from it? Thx.
– hddfsck777
yesterday
@Kusalananda Since the usb 'was' mounted for the original dd, do you think that I made the usb less likely to be able to retrieve the deleted, stolen files from it? Thx.
– hddfsck777
yesterday
Ned64 addressed this in a comment (to a degree). Please don't ask follow-up questions in comments. This is not a discussion forum. Your question should be answerable with finality. Additional questions should be new questions.
– Kusalananda♦
yesterday
Ned64 addressed this in a comment (to a degree). Please don't ask follow-up questions in comments. This is not a discussion forum. Your question should be answerable with finality. Additional questions should be new questions.
– Kusalananda♦
yesterday
@Kusalananda ok, good to know.
– hddfsck777
yesterday
@Kusalananda ok, good to know.
– hddfsck777
yesterday
add a comment |
2 Answers
2
active
oldest
votes
The best way to back up a whole drive is via dd
because you can control buffer size for block devices better than with cat
. While the USB drive is not mounted, please run, as root
:
dd if=/dev/sdb bs=16M of=/somelargedisk/rawusbdrive
where /dev/sdb
is your USB drive (check which one by using lsblk
) and /somelargedisk/rawusbdrive
is a path and filename you choose on a disk/partition with lots of space.
You can restore that backup by exchanging if
and of
arguments to dd
.
Please note: dd
can easily overwrite all your data beyond repair (with reasonable effort) if you get the parameters wrong!
This was first mentioned in my comment to your other question
Best linux recovery tool for deleted files from USB flash drive?
Yes, as my question directly comes from your reply, thanks. I am very comfortable with dd now, the 'if' starts with where the files are now (ie: usb), and the 'of' is the destination for the image. And I check my 'dd' command 100 times to be sure before hitting enter! Originally, I don't think we spoke about mounting or not mounting, if I recall correctly. I can redo it. Thanks.
– hddfsck777
yesterday
Any way to check the authenticity of the (new) image created, to make sure it is not corrupted? Thx.
– hddfsck777
yesterday
@hddfsck777 The data is usually copied without error. If you are unsure you could copy the data again, to a second file, and runsha256sum
on both, then compare the hashes (or rundiff -qs /somelargedisk/rawusbdrive /somelargedisk/rawusbdrive2
). The files may differ if you have mounted the disk in between.
– Ned64
yesterday
Probably faster withcat /dev/sdb >/somelargedisk/rawusbdrive
though. And easier to remember thandd
.
– roaima
yesterday
@roaima I do not think thatcat
would be faster as it would probably buffer with 512 Bytes as opposed to 16MiB specified bydd
here. Many drives read and write faster with medium buffer sizes.
– Ned64
yesterday
|
show 9 more comments
/dev/sdb
is the entire USB disk, and /dev/sdb1
is a partition on the disk. If you want to image the entire disk, you want /dev/sdb
.
That said, mounting as read-only isn't going to help you any in this case. You're bypassing the filesystem (which is where the read-only effect is) and working directly with the block device. So if you mix up i
and o
, you'll trash the disk anyway.
There isn't much benefit to dd
here, you might just as well use cat
:
sudo cat /dev/sdb > /somelargedisk/rawusbdrive
(Or pv
for a nice progress display.)
what happens ifcat
dies with an i/o error? you keep both pieces? try again to read the damaged blicks
– pizdelect
yesterday
1
Both cat and dd will fail from an Input / Output error. ddrescure was made for the purpose of continuing on after errors if that's what's happening.
– Alex Cannon
19 hours ago
add a comment |
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
});
}
});
hddfsck777 is a new contributor. Be nice, and check out our Code of Conduct.
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%2f535323%2fhow-do-i-make-an-image-of-my-entire-usb-flash-drive%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The best way to back up a whole drive is via dd
because you can control buffer size for block devices better than with cat
. While the USB drive is not mounted, please run, as root
:
dd if=/dev/sdb bs=16M of=/somelargedisk/rawusbdrive
where /dev/sdb
is your USB drive (check which one by using lsblk
) and /somelargedisk/rawusbdrive
is a path and filename you choose on a disk/partition with lots of space.
You can restore that backup by exchanging if
and of
arguments to dd
.
Please note: dd
can easily overwrite all your data beyond repair (with reasonable effort) if you get the parameters wrong!
This was first mentioned in my comment to your other question
Best linux recovery tool for deleted files from USB flash drive?
Yes, as my question directly comes from your reply, thanks. I am very comfortable with dd now, the 'if' starts with where the files are now (ie: usb), and the 'of' is the destination for the image. And I check my 'dd' command 100 times to be sure before hitting enter! Originally, I don't think we spoke about mounting or not mounting, if I recall correctly. I can redo it. Thanks.
– hddfsck777
yesterday
Any way to check the authenticity of the (new) image created, to make sure it is not corrupted? Thx.
– hddfsck777
yesterday
@hddfsck777 The data is usually copied without error. If you are unsure you could copy the data again, to a second file, and runsha256sum
on both, then compare the hashes (or rundiff -qs /somelargedisk/rawusbdrive /somelargedisk/rawusbdrive2
). The files may differ if you have mounted the disk in between.
– Ned64
yesterday
Probably faster withcat /dev/sdb >/somelargedisk/rawusbdrive
though. And easier to remember thandd
.
– roaima
yesterday
@roaima I do not think thatcat
would be faster as it would probably buffer with 512 Bytes as opposed to 16MiB specified bydd
here. Many drives read and write faster with medium buffer sizes.
– Ned64
yesterday
|
show 9 more comments
The best way to back up a whole drive is via dd
because you can control buffer size for block devices better than with cat
. While the USB drive is not mounted, please run, as root
:
dd if=/dev/sdb bs=16M of=/somelargedisk/rawusbdrive
where /dev/sdb
is your USB drive (check which one by using lsblk
) and /somelargedisk/rawusbdrive
is a path and filename you choose on a disk/partition with lots of space.
You can restore that backup by exchanging if
and of
arguments to dd
.
Please note: dd
can easily overwrite all your data beyond repair (with reasonable effort) if you get the parameters wrong!
This was first mentioned in my comment to your other question
Best linux recovery tool for deleted files from USB flash drive?
Yes, as my question directly comes from your reply, thanks. I am very comfortable with dd now, the 'if' starts with where the files are now (ie: usb), and the 'of' is the destination for the image. And I check my 'dd' command 100 times to be sure before hitting enter! Originally, I don't think we spoke about mounting or not mounting, if I recall correctly. I can redo it. Thanks.
– hddfsck777
yesterday
Any way to check the authenticity of the (new) image created, to make sure it is not corrupted? Thx.
– hddfsck777
yesterday
@hddfsck777 The data is usually copied without error. If you are unsure you could copy the data again, to a second file, and runsha256sum
on both, then compare the hashes (or rundiff -qs /somelargedisk/rawusbdrive /somelargedisk/rawusbdrive2
). The files may differ if you have mounted the disk in between.
– Ned64
yesterday
Probably faster withcat /dev/sdb >/somelargedisk/rawusbdrive
though. And easier to remember thandd
.
– roaima
yesterday
@roaima I do not think thatcat
would be faster as it would probably buffer with 512 Bytes as opposed to 16MiB specified bydd
here. Many drives read and write faster with medium buffer sizes.
– Ned64
yesterday
|
show 9 more comments
The best way to back up a whole drive is via dd
because you can control buffer size for block devices better than with cat
. While the USB drive is not mounted, please run, as root
:
dd if=/dev/sdb bs=16M of=/somelargedisk/rawusbdrive
where /dev/sdb
is your USB drive (check which one by using lsblk
) and /somelargedisk/rawusbdrive
is a path and filename you choose on a disk/partition with lots of space.
You can restore that backup by exchanging if
and of
arguments to dd
.
Please note: dd
can easily overwrite all your data beyond repair (with reasonable effort) if you get the parameters wrong!
This was first mentioned in my comment to your other question
Best linux recovery tool for deleted files from USB flash drive?
The best way to back up a whole drive is via dd
because you can control buffer size for block devices better than with cat
. While the USB drive is not mounted, please run, as root
:
dd if=/dev/sdb bs=16M of=/somelargedisk/rawusbdrive
where /dev/sdb
is your USB drive (check which one by using lsblk
) and /somelargedisk/rawusbdrive
is a path and filename you choose on a disk/partition with lots of space.
You can restore that backup by exchanging if
and of
arguments to dd
.
Please note: dd
can easily overwrite all your data beyond repair (with reasonable effort) if you get the parameters wrong!
This was first mentioned in my comment to your other question
Best linux recovery tool for deleted files from USB flash drive?
answered yesterday
Ned64Ned64
3,2341 gold badge16 silver badges42 bronze badges
3,2341 gold badge16 silver badges42 bronze badges
Yes, as my question directly comes from your reply, thanks. I am very comfortable with dd now, the 'if' starts with where the files are now (ie: usb), and the 'of' is the destination for the image. And I check my 'dd' command 100 times to be sure before hitting enter! Originally, I don't think we spoke about mounting or not mounting, if I recall correctly. I can redo it. Thanks.
– hddfsck777
yesterday
Any way to check the authenticity of the (new) image created, to make sure it is not corrupted? Thx.
– hddfsck777
yesterday
@hddfsck777 The data is usually copied without error. If you are unsure you could copy the data again, to a second file, and runsha256sum
on both, then compare the hashes (or rundiff -qs /somelargedisk/rawusbdrive /somelargedisk/rawusbdrive2
). The files may differ if you have mounted the disk in between.
– Ned64
yesterday
Probably faster withcat /dev/sdb >/somelargedisk/rawusbdrive
though. And easier to remember thandd
.
– roaima
yesterday
@roaima I do not think thatcat
would be faster as it would probably buffer with 512 Bytes as opposed to 16MiB specified bydd
here. Many drives read and write faster with medium buffer sizes.
– Ned64
yesterday
|
show 9 more comments
Yes, as my question directly comes from your reply, thanks. I am very comfortable with dd now, the 'if' starts with where the files are now (ie: usb), and the 'of' is the destination for the image. And I check my 'dd' command 100 times to be sure before hitting enter! Originally, I don't think we spoke about mounting or not mounting, if I recall correctly. I can redo it. Thanks.
– hddfsck777
yesterday
Any way to check the authenticity of the (new) image created, to make sure it is not corrupted? Thx.
– hddfsck777
yesterday
@hddfsck777 The data is usually copied without error. If you are unsure you could copy the data again, to a second file, and runsha256sum
on both, then compare the hashes (or rundiff -qs /somelargedisk/rawusbdrive /somelargedisk/rawusbdrive2
). The files may differ if you have mounted the disk in between.
– Ned64
yesterday
Probably faster withcat /dev/sdb >/somelargedisk/rawusbdrive
though. And easier to remember thandd
.
– roaima
yesterday
@roaima I do not think thatcat
would be faster as it would probably buffer with 512 Bytes as opposed to 16MiB specified bydd
here. Many drives read and write faster with medium buffer sizes.
– Ned64
yesterday
Yes, as my question directly comes from your reply, thanks. I am very comfortable with dd now, the 'if' starts with where the files are now (ie: usb), and the 'of' is the destination for the image. And I check my 'dd' command 100 times to be sure before hitting enter! Originally, I don't think we spoke about mounting or not mounting, if I recall correctly. I can redo it. Thanks.
– hddfsck777
yesterday
Yes, as my question directly comes from your reply, thanks. I am very comfortable with dd now, the 'if' starts with where the files are now (ie: usb), and the 'of' is the destination for the image. And I check my 'dd' command 100 times to be sure before hitting enter! Originally, I don't think we spoke about mounting or not mounting, if I recall correctly. I can redo it. Thanks.
– hddfsck777
yesterday
Any way to check the authenticity of the (new) image created, to make sure it is not corrupted? Thx.
– hddfsck777
yesterday
Any way to check the authenticity of the (new) image created, to make sure it is not corrupted? Thx.
– hddfsck777
yesterday
@hddfsck777 The data is usually copied without error. If you are unsure you could copy the data again, to a second file, and run
sha256sum
on both, then compare the hashes (or run diff -qs /somelargedisk/rawusbdrive /somelargedisk/rawusbdrive2
). The files may differ if you have mounted the disk in between.– Ned64
yesterday
@hddfsck777 The data is usually copied without error. If you are unsure you could copy the data again, to a second file, and run
sha256sum
on both, then compare the hashes (or run diff -qs /somelargedisk/rawusbdrive /somelargedisk/rawusbdrive2
). The files may differ if you have mounted the disk in between.– Ned64
yesterday
Probably faster with
cat /dev/sdb >/somelargedisk/rawusbdrive
though. And easier to remember than dd
.– roaima
yesterday
Probably faster with
cat /dev/sdb >/somelargedisk/rawusbdrive
though. And easier to remember than dd
.– roaima
yesterday
@roaima I do not think that
cat
would be faster as it would probably buffer with 512 Bytes as opposed to 16MiB specified by dd
here. Many drives read and write faster with medium buffer sizes.– Ned64
yesterday
@roaima I do not think that
cat
would be faster as it would probably buffer with 512 Bytes as opposed to 16MiB specified by dd
here. Many drives read and write faster with medium buffer sizes.– Ned64
yesterday
|
show 9 more comments
/dev/sdb
is the entire USB disk, and /dev/sdb1
is a partition on the disk. If you want to image the entire disk, you want /dev/sdb
.
That said, mounting as read-only isn't going to help you any in this case. You're bypassing the filesystem (which is where the read-only effect is) and working directly with the block device. So if you mix up i
and o
, you'll trash the disk anyway.
There isn't much benefit to dd
here, you might just as well use cat
:
sudo cat /dev/sdb > /somelargedisk/rawusbdrive
(Or pv
for a nice progress display.)
what happens ifcat
dies with an i/o error? you keep both pieces? try again to read the damaged blicks
– pizdelect
yesterday
1
Both cat and dd will fail from an Input / Output error. ddrescure was made for the purpose of continuing on after errors if that's what's happening.
– Alex Cannon
19 hours ago
add a comment |
/dev/sdb
is the entire USB disk, and /dev/sdb1
is a partition on the disk. If you want to image the entire disk, you want /dev/sdb
.
That said, mounting as read-only isn't going to help you any in this case. You're bypassing the filesystem (which is where the read-only effect is) and working directly with the block device. So if you mix up i
and o
, you'll trash the disk anyway.
There isn't much benefit to dd
here, you might just as well use cat
:
sudo cat /dev/sdb > /somelargedisk/rawusbdrive
(Or pv
for a nice progress display.)
what happens ifcat
dies with an i/o error? you keep both pieces? try again to read the damaged blicks
– pizdelect
yesterday
1
Both cat and dd will fail from an Input / Output error. ddrescure was made for the purpose of continuing on after errors if that's what's happening.
– Alex Cannon
19 hours ago
add a comment |
/dev/sdb
is the entire USB disk, and /dev/sdb1
is a partition on the disk. If you want to image the entire disk, you want /dev/sdb
.
That said, mounting as read-only isn't going to help you any in this case. You're bypassing the filesystem (which is where the read-only effect is) and working directly with the block device. So if you mix up i
and o
, you'll trash the disk anyway.
There isn't much benefit to dd
here, you might just as well use cat
:
sudo cat /dev/sdb > /somelargedisk/rawusbdrive
(Or pv
for a nice progress display.)
/dev/sdb
is the entire USB disk, and /dev/sdb1
is a partition on the disk. If you want to image the entire disk, you want /dev/sdb
.
That said, mounting as read-only isn't going to help you any in this case. You're bypassing the filesystem (which is where the read-only effect is) and working directly with the block device. So if you mix up i
and o
, you'll trash the disk anyway.
There isn't much benefit to dd
here, you might just as well use cat
:
sudo cat /dev/sdb > /somelargedisk/rawusbdrive
(Or pv
for a nice progress display.)
answered yesterday
murumuru
43.7k5 gold badges110 silver badges181 bronze badges
43.7k5 gold badges110 silver badges181 bronze badges
what happens ifcat
dies with an i/o error? you keep both pieces? try again to read the damaged blicks
– pizdelect
yesterday
1
Both cat and dd will fail from an Input / Output error. ddrescure was made for the purpose of continuing on after errors if that's what's happening.
– Alex Cannon
19 hours ago
add a comment |
what happens ifcat
dies with an i/o error? you keep both pieces? try again to read the damaged blicks
– pizdelect
yesterday
1
Both cat and dd will fail from an Input / Output error. ddrescure was made for the purpose of continuing on after errors if that's what's happening.
– Alex Cannon
19 hours ago
what happens if
cat
dies with an i/o error? you keep both pieces? try again to read the damaged blicks– pizdelect
yesterday
what happens if
cat
dies with an i/o error? you keep both pieces? try again to read the damaged blicks– pizdelect
yesterday
1
1
Both cat and dd will fail from an Input / Output error. ddrescure was made for the purpose of continuing on after errors if that's what's happening.
– Alex Cannon
19 hours ago
Both cat and dd will fail from an Input / Output error. ddrescure was made for the purpose of continuing on after errors if that's what's happening.
– Alex Cannon
19 hours ago
add a comment |
hddfsck777 is a new contributor. Be nice, and check out our Code of Conduct.
hddfsck777 is a new contributor. Be nice, and check out our Code of Conduct.
hddfsck777 is a new contributor. Be nice, and check out our Code of Conduct.
hddfsck777 is a new contributor. Be nice, and check out our Code of Conduct.
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%2f535323%2fhow-do-i-make-an-image-of-my-entire-usb-flash-drive%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
If you're
dd
-ing the drive, why do you mount it at all?sdb1
is a partition,sdb
is the whole disk.– Kusalananda♦
yesterday
@Kusalananda Simply, since the image is coming from a flash drive, I thought it had to be mounted like all usb's usually are. Thx.
– hddfsck777
yesterday
@Kusalananda Since the usb 'was' mounted for the original dd, do you think that I made the usb less likely to be able to retrieve the deleted, stolen files from it? Thx.
– hddfsck777
yesterday
Ned64 addressed this in a comment (to a degree). Please don't ask follow-up questions in comments. This is not a discussion forum. Your question should be answerable with finality. Additional questions should be new questions.
– Kusalananda♦
yesterday
@Kusalananda ok, good to know.
– hddfsck777
yesterday