WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Best way to backup live TCL thumbdrives .........  (Read 9091 times)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Best way to backup live TCL thumbdrives .........
« Reply #15 on: July 18, 2012, 06:49:42 PM »
dd will copy sector by sector, regardless if sectors are zero.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline hitsware

  • Jr. Member
  • **
  • Posts: 97
Re: Best way to backup live TCL thumbdrives .........
« Reply #16 on: July 18, 2012, 06:59:02 PM »
Yea. I got it ! ........... :)

dd count=62500 if=/dev/sdb1 of=/dev/sdc1


Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Best way to backup live TCL thumbdrives .........
« Reply #17 on: July 18, 2012, 07:46:03 PM »
Uhmm...
That looks random, no?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline hitsware

  • Jr. Member
  • **
  • Posts: 97
Re: Best way to backup live TCL thumbdrives .........
« Reply #18 on: July 18, 2012, 08:20:54 PM »
512 bytes is default block size
TCL is ~ 20M so far
32M should give enough for expansion (I'll have to keep track)
512 * 62500 = 32M

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11667
Re: Best way to backup live TCL thumbdrives .........
« Reply #19 on: July 18, 2012, 09:07:25 PM »
Hi hitsware
It will take a while, but I would let the dd command run to completion. Your original thumb drive is fully formatted.
By letting dd finish, your destination thumb drive will also be fully formatted. You can probably speed up the
process by running it like this:
Code: [Select]
dd if=/dev/sdb1 of=/dev/sdc1 bs=1M
sync
The dd command should terminate on its own when it reaches the end of the drive. Once the cloned drive is
setup, you can speed up the process the next time you wish to update the clone by doing:
Code: [Select]
rm -fr /dev/sdc1/*
cp -a /dev/sdb1/* /dev/sdc1
sync

Offline hitsware

  • Jr. Member
  • **
  • Posts: 97
Re: Best way to backup live TCL thumbdrives .........
« Reply #20 on: July 18, 2012, 09:24:14 PM »
Hi hitsware
It will take a while, but I would let the dd command run to completion. Your original thumb drive is fully formatted.
By letting dd finish, your destination thumb drive will also be fully formatted. You can probably speed up the
process by running it like this:
Code: [Select]
dd if=/dev/sdb1 of=/dev/sdc1 bs=1M
sync
The dd command should terminate on its own when it reaches the end of the drive. Once the cloned drive is
setup, you can speed up the process the next time you wish to update the clone by doing:
Code: [Select]
rm -fr /dev/sdc1/*
cp -a /dev/sdb1/* /dev/sdc1
sync
If I format the drive before copying to it
will that have the same outcome ?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11667
Re: Best way to backup live TCL thumbdrives .........
« Reply #21 on: July 18, 2012, 09:34:11 PM »
Hi hitsware
Quote
If I format the drive before copying to it will that have the same outcome ?
Yes, as long as you make the drive bootable before copying your files. This should do that:
Code: [Select]
dd if=/dev/sdb1 of=/dev/sdc1 bs=512 count=1

Offline hitsware

  • Jr. Member
  • **
  • Posts: 97
Re: Best way to backup live TCL thumbdrives .........
« Reply #22 on: July 18, 2012, 09:39:55 PM »
I'm copying everything from the source which is already bootable.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11667
Re: Best way to backup live TCL thumbdrives .........
« Reply #23 on: July 18, 2012, 09:56:54 PM »
Hi hitsware
The cp command is not enough to make the destination drive bootable.

Offline hitsware

  • Jr. Member
  • **
  • Posts: 97
Re: Best way to backup live TCL thumbdrives .........
« Reply #24 on: July 18, 2012, 11:00:40 PM »
It worked ........
The original is from downloaded iso
(via XP) ......... installed to USB via ' core2usb '
Now (knock on wood) if I do
Code: [Select]
ddI get a real clone ...... (bootable since it's a clone)

« Last Edit: July 18, 2012, 11:04:51 PM by hitsware »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11667
Re: Best way to backup live TCL thumbdrives .........
« Reply #25 on: July 18, 2012, 11:28:11 PM »
Hi hitsware
That's not much of a dd command in your last post.

Offline hitsware

  • Jr. Member
  • **
  • Posts: 97
Re: Best way to backup live TCL thumbdrives .........
« Reply #26 on: July 19, 2012, 12:26:31 AM »
Code: [Select]
dd bs=8G  if=/dev/sdb1  of=/dev/sbc1

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Best way to backup live TCL thumbdrives .........
« Reply #27 on: July 19, 2012, 02:07:57 AM »
No way!
If any, make that "bs=512"
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline hitsware

  • Jr. Member
  • **
  • Posts: 97
Re: Best way to backup live TCL thumbdrives .........
« Reply #28 on: July 19, 2012, 09:00:03 AM »
512 is default ........... Rich says 1M
What's the significance of ' block size ' ?
There probably is an upper limit though .....

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11667
Re: Best way to backup live TCL thumbdrives .........
« Reply #29 on: July 19, 2012, 11:31:24 AM »
Hi hitsware
As the help screen for dd states:
Quote
Read and write N bytes at a time
So if bs=512 then dd reads 512 bytes then writes 512 bytes then reads 512 bytes writes 512 bytes ..... until done.
What it does with bs=8G, especially if you don't have that much RAM, I don't know.
When writing to a USB drive, internally, it also works in blocks. To perform a write, it first copies that block to some
internal RAM, erases that block, modifies the RAM with the new values, and finally writes the contents of the RAM
back to that block. The upshot of this is, if the USB drive uses a block size of 4K for example, and you are writing
512 bytes at a time, you MIGHT wind up writing the same block eight times. This would wear out the device faster
and have a negative impact on writing speed. I say MIGHT because if the device is smart enough, it may wait a
brief period of time before writing the data to see if any more data is coming in for that block. No, I don't know how
to determine what the natural block size of a USB drive is. I picked 1M because I read somewhere that current
devices can have block sizes of 128k or possibly 256K.