Question on dd

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
deepakdeshp
Level 11
Level 11
Posts: 3852
Joined: Sun Aug 09, 2015 10:00 am

Question on dd

Post by deepakdeshp » Mon Aug 13, 2018 10:47 am

I have 2 file system fs1and fs2.fs1 is 2gb and fs2 3 GB.If. I copy using dd from fs1 to fs2, wth bs=40M, will the files from fs1 get copied to fs2?
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help, and keeps the forum clean.
I am using Mint 19 Cinnamon 64 bit with AMD A8/7410 processor . Memory 8GB

sgtor
Level 3
Level 3
Posts: 163
Joined: Sat May 13, 2017 9:39 pm

Re: Question on dd

Post by sgtor » Mon Aug 13, 2018 11:53 am

quick answer is yes. The formatting of your question is horrible though. lol
fs1=2gb
fs2=3gb

Copying 2gb to 3gb drive will work. dd is dangerous though if you're not careful. You need to be sure your if(in file)and of(out file) are correct.

gm10
Level 12
Level 12
Posts: 4101
Joined: Thu Jun 21, 2018 5:11 pm

Re: Question on dd

Post by gm10 » Mon Aug 13, 2018 12:00 pm

sgtor wrote:
Mon Aug 13, 2018 11:53 am
dd is dangerous though if you're not careful. You need to be sure your if(in file)and of(out file) are correct.
Agreed. I feel for copying files rather than entire block devices it's preferable to use something like rsync.

User avatar
Fred Barclay
Level 12
Level 12
Posts: 4156
Joined: Sat Sep 13, 2014 11:12 am
Location: Bumping around in the bush

Re: Question on dd

Post by Fred Barclay » Mon Aug 13, 2018 12:45 pm

Or cp -a /path/to/fs1 /path/to/fs2 should work too. ;)
Image
"Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy."
- Albert Einstein

Mute Ant
Level 13
Level 13
Posts: 4926
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: Question on dd

Post by Mute Ant » Mon Aug 13, 2018 12:50 pm

The 'bs' block size parameter to 'dd' can be omitted. The final physical write-down-the-wires will go through Linux, buffered from RAM, using whatever block size the driver-binary chooses.

With command 'dd', the 'of' destination only needs to be big enough to hold all the 'if' source. Any existing file system will be over-written.

You don't need command 'dd' when the data is a straight copy, just use command cp and specify a device as if it was a file. Linux knows how to handle that.
sudo cp $HOME/Downloads/linuxmint.iso /dev/sdX ### Burn a Mint distribution into a hard drive or USB stick.

gm10
Level 12
Level 12
Posts: 4101
Joined: Thu Jun 21, 2018 5:11 pm

Re: Question on dd

Post by gm10 » Mon Aug 13, 2018 12:57 pm

Fred Barclay wrote:
Mon Aug 13, 2018 12:45 pm
Or cp -a /path/to/fs1 /path/to/fs2 should work too. ;)
Sure, if you don't need to sync. Needs a sudo prefix to preserve ownership in case that's an issue.
Mute Ant wrote:
Mon Aug 13, 2018 12:50 pm
The 'bs' block size parameter to 'dd' can be omitted.
Yeah but then it defaults to 512 and that's slow.

Post Reply

Return to “Software & Applications”