SlideShare a Scribd company logo
6	
  Examples	
  to	
  Backup	
  Linux	
  Using	
  dd	
  Command	
  (Including	
  Disk	
  ...                                            hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/




                            Home
                            About
                            Free	
  eBook
                            Archives
                            Best	
  of	
  the	
  Blog
                            Contact


               6	
  Examples	
  to	
  Backup	
  Linux	
  Using	
  dd	
  Command	
  (Including	
  Disk	
  to
               Disk)
               by	
  Sasikala	
  on	
  October	
  11,	
  2010

                               0                        Like       11                Tweet          41




                                                                                  Data	
  loss	
  will	
  be	
  costly.	
  At	
  the	
  very	
  least,	
  criCcal	
  data	
  loss	
  will	
  have	
  a	
  financial	
  impact	
  on
               companies	
  of	
  all	
  sizes.	
  In	
  some	
  cases,	
  it	
  can	
  cost	
  your	
  job.	
  I’ve	
  seen	
  cases	
  where	
  sysadmins	
  learned	
  this	
  in	
  the	
  hard	
  way.

               There	
  are	
  several	
  ways	
  to	
  backup	
  a	
  Linux	
  system,	
  including	
  rsync	
  and	
  rsnapshot	
  that	
  we	
  discussed	
  a	
  while	
  back.

               This	
  arCcle	
  provides	
  6	
  pracCcal	
  examples	
  on	
  using	
  dd	
  command	
  to	
  backup	
  the	
  Linux	
  system.	
  dd	
  is	
  a	
  powerful	
  UNIX	
  uClity,	
  which	
  is	
  used
               by	
  the	
  Linux	
  kernel	
  makefiles	
  to	
  make	
  boot	
  images.	
  It	
  can	
  also	
  be	
  used	
  to	
  copy	
  data.	
  Only	
  superuser	
  can	
  execute	
  dd	
  command.

               Warning:	
  While	
  using	
  dd	
  command,	
  if	
  you	
  are	
  not	
  careful,	
  and	
  if	
  you	
  don’t	
  know	
  what	
  you	
  are	
  doing,	
  you	
  will	
  lose	
  your	
  data!

               Example	
  1.	
  Backup	
  En>re	
  Harddisk

               To	
  backup	
  an	
  enCre	
  copy	
  of	
  a	
  hard	
  disk	
  to	
  another	
  hard	
  disk	
  connected	
  to	
  the	
  same	
  system,	
  execute	
  the	
  dd	
  command	
  as	
  shown	
  below.



1	
  of	
  8                                                                                                                                                                                                                 18	
  Apr	
  12	
  7:06	
  pm
6	
  Examples	
  to	
  Backup	
  Linux	
  Using	
  dd	
  Command	
  (Including	
  Disk	
  ...                                           hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/


               In	
  this	
  dd	
  command	
  example,	
  the	
  UNIX	
  device	
  name	
  of	
  the	
  source	
  hard	
  disk	
  is	
  /dev/hda,	
  and	
  device	
  name	
  of	
  the	
  target	
  hard	
  disk	
  is
               /dev/hdb.

               # dd if=/dev/sda of=/dev/sdb

                            “if”	
  represents	
  inpu_ile,	
  and	
  “of”	
  represents	
  output	
  file.	
  So	
  the	
  exact	
  copy	
  of	
  /dev/sda	
  will	
  be	
  available	
  in	
  /dev/sdb.
                            If	
  there	
  are	
  any	
  errors,	
  the	
  above	
  command	
  will	
  fail.	
  If	
  you	
  give	
  the	
  parameter	
  “conv=noerror”	
  then	
  it	
  will	
  conCnue	
  to	
  copy	
  if
                            there	
  are	
  read	
  errors.
                            Input	
  file	
  and	
  output	
  file	
  should	
  be	
  menConed	
  very	
  carefully,	
  if	
  you	
  menCon	
  source	
  device	
  in	
  the	
  target	
  and	
  vice	
  versa,	
  you
                            might	
  loss	
  all	
  your	
  data.

               In	
  the	
  copy	
  of	
  hard	
  drive	
  to	
  hard	
  drive	
  using	
  dd	
  command	
  given	
  below,	
  sync	
  opCon	
  allows	
  you	
  to	
  copy	
  everything	
  using	
  synchronized
               I/O.

               # dd if=/dev/sda of=/dev/sdb conv=noerror,sync

               Example	
  2.	
  Create	
  an	
  Image	
  of	
  a	
  Hard	
  Disk

               Instead	
  of	
  taking	
  a	
  backup	
  of	
  the	
  hard	
  disk,	
  you	
  can	
  create	
  an	
  image	
  file	
  of	
  the	
  hard	
  disk	
  and	
  save	
  it	
  in	
  other	
  storage	
  devices.There	
  are
               many	
  advantages	
  to	
  backing	
  up	
  your	
  data	
  to	
  a	
  disk	
  image,	
  one	
  being	
  the	
  ease	
  of	
  use.	
  This	
  method	
  is	
  typically	
  faster	
  than	
  other	
  types	
  of
               backups,	
  enabling	
  you	
  to	
  quickly	
  restore	
  data	
  following	
  an	
  unexpected	
  catastrophe.

               # dd if=/dev/hda of=~/hdadisk.img

               The	
  above	
  creates	
  the	
  image	
  of	
  a	
  harddisk	
  /dev/hda.	
  Refer	
  our	
  earlier	
  arCcle	
  How	
  to	
  view	
  initrd.image	
  for	
  more	
  details.

               Example	
  3.	
  Restore	
  using	
  Hard	
  Disk	
  Image

               To	
  restore	
  a	
  hard	
  disk	
  with	
  the	
  image	
  file	
  of	
  an	
  another	
  hard	
  disk,	
  use	
  the	
  following	
  dd	
  command	
  example.

               # dd if=hdadisk.img of=/dev/hdb

               The	
  image	
  file	
  hdadisk.img	
  file,	
  is	
  the	
  image	
  of	
  a	
  /dev/hda,	
  so	
  the	
  above	
  command	
  will	
  restore	
  the	
  image	
  of	
  /dev/hda	
  to	
  /dev/hdb.

               Example	
  4.	
  Crea>ng	
  a	
  Floppy	
  Image

               Using	
  dd	
  command,	
  you	
  can	
  create	
  a	
  copy	
  of	
  the	
  floppy	
  image	
  very	
  quickly.	
  In	
  input	
  file,	
  give	
  the	
  floppy	
  device	
  locaCon,	
  and	
  in	
  the
               output	
  file,	
  give	
  the	
  name	
  of	
  your	
  floppy	
  image	
  file	
  as	
  shown	
  below.

               # dd if=/dev/fd0 of=myfloppy.img

               Example	
  5.	
  Backup	
  a	
  Par>>on

               You	
  can	
  use	
  the	
  device	
  name	
  of	
  a	
  parCCon	
  in	
  the	
  input	
  file,	
  and	
  in	
  the	
  output	
  either	
  you	
  can	
  specify	
  your	
  target	
  path	
  or	
  image	
  file	
  as
               shown	
  in	
  the	
  dd	
  command	
  example	
  below.

               # dd if=/dev/hda1 of=~/partition1.img

               Example	
  6.	
  CDROM	
  Backup

               dd	
  command	
  allows	
  you	
  to	
  create	
  an	
  iso	
  file	
  from	
  a	
  source	
  file.	
  So	
  we	
  can	
  insert	
  the	
  CD	
  and	
  enter	
  dd	
  command	
  to	
  create	
  an	
  iso	
  file	
  of	
  a
               CD	
  content.

               # dd if=/dev/cdrom of=tgsservice.iso bs=2048

               dd	
  command	
  reads	
  one	
  block	
  of	
  input	
  and	
  process	
  it	
  and	
  writes	
  it	
  into	
  an	
  output	
  file.	
  You	
  can	
  specify	
  the	
  block	
  size	
  for	
  input	
  and
               output	
  file.	
  In	
  the	
  above	
  dd	
  command	
  example,	
  the	
  parameter	
  “bs”	
  specifies	
  the	
  block	
  size	
  for	
  the	
  both	
  the	
  input	
  and	
  output	
  file.	
  So
               dd	
  uses	
  2048bytes	
  as	
  a	
  block	
  size	
  in	
  the	
  above	
  command.



2	
  of	
  8                                                                                                                                                                                                               18	
  Apr	
  12	
  7:06	
  pm
6	
  Examples	
  to	
  Backup	
  Linux	
  Using	
  dd	
  Command	
  (Including	
  Disk	
  ...                                  hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/


               Note:	
  If	
  CD	
  is	
  auto	
  mounted,	
  before	
  creaCng	
  an	
  iso	
  image	
  using	
  dd	
  command,	
  its	
  always	
  good	
  if	
  you	
  unmount	
  the	
  CD	
  device	
  to	
  avoid
               any	
  unnecessary	
  access	
  to	
  the	
  CD	
  ROM.



                              0                    Tweet          41                 Like       11                	
  Share            	
  Comment


               If	
  you	
  enjoyed	
  this	
  ar>cle,	
  you	
  might	
  also	
  like..


                       1. 50	
  Linux	
  Sysadmin	
  Tutorials
                                                                                                                                        Awk	
  IntroducCon	
  –	
  7	
  Awk	
  Print	
  Examples
                       2. 50	
  Most	
  Frequently	
  Used	
  Linux	
  Commands	
  (With	
  Examples)
                                                                                                                                        Advanced	
  Sed	
  SubsCtuCon	
  Examples
                       3. Top	
  25	
  Best	
  Linux	
  Performance	
  Monitoring	
  and	
  Debugging
                                                                                                                                        8	
  EssenCal	
  Vim	
  Editor	
  NavigaCon	
  Fundamentals
                          Tools
                                                                                                                                        25	
  Most	
  Frequently	
  Used	
  Linux	
  IPTables	
  Rules
                       4. Mommy,	
  I	
  found	
  it!	
  –	
  15	
  PracCcal	
  Linux	
  Find	
  Command
                                                                                                                                        Examples
                          Examples
                                                                                                                                        Turbocharge	
  PuTTY	
  with	
  12	
  Powerful	
  Add-­‐Ons
                       5. Linux	
  101	
  Hacks	
  2nd	
  EdiCon	
  eBook	
  




               {	
  14	
  comments…	
  read	
  them	
  below	
  or	
  add	
  one	
  }

               1	
  pupu	
  October	
  11,	
  2010	
  at	
  4:31	
  am

                           I	
  recommend	
  using	
  ‘dd’	
  on	
  unmounted/readonly	
  devices	
  only.	
  You	
  never	
  know	
  what	
  changes	
  in	
  the	
  middle	
  of	
  this	
  kind	
  of
                           backup.	
  Dd	
  doesn’t	
  lock	
  your	
  filesystem.	
  It	
  will	
  read	
  and	
  write	
  blindly	
  and	
  if	
  you	
  don’t	
  know	
  what	
  you	
  are	
  doing,	
  well…

               2	
  rene	
  October	
  11,	
  2010	
  at	
  6:49	
  am

                           Will	
  this	
  work	
  with	
  a	
  hard	
  drive	
  with	
  both	
  Windows	
  and
                           Linux	
  on	
  it?

               3	
  Jorge	
  Cedi	
  October	
  11,	
  2010	
  at	
  11:53	
  am

                           You	
  can	
  backup	
  a	
  usb	
  key	
  with	
  dd

               4	
  ciastek	
  October	
  12,	
  2010	
  at	
  5:46	
  pm

                           Thanks	
  for	
  nice	
  examples.
                           When	
  and	
  why	
  should	
  i	
  use	
  synchronized	
  I/O?
                           How	
  should	
  i	
  find	
  opCmal	
  block	
  size?

               5	
  Bernardo	
  October	
  13,	
  2010	
  at	
  12:18	
  pm



3	
  of	
  8                                                                                                                                                                                                 18	
  Apr	
  12	
  7:06	
  pm
6	
  Examples	
  to	
  Backup	
  Linux	
  Using	
  dd	
  Command	
  (Including	
  Disk	
  ...                                            hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/


                            Nice	
  examples,
                            I	
  would	
  like	
  to	
  share	
  one	
  of	
  many	
  hacks	
  to	
  know	
  the	
  “status”	
  of	
  dd	
  copy	
  progress.
                            Send	
  the	
  dd	
  command	
  to	
  background
                            i.e.
                            #	
  dd=if=/dev/sda	
  of=backup.img	
  &
                            [1]	
  26431	
  <——–	
  Process	
  ID
                            Check	
  the	
  process	
  ID	
  and	
  run	
  the	
  next	
  command:
                            #	
  kill	
  -­‐SIGUSR1	
  26431
                            This	
  will	
  shows	
  the	
  copied	
  bytes	
  and	
  the	
  copy	
  rate.

               6	
  MaCas	
  October	
  14,	
  2010	
  at	
  7:05	
  am

                            Hello!
                            It’s	
  a	
  really	
  useful	
  post,	
  but	
  I	
  think	
  it	
  should	
  be	
  noted	
  that	
  dd	
  is	
  used	
  just	
  to	
  copy	
  files,	
  and	
  not	
  to	
  make	
  backups,	
  because	
  a
                            backup	
  tool	
  has	
  a	
  lot	
  more	
  funcConality,	
  like	
  different	
  backup	
  levels,	
  automaCon	
  of	
  backups	
  and	
  some	
  kind	
  of	
  database	
  storing
                            related	
  data	
  (files	
  saved,	
  operator	
  who	
  run	
  the	
  backup,	
  etc).
                            Bye!

               7	
  Paul	
  A.	
  October	
  20,	
  2010	
  at	
  2:54	
  pm

                            This	
  is	
  not	
  very	
  much	
  related	
  to	
  dd,	
  but	
  I	
  thought	
  you’s	
  like	
  to	
  know	
  that	
  your	
  example	
  5	
  has	
  a	
  bash-­‐ism	
  that	
  I’m	
  not	
  enCrely
                            sure	
  is	
  a	
  bug	
  or	
  a	
  feature.	
  Most	
  other	
  shells	
  won’t	
  expand	
  the	
  ~	
  to	
  $HOME	
  like	
  bash	
  does	
  for	
  that	
  parCcular	
  command.	
  Zsh	
  has
                            an	
  opCon	
  MAGIC_EQUAL_SUBST	
  to	
  let	
  you	
  choose	
  either	
  way.

               8	
  iri	
  October	
  26,	
  2010	
  at	
  12:34	
  am

                            Regarding	
  example	
  5.
                            what	
  if	
  ~	
  is	
  on	
  /dev/hda1	
  

               9	
  Cosmos	
  November	
  17,	
  2010	
  at	
  10:35	
  am

                            Another	
  useful	
  Cp:

                            In	
  this	
  case	
  for	
  copying	
  the	
  Master	
  Boot	
  Sector:

                            dd	
  if=/dev/hda	
  of=disk.mbr	
  count=1	
  bs=512

                            It	
  copies	
  1	
  chunk	
  of	
  512	
  bytes	
  which	
  is	
  the	
  amount	
  of	
  info	
  that	
  the	
  MBR	
  of	
  the	
  disk	
  takes.

                            and	
  for	
  restoring	
  the	
  MBR:
                            dd	
  if=disk.mbr	
  of=/dev/hda

                            It	
  overwrites	
  the	
  first	
  512	
  bytes	
  of	
  your	
  /dev/hda	
  drive.

                            Just	
  another	
  command	
  that	
  I	
  use	
  to	
  do	
  a€erwards	
  for	
  saving	
  the	
  parCCons:

                            sfdisk	
  -­‐d	
  /dev/hda	
  >	
  disk.sf
                            It	
  dumps	
  the	
  parCCons	
  of	
  the	
  /dev/hda	
  disk	
  to	
  a	
  text	
  file,	
  which	
  you’ll	
  be	
  able	
  to	
  recover	
  easily.
                            sfdisk	
  /dev/hda	
  <	
  disk.sf

                            Bye

               10	
  Sathish	
  Kumar	
  November	
  28,	
  2010	
  at	
  1:58	
  am

                            Thanks	
  a	
  lot…..

               11	
  Anonymous	
  April	
  9,	
  2011	
  at	
  4:15	
  pm

                            mistake	
  with	
  the	
  device	
  names	
  here:




4	
  of	
  8                                                                                                                                                                                                              18	
  Apr	
  12	
  7:06	
  pm
6	
  Examples	
  to	
  Backup	
  Linux	
  Using	
  dd	
  Command	
  (Including	
  Disk	
  ...                                      hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/


                          In	
  this	
  dd	
  command	
  example,	
  the	
  UNIX	
  device	
  name	
  of	
  the	
  source	
  hard	
  disk	
  is	
  /dev/hda,	
  and	
  device	
  name	
  of	
  the	
  target	
  hard
                          disk	
  is	
  /dev/hdb.

                          #	
  dd	
  if=/dev/sda	
  of=/dev/sdb

               12	
  Anonymous	
  June	
  23,	
  2011	
  at	
  12:55	
  am

                          Be	
  VERY	
  VERY	
  careful	
  about	
  the	
  source	
  and	
  desCnaCons,	
  if=	
  and	
  of=

                          If	
  you	
  make	
  a	
  mistake	
  and	
  put	
  the	
  wrong	
  source/desCnaCon	
  as	
  if/of,	
  you	
  WILL	
  lose	
  your	
  data	
  and	
  recovery	
  becomes	
  very
                          annoying.	
  Possible,	
  but	
  annoying,	
  such	
  as	
  losing	
  all	
  your	
  filenames	
  and	
  filesizes.

               13	
  ƒeƒ	
  November	
  19,	
  2011	
  at	
  9:35	
  am

                          delete	
  MBR

                          dd	
  if=/dev/zero	
  of=/dev/sda	
  bs=512	
  count=1

               14	
  Antonio	
  Nogueira	
  February	
  27,	
  2012	
  at	
  9:21	
  am

                          Despite	
  that	
  is	
  a	
  comment	
  about	
  to	
  use	
  dd	
  command	
  to	
  backup	
  (and	
  restore)	
  dual	
  boot	
  parCCons	
  with	
  Windows	
  and	
  Linux
                          inside	
  (I	
  didn’t	
  see	
  any	
  repply	
  about	
  it),	
  may	
  I	
  use	
  dd	
  command	
  to	
  backup	
  a	
  HD	
  with	
  one	
  ParCCon	
  only	
  containning	
  a	
  windows
                          system	
  64bit	
  and	
  a€er	
  to	
  create	
  two	
  parCCons,	
  restore	
  the	
  windows	
  operaConal	
  system	
  on	
  the	
  first	
  parCCon	
  of	
  the	
  HD?

               Leave	
  a	
  Comment

                                                                                              Name


                                                                                              E-­‐mail


                                                                                              Website




                     	
  NoCfy	
  me	
  of	
  followup	
  comments	
  via	
  e-­‐mail

                  Submit

               Previous	
  post:	
  PostgreSQL	
  Trigger	
  Tutorial	
  with	
  EMP	
  Table	
  Examples

               Next	
  post:	
  6	
  Expect	
  Script	
  Examples	
  to	
  Expect	
  the	
  Unexpected	
  (With	
  Hello	
  World)

                          Sign	
  up	
  for	
  our	
  free	
  email	
  newsleWer	
   you@address.com                                             	
  	
  	
  	
  	
     Sign Up


                                                     	
  	
  	
  	
  	
     	
  RSS	
     	
  TwiWer	
     	
  Facebook



                                                                                                                          	
     Search



5	
  of	
  8                                                                                                                                                                                                 18	
  Apr	
  12	
  7:06	
  pm
6	
  Examples	
  to	
  Backup	
  Linux	
  Using	
  dd	
  Command	
  (Including	
  Disk	
  ...                          hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/


                         EBOOKS




                         POPULAR	
  POSTS

                                   12	
  Amazing	
  and	
  EssenCal	
  Linux	
  Books	
  To	
  Enrich	
  Your	
  Brain	
  and	
  Library
                                   50	
  UNIX	
  /	
  Linux	
  Sysadmin	
  Tutorials
                                   50	
  Most	
  Frequently	
  Used	
  UNIX	
  /	
  Linux	
  Commands	
  (With	
  Examples)
                                   How	
  To	
  Be	
  ProducCve	
  and	
  Get	
  Things	
  Done	
  Using	
  GTD
                                   30	
  Things	
  To	
  Do	
  When	
  you	
  are	
  Bored	
  and	
  have	
  a	
  Computer



6	
  of	
  8                                                                                                                                                    18	
  Apr	
  12	
  7:06	
  pm
6	
  Examples	
  to	
  Backup	
  Linux	
  Using	
  dd	
  Command	
  (Including	
  Disk	
  ...                                 hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/


                                     Linux	
  Directory	
  Structure	
  (File	
  System	
  Structure)	
  Explained	
  with	
  Examples
                                     Linux	
  Crontab:	
  15	
  Awesome	
  Cron	
  Job	
  Examples
                                     Get	
  a	
  Grip	
  on	
  the	
  Grep!	
  –	
  15	
  PracCcal	
  Grep	
  Command	
  Examples
                                     Unix	
  LS	
  Command:	
  15	
  PracCcal	
  Examples
                                     15	
  Examples	
  To	
  Master	
  Linux	
  Command	
  Line	
  History
                                     Top	
  10	
  Open	
  Source	
  Bug	
  Tracking	
  System
                                     Vi	
  and	
  Vim	
  Macro	
  Tutorial:	
  How	
  To	
  Record	
  and	
  Play
                                     Mommy,	
  I	
  found	
  it!	
  -­‐-­‐	
  15	
  PracCcal	
  Linux	
  Find	
  Command	
  Examples
                                     15	
  Awesome	
  Gmail	
  Tips	
  and	
  Tricks
                                     15	
  Awesome	
  Google	
  Search	
  Tips	
  and	
  Tricks
                                     RAID	
  0,	
  RAID	
  1,	
  RAID	
  5,	
  RAID	
  10	
  Explained	
  with	
  Diagrams
                                     Can	
  You	
  Top	
  This?	
  15	
  PracCcal	
  Linux	
  Top	
  Command	
  Examples
                                     Top	
  5	
  Best	
  System	
  Monitoring	
  Tools
                                     Top	
  5	
  Best	
  Linux	
  OS	
  DistribuCons
                                     How	
  To	
  Monitor	
  Remote	
  Linux	
  Host	
  using	
  Nagios	
  3.0
                                     Awk	
  IntroducCon	
  Tutorial	
  –	
  7	
  Awk	
  Print	
  Examples
                                     How	
  to	
  Backup	
  Linux?	
  15	
  rsync	
  Command	
  Examples
                                     The	
  UlCmate	
  Wget	
  Download	
  Guide	
  With	
  15	
  Awesome	
  Examples
                                     Top	
  5	
  Best	
  Linux	
  Text	
  Editors
                                     Packet	
  Analyzer:	
  15	
  TCPDUMP	
  Command	
  Examples
                                     The	
  UlCmate	
  Bash	
  Array	
  Tutorial	
  with	
  15	
  Examples
                                     3	
  Steps	
  to	
  Perform	
  SSH	
  Login	
  Without	
  Password	
  Using	
  ssh-­‐keygen	
  &	
  ssh-­‐copy-­‐id
                                     Unix	
  Sed	
  Tutorial:	
  Advanced	
  Sed	
  SubsCtuCon	
  Examples
                                     UNIX	
  /	
  Linux:	
  10	
  Netstat	
  Command	
  Examples
                                     The	
  UlCmate	
  Guide	
  for	
  CreaCng	
  Strong	
  Passwords
                                     6	
  Steps	
  to	
  Secure	
  Your	
  Home	
  Wireless	
  Network
                                     Turbocharge	
  PuTTY	
  with	
  12	
  Powerful	
  Add-­‐Ons

                         About	
  The	
  Geek	
  Stuff




                                                 	
  My	
  name	
  is	
  Ramesh	
  Natarajan.	
  I	
  will	
  be	
  posCng	
  instrucCon	
  guides,	
  how-­‐to,	
  troubleshooCng	
  Cps	
  and	
  tricks
                         on	
  Linux,	
  database,	
  hardware,	
  security	
  and	
  web.	
  My	
  focus	
  is	
  to	
  write	
  arCcles	
  that	
  will	
  either	
  teach	
  you	
  or	
  help	
  you	
  resolve	
  a
                         problem.	
  Read	
  more	
  about	
  Ramesh	
  Natarajan	
  and	
  the	
  blog.

                         Support	
  Us


                         Support	
  this	
  blog	
  by	
  purchasing	
  one	
  of	
  my	
  ebooks.

                         Bash	
  101	
  Hacks	
  eBook

                         Sed	
  and	
  Awk	
  101	
  Hacks	
  eBook

                         Vim	
  101	
  Hacks	
  eBook

                         Nagios	
  Core	
  3	
  eBook

                         Contact	
  Us


7	
  of	
  8                                                                                                                                                                                                18	
  Apr	
  12	
  7:06	
  pm
6	
  Examples	
  to	
  Backup	
  Linux	
  Using	
  dd	
  Command	
  (Including	
  Disk	
  ...                                hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/



                          Email	
  Me	
  :	
  Use	
  this	
  Contact	
  Form	
  to	
  get	
  in	
  touch	
  me	
  with	
  your	
  comments,	
  quesCons	
  or	
  suggesCons	
  about	
  this	
  site.	
  You	
  can
                          also	
  simply	
  drop	
  me	
  a	
  line	
  to	
  say	
  hello!.

                          Follow	
  us	
  on	
  TwiWer

                          Become	
  a	
  fan	
  on	
  Facebook	
  	
  

               Copyright	
  ©	
  2008–2012	
  Ramesh	
  Natarajan.	
  All	
  rights	
  reserved	
  |	
  Terms	
  of	
  Service	
  |	
  AdverCse




8	
  of	
  8                                                                                                                                                                                              18	
  Apr	
  12	
  7:06	
  pm

More Related Content

What's hot

Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)
Bud Siddhisena
 
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISORLOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
Vanika Kapoor
 
S4 xen hypervisor_20080622
S4 xen hypervisor_20080622S4 xen hypervisor_20080622
S4 xen hypervisor_20080622Todd Deshane
 
Creating a new virtual machine
Creating a new virtual machineCreating a new virtual machine
Creating a new virtual machinejhonmariocasas
 
Linux Disaster Recovery Best Practices with rear
Linux Disaster Recovery Best Practices with rearLinux Disaster Recovery Best Practices with rear
Linux Disaster Recovery Best Practices with rear
Gratien D'haese
 
Oracle VM3: Virtuelle Maschinen per Script erstellen
Oracle VM3: Virtuelle Maschinen per Script erstellenOracle VM3: Virtuelle Maschinen per Script erstellen
Oracle VM3: Virtuelle Maschinen per Script erstellen
Trivadis
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-adminbadamisri
 
Asiabsdcon14
Asiabsdcon14Asiabsdcon14
Asiabsdcon14
Dru Lavigne
 
Iscsi
IscsiIscsi
Iscsi
Md Shihab
 
Ilf2013
Ilf2013Ilf2013
Ilf2013
Dru Lavigne
 
LinuxTag2012 Rear
LinuxTag2012 RearLinuxTag2012 Rear
LinuxTag2012 Rear
Gratien D'haese
 
Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014
Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014
Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014
Circling Cycle
 
Cfg2html fosdem2014
Cfg2html fosdem2014Cfg2html fosdem2014
Cfg2html fosdem2014
Gratien D'haese
 
Linux Recovery
Linux RecoveryLinux Recovery
Linux Recovery
Víctor Capetillo
 
LINUX Admin Quick Reference
LINUX Admin Quick ReferenceLINUX Admin Quick Reference
LINUX Admin Quick Referencewensheng wei
 
Defragmentation
DefragmentationDefragmentation
Defragmentation
Rohit Rajput
 
Creating a new virtual machine
Creating a new virtual machineCreating a new virtual machine
Creating a new virtual machinejhonmariocasas
 
Defragmentation.46
Defragmentation.46Defragmentation.46
Defragmentation.46myrajendra
 
SystemV vs systemd
SystemV vs systemdSystemV vs systemd
SystemV vs systemd
All Things Open
 

What's hot (20)

Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)
 
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISORLOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
 
S4 xen hypervisor_20080622
S4 xen hypervisor_20080622S4 xen hypervisor_20080622
S4 xen hypervisor_20080622
 
Creating a new virtual machine
Creating a new virtual machineCreating a new virtual machine
Creating a new virtual machine
 
Linux Disaster Recovery Best Practices with rear
Linux Disaster Recovery Best Practices with rearLinux Disaster Recovery Best Practices with rear
Linux Disaster Recovery Best Practices with rear
 
Lvm advanced topics
Lvm advanced topicsLvm advanced topics
Lvm advanced topics
 
Oracle VM3: Virtuelle Maschinen per Script erstellen
Oracle VM3: Virtuelle Maschinen per Script erstellenOracle VM3: Virtuelle Maschinen per Script erstellen
Oracle VM3: Virtuelle Maschinen per Script erstellen
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-admin
 
Asiabsdcon14
Asiabsdcon14Asiabsdcon14
Asiabsdcon14
 
Iscsi
IscsiIscsi
Iscsi
 
Ilf2013
Ilf2013Ilf2013
Ilf2013
 
LinuxTag2012 Rear
LinuxTag2012 RearLinuxTag2012 Rear
LinuxTag2012 Rear
 
Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014
Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014
Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014
 
Cfg2html fosdem2014
Cfg2html fosdem2014Cfg2html fosdem2014
Cfg2html fosdem2014
 
Linux Recovery
Linux RecoveryLinux Recovery
Linux Recovery
 
LINUX Admin Quick Reference
LINUX Admin Quick ReferenceLINUX Admin Quick Reference
LINUX Admin Quick Reference
 
Defragmentation
DefragmentationDefragmentation
Defragmentation
 
Creating a new virtual machine
Creating a new virtual machineCreating a new virtual machine
Creating a new virtual machine
 
Defragmentation.46
Defragmentation.46Defragmentation.46
Defragmentation.46
 
SystemV vs systemd
SystemV vs systemdSystemV vs systemd
SystemV vs systemd
 

Viewers also liked

7 linux fdisk command examples to manage hard disk partition
7 linux fdisk command examples to manage hard disk partition7 linux fdisk command examples to manage hard disk partition
7 linux fdisk command examples to manage hard disk partitionchinkshady
 
Principles of Management – Chpt 17 : Controlling
Principles of Management – Chpt 17 : ControllingPrinciples of Management – Chpt 17 : Controlling
Mis ppt
Mis pptMis ppt
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
kalyanineve
 
Management information system
Management information systemManagement information system
Management information system
Sikander Saini
 
Management Information System (MIS)
Management Information System (MIS)Management Information System (MIS)
Management Information System (MIS)
Navneet Jingar
 

Viewers also liked (7)

7 linux fdisk command examples to manage hard disk partition
7 linux fdisk command examples to manage hard disk partition7 linux fdisk command examples to manage hard disk partition
7 linux fdisk command examples to manage hard disk partition
 
Principles of Management – Chpt 17 : Controlling
Principles of Management – Chpt 17 : ControllingPrinciples of Management – Chpt 17 : Controlling
Principles of Management – Chpt 17 : Controlling
 
Mis ppt
Mis pptMis ppt
Mis ppt
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
Transportation ppt
Transportation pptTransportation ppt
Transportation ppt
 
Management information system
Management information systemManagement information system
Management information system
 
Management Information System (MIS)
Management Information System (MIS)Management Information System (MIS)
Management Information System (MIS)
 

Similar to 6 examples to backup linux using dd command (including disk to disk)

codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
Carlo Bonamico
 
MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)
Masami Hiramatsu
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Codemotion
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Christophe Muller
 
Docker and the Container Revolution
Docker and the Container RevolutionDocker and the Container Revolution
Docker and the Container Revolution
Romain Dorgueil
 
How Secure Is Your Container? ContainerCon Berlin 2016
How Secure Is Your Container? ContainerCon Berlin 2016How Secure Is Your Container? ContainerCon Berlin 2016
How Secure Is Your Container? ContainerCon Berlin 2016
Phil Estes
 
Perspectives on Docker
Perspectives on DockerPerspectives on Docker
Perspectives on Docker
RightScale
 
Docker 101
Docker 101Docker 101
Docker 101
schmidtbt
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
Henryk Konsek
 
Docker dDessi november 2015
Docker dDessi november 2015Docker dDessi november 2015
Docker dDessi november 2015
Massimiliano Dessì
 
Introduction to Codespaces
Introduction to CodespacesIntroduction to Codespaces
Introduction to Codespaces
DinaEsmaeili
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
RightScale
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
dotCloud
 
FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016
Muhammad Moinur Rahman
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbies
Yigal Elefant
 
Linux containers & Devops
Linux containers & DevopsLinux containers & Devops
Linux containers & Devops
Maciej Lasyk
 
Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and ContainersDocker, Inc.
 
Cd rom mounting cdro-ms on solaris
Cd rom mounting cdro-ms on solarisCd rom mounting cdro-ms on solaris
Cd rom mounting cdro-ms on solarisBui Van Cuong
 
Introducing Docker
Introducing DockerIntroducing Docker
Introducing Docker
Francesco Pantano
 
drbd9_and_drbdmanage_may_2015
drbd9_and_drbdmanage_may_2015drbd9_and_drbdmanage_may_2015
drbd9_and_drbdmanage_may_2015Alexandre Huynh
 

Similar to 6 examples to backup linux using dd command (including disk to disk) (20)

codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 
MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker and the Container Revolution
Docker and the Container RevolutionDocker and the Container Revolution
Docker and the Container Revolution
 
How Secure Is Your Container? ContainerCon Berlin 2016
How Secure Is Your Container? ContainerCon Berlin 2016How Secure Is Your Container? ContainerCon Berlin 2016
How Secure Is Your Container? ContainerCon Berlin 2016
 
Perspectives on Docker
Perspectives on DockerPerspectives on Docker
Perspectives on Docker
 
Docker 101
Docker 101Docker 101
Docker 101
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
 
Docker dDessi november 2015
Docker dDessi november 2015Docker dDessi november 2015
Docker dDessi november 2015
 
Introduction to Codespaces
Introduction to CodespacesIntroduction to Codespaces
Introduction to Codespaces
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
 
FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbies
 
Linux containers & Devops
Linux containers & DevopsLinux containers & Devops
Linux containers & Devops
 
Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and Containers
 
Cd rom mounting cdro-ms on solaris
Cd rom mounting cdro-ms on solarisCd rom mounting cdro-ms on solaris
Cd rom mounting cdro-ms on solaris
 
Introducing Docker
Introducing DockerIntroducing Docker
Introducing Docker
 
drbd9_and_drbdmanage_may_2015
drbd9_and_drbdmanage_may_2015drbd9_and_drbdmanage_may_2015
drbd9_and_drbdmanage_may_2015
 

More from chinkshady

25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules examples25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules exampleschinkshady
 
15 practical grep command examples in linux : unix
15 practical grep command examples in linux : unix15 practical grep command examples in linux : unix
15 practical grep command examples in linux : unixchinkshady
 
10 useful sar (sysstat) examples for unix : linux performance monitoring
10 useful sar (sysstat) examples for unix : linux performance monitoring10 useful sar (sysstat) examples for unix : linux performance monitoring
10 useful sar (sysstat) examples for unix : linux performance monitoringchinkshady
 
10 awesome examples for viewing huge log files in unix
10 awesome examples for viewing huge log files in unix10 awesome examples for viewing huge log files in unix
10 awesome examples for viewing huge log files in unixchinkshady
 
9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linuxchinkshady
 
7 strace examples to debug the execution of a program in linux
7 strace examples to debug the execution of a program in linux7 strace examples to debug the execution of a program in linux
7 strace examples to debug the execution of a program in linuxchinkshady
 
4 effective methods to disable se linux temporarily or permanently
4 effective methods to disable se linux temporarily or permanently4 effective methods to disable se linux temporarily or permanently
4 effective methods to disable se linux temporarily or permanentlychinkshady
 
36 items to capture for practical hardware asset tracking
36 items to capture for practical hardware asset tracking36 items to capture for practical hardware asset tracking
36 items to capture for practical hardware asset trackingchinkshady
 

More from chinkshady (8)

25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules examples25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules examples
 
15 practical grep command examples in linux : unix
15 practical grep command examples in linux : unix15 practical grep command examples in linux : unix
15 practical grep command examples in linux : unix
 
10 useful sar (sysstat) examples for unix : linux performance monitoring
10 useful sar (sysstat) examples for unix : linux performance monitoring10 useful sar (sysstat) examples for unix : linux performance monitoring
10 useful sar (sysstat) examples for unix : linux performance monitoring
 
10 awesome examples for viewing huge log files in unix
10 awesome examples for viewing huge log files in unix10 awesome examples for viewing huge log files in unix
10 awesome examples for viewing huge log files in unix
 
9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux
 
7 strace examples to debug the execution of a program in linux
7 strace examples to debug the execution of a program in linux7 strace examples to debug the execution of a program in linux
7 strace examples to debug the execution of a program in linux
 
4 effective methods to disable se linux temporarily or permanently
4 effective methods to disable se linux temporarily or permanently4 effective methods to disable se linux temporarily or permanently
4 effective methods to disable se linux temporarily or permanently
 
36 items to capture for practical hardware asset tracking
36 items to capture for practical hardware asset tracking36 items to capture for practical hardware asset tracking
36 items to capture for practical hardware asset tracking
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 

6 examples to backup linux using dd command (including disk to disk)

  • 1. 6  Examples  to  Backup  Linux  Using  dd  Command  (Including  Disk  ... hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/ Home About Free  eBook Archives Best  of  the  Blog Contact 6  Examples  to  Backup  Linux  Using  dd  Command  (Including  Disk  to Disk) by  Sasikala  on  October  11,  2010 0 Like 11 Tweet 41 Data  loss  will  be  costly.  At  the  very  least,  criCcal  data  loss  will  have  a  financial  impact  on companies  of  all  sizes.  In  some  cases,  it  can  cost  your  job.  I’ve  seen  cases  where  sysadmins  learned  this  in  the  hard  way. There  are  several  ways  to  backup  a  Linux  system,  including  rsync  and  rsnapshot  that  we  discussed  a  while  back. This  arCcle  provides  6  pracCcal  examples  on  using  dd  command  to  backup  the  Linux  system.  dd  is  a  powerful  UNIX  uClity,  which  is  used by  the  Linux  kernel  makefiles  to  make  boot  images.  It  can  also  be  used  to  copy  data.  Only  superuser  can  execute  dd  command. Warning:  While  using  dd  command,  if  you  are  not  careful,  and  if  you  don’t  know  what  you  are  doing,  you  will  lose  your  data! Example  1.  Backup  En>re  Harddisk To  backup  an  enCre  copy  of  a  hard  disk  to  another  hard  disk  connected  to  the  same  system,  execute  the  dd  command  as  shown  below. 1  of  8 18  Apr  12  7:06  pm
  • 2. 6  Examples  to  Backup  Linux  Using  dd  Command  (Including  Disk  ... hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/ In  this  dd  command  example,  the  UNIX  device  name  of  the  source  hard  disk  is  /dev/hda,  and  device  name  of  the  target  hard  disk  is /dev/hdb. # dd if=/dev/sda of=/dev/sdb “if”  represents  inpu_ile,  and  “of”  represents  output  file.  So  the  exact  copy  of  /dev/sda  will  be  available  in  /dev/sdb. If  there  are  any  errors,  the  above  command  will  fail.  If  you  give  the  parameter  “conv=noerror”  then  it  will  conCnue  to  copy  if there  are  read  errors. Input  file  and  output  file  should  be  menConed  very  carefully,  if  you  menCon  source  device  in  the  target  and  vice  versa,  you might  loss  all  your  data. In  the  copy  of  hard  drive  to  hard  drive  using  dd  command  given  below,  sync  opCon  allows  you  to  copy  everything  using  synchronized I/O. # dd if=/dev/sda of=/dev/sdb conv=noerror,sync Example  2.  Create  an  Image  of  a  Hard  Disk Instead  of  taking  a  backup  of  the  hard  disk,  you  can  create  an  image  file  of  the  hard  disk  and  save  it  in  other  storage  devices.There  are many  advantages  to  backing  up  your  data  to  a  disk  image,  one  being  the  ease  of  use.  This  method  is  typically  faster  than  other  types  of backups,  enabling  you  to  quickly  restore  data  following  an  unexpected  catastrophe. # dd if=/dev/hda of=~/hdadisk.img The  above  creates  the  image  of  a  harddisk  /dev/hda.  Refer  our  earlier  arCcle  How  to  view  initrd.image  for  more  details. Example  3.  Restore  using  Hard  Disk  Image To  restore  a  hard  disk  with  the  image  file  of  an  another  hard  disk,  use  the  following  dd  command  example. # dd if=hdadisk.img of=/dev/hdb The  image  file  hdadisk.img  file,  is  the  image  of  a  /dev/hda,  so  the  above  command  will  restore  the  image  of  /dev/hda  to  /dev/hdb. Example  4.  Crea>ng  a  Floppy  Image Using  dd  command,  you  can  create  a  copy  of  the  floppy  image  very  quickly.  In  input  file,  give  the  floppy  device  locaCon,  and  in  the output  file,  give  the  name  of  your  floppy  image  file  as  shown  below. # dd if=/dev/fd0 of=myfloppy.img Example  5.  Backup  a  Par>>on You  can  use  the  device  name  of  a  parCCon  in  the  input  file,  and  in  the  output  either  you  can  specify  your  target  path  or  image  file  as shown  in  the  dd  command  example  below. # dd if=/dev/hda1 of=~/partition1.img Example  6.  CDROM  Backup dd  command  allows  you  to  create  an  iso  file  from  a  source  file.  So  we  can  insert  the  CD  and  enter  dd  command  to  create  an  iso  file  of  a CD  content. # dd if=/dev/cdrom of=tgsservice.iso bs=2048 dd  command  reads  one  block  of  input  and  process  it  and  writes  it  into  an  output  file.  You  can  specify  the  block  size  for  input  and output  file.  In  the  above  dd  command  example,  the  parameter  “bs”  specifies  the  block  size  for  the  both  the  input  and  output  file.  So dd  uses  2048bytes  as  a  block  size  in  the  above  command. 2  of  8 18  Apr  12  7:06  pm
  • 3. 6  Examples  to  Backup  Linux  Using  dd  Command  (Including  Disk  ... hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/ Note:  If  CD  is  auto  mounted,  before  creaCng  an  iso  image  using  dd  command,  its  always  good  if  you  unmount  the  CD  device  to  avoid any  unnecessary  access  to  the  CD  ROM. 0 Tweet 41 Like 11  Share  Comment If  you  enjoyed  this  ar>cle,  you  might  also  like.. 1. 50  Linux  Sysadmin  Tutorials Awk  IntroducCon  –  7  Awk  Print  Examples 2. 50  Most  Frequently  Used  Linux  Commands  (With  Examples) Advanced  Sed  SubsCtuCon  Examples 3. Top  25  Best  Linux  Performance  Monitoring  and  Debugging 8  EssenCal  Vim  Editor  NavigaCon  Fundamentals Tools 25  Most  Frequently  Used  Linux  IPTables  Rules 4. Mommy,  I  found  it!  –  15  PracCcal  Linux  Find  Command Examples Examples Turbocharge  PuTTY  with  12  Powerful  Add-­‐Ons 5. Linux  101  Hacks  2nd  EdiCon  eBook   {  14  comments…  read  them  below  or  add  one  } 1  pupu  October  11,  2010  at  4:31  am I  recommend  using  ‘dd’  on  unmounted/readonly  devices  only.  You  never  know  what  changes  in  the  middle  of  this  kind  of backup.  Dd  doesn’t  lock  your  filesystem.  It  will  read  and  write  blindly  and  if  you  don’t  know  what  you  are  doing,  well… 2  rene  October  11,  2010  at  6:49  am Will  this  work  with  a  hard  drive  with  both  Windows  and Linux  on  it? 3  Jorge  Cedi  October  11,  2010  at  11:53  am You  can  backup  a  usb  key  with  dd 4  ciastek  October  12,  2010  at  5:46  pm Thanks  for  nice  examples. When  and  why  should  i  use  synchronized  I/O? How  should  i  find  opCmal  block  size? 5  Bernardo  October  13,  2010  at  12:18  pm 3  of  8 18  Apr  12  7:06  pm
  • 4. 6  Examples  to  Backup  Linux  Using  dd  Command  (Including  Disk  ... hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/ Nice  examples, I  would  like  to  share  one  of  many  hacks  to  know  the  “status”  of  dd  copy  progress. Send  the  dd  command  to  background i.e. #  dd=if=/dev/sda  of=backup.img  & [1]  26431  <——–  Process  ID Check  the  process  ID  and  run  the  next  command: #  kill  -­‐SIGUSR1  26431 This  will  shows  the  copied  bytes  and  the  copy  rate. 6  MaCas  October  14,  2010  at  7:05  am Hello! It’s  a  really  useful  post,  but  I  think  it  should  be  noted  that  dd  is  used  just  to  copy  files,  and  not  to  make  backups,  because  a backup  tool  has  a  lot  more  funcConality,  like  different  backup  levels,  automaCon  of  backups  and  some  kind  of  database  storing related  data  (files  saved,  operator  who  run  the  backup,  etc). Bye! 7  Paul  A.  October  20,  2010  at  2:54  pm This  is  not  very  much  related  to  dd,  but  I  thought  you’s  like  to  know  that  your  example  5  has  a  bash-­‐ism  that  I’m  not  enCrely sure  is  a  bug  or  a  feature.  Most  other  shells  won’t  expand  the  ~  to  $HOME  like  bash  does  for  that  parCcular  command.  Zsh  has an  opCon  MAGIC_EQUAL_SUBST  to  let  you  choose  either  way. 8  iri  October  26,  2010  at  12:34  am Regarding  example  5. what  if  ~  is  on  /dev/hda1   9  Cosmos  November  17,  2010  at  10:35  am Another  useful  Cp: In  this  case  for  copying  the  Master  Boot  Sector: dd  if=/dev/hda  of=disk.mbr  count=1  bs=512 It  copies  1  chunk  of  512  bytes  which  is  the  amount  of  info  that  the  MBR  of  the  disk  takes. and  for  restoring  the  MBR: dd  if=disk.mbr  of=/dev/hda It  overwrites  the  first  512  bytes  of  your  /dev/hda  drive. Just  another  command  that  I  use  to  do  a€erwards  for  saving  the  parCCons: sfdisk  -­‐d  /dev/hda  >  disk.sf It  dumps  the  parCCons  of  the  /dev/hda  disk  to  a  text  file,  which  you’ll  be  able  to  recover  easily. sfdisk  /dev/hda  <  disk.sf Bye 10  Sathish  Kumar  November  28,  2010  at  1:58  am Thanks  a  lot….. 11  Anonymous  April  9,  2011  at  4:15  pm mistake  with  the  device  names  here: 4  of  8 18  Apr  12  7:06  pm
  • 5. 6  Examples  to  Backup  Linux  Using  dd  Command  (Including  Disk  ... hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/ In  this  dd  command  example,  the  UNIX  device  name  of  the  source  hard  disk  is  /dev/hda,  and  device  name  of  the  target  hard disk  is  /dev/hdb. #  dd  if=/dev/sda  of=/dev/sdb 12  Anonymous  June  23,  2011  at  12:55  am Be  VERY  VERY  careful  about  the  source  and  desCnaCons,  if=  and  of= If  you  make  a  mistake  and  put  the  wrong  source/desCnaCon  as  if/of,  you  WILL  lose  your  data  and  recovery  becomes  very annoying.  Possible,  but  annoying,  such  as  losing  all  your  filenames  and  filesizes. 13  ƒeƒ  November  19,  2011  at  9:35  am delete  MBR dd  if=/dev/zero  of=/dev/sda  bs=512  count=1 14  Antonio  Nogueira  February  27,  2012  at  9:21  am Despite  that  is  a  comment  about  to  use  dd  command  to  backup  (and  restore)  dual  boot  parCCons  with  Windows  and  Linux inside  (I  didn’t  see  any  repply  about  it),  may  I  use  dd  command  to  backup  a  HD  with  one  ParCCon  only  containning  a  windows system  64bit  and  a€er  to  create  two  parCCons,  restore  the  windows  operaConal  system  on  the  first  parCCon  of  the  HD? Leave  a  Comment Name E-­‐mail Website  NoCfy  me  of  followup  comments  via  e-­‐mail Submit Previous  post:  PostgreSQL  Trigger  Tutorial  with  EMP  Table  Examples Next  post:  6  Expect  Script  Examples  to  Expect  the  Unexpected  (With  Hello  World) Sign  up  for  our  free  email  newsleWer   you@address.com           Sign Up            RSS    TwiWer    Facebook   Search 5  of  8 18  Apr  12  7:06  pm
  • 6. 6  Examples  to  Backup  Linux  Using  dd  Command  (Including  Disk  ... hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/ EBOOKS POPULAR  POSTS 12  Amazing  and  EssenCal  Linux  Books  To  Enrich  Your  Brain  and  Library 50  UNIX  /  Linux  Sysadmin  Tutorials 50  Most  Frequently  Used  UNIX  /  Linux  Commands  (With  Examples) How  To  Be  ProducCve  and  Get  Things  Done  Using  GTD 30  Things  To  Do  When  you  are  Bored  and  have  a  Computer 6  of  8 18  Apr  12  7:06  pm
  • 7. 6  Examples  to  Backup  Linux  Using  dd  Command  (Including  Disk  ... hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/ Linux  Directory  Structure  (File  System  Structure)  Explained  with  Examples Linux  Crontab:  15  Awesome  Cron  Job  Examples Get  a  Grip  on  the  Grep!  –  15  PracCcal  Grep  Command  Examples Unix  LS  Command:  15  PracCcal  Examples 15  Examples  To  Master  Linux  Command  Line  History Top  10  Open  Source  Bug  Tracking  System Vi  and  Vim  Macro  Tutorial:  How  To  Record  and  Play Mommy,  I  found  it!  -­‐-­‐  15  PracCcal  Linux  Find  Command  Examples 15  Awesome  Gmail  Tips  and  Tricks 15  Awesome  Google  Search  Tips  and  Tricks RAID  0,  RAID  1,  RAID  5,  RAID  10  Explained  with  Diagrams Can  You  Top  This?  15  PracCcal  Linux  Top  Command  Examples Top  5  Best  System  Monitoring  Tools Top  5  Best  Linux  OS  DistribuCons How  To  Monitor  Remote  Linux  Host  using  Nagios  3.0 Awk  IntroducCon  Tutorial  –  7  Awk  Print  Examples How  to  Backup  Linux?  15  rsync  Command  Examples The  UlCmate  Wget  Download  Guide  With  15  Awesome  Examples Top  5  Best  Linux  Text  Editors Packet  Analyzer:  15  TCPDUMP  Command  Examples The  UlCmate  Bash  Array  Tutorial  with  15  Examples 3  Steps  to  Perform  SSH  Login  Without  Password  Using  ssh-­‐keygen  &  ssh-­‐copy-­‐id Unix  Sed  Tutorial:  Advanced  Sed  SubsCtuCon  Examples UNIX  /  Linux:  10  Netstat  Command  Examples The  UlCmate  Guide  for  CreaCng  Strong  Passwords 6  Steps  to  Secure  Your  Home  Wireless  Network Turbocharge  PuTTY  with  12  Powerful  Add-­‐Ons About  The  Geek  Stuff  My  name  is  Ramesh  Natarajan.  I  will  be  posCng  instrucCon  guides,  how-­‐to,  troubleshooCng  Cps  and  tricks on  Linux,  database,  hardware,  security  and  web.  My  focus  is  to  write  arCcles  that  will  either  teach  you  or  help  you  resolve  a problem.  Read  more  about  Ramesh  Natarajan  and  the  blog. Support  Us Support  this  blog  by  purchasing  one  of  my  ebooks. Bash  101  Hacks  eBook Sed  and  Awk  101  Hacks  eBook Vim  101  Hacks  eBook Nagios  Core  3  eBook Contact  Us 7  of  8 18  Apr  12  7:06  pm
  • 8. 6  Examples  to  Backup  Linux  Using  dd  Command  (Including  Disk  ... hWp://www.thegeekstuff.com/2010/10/dd-­‐command-­‐examples/ Email  Me  :  Use  this  Contact  Form  to  get  in  touch  me  with  your  comments,  quesCons  or  suggesCons  about  this  site.  You  can also  simply  drop  me  a  line  to  say  hello!. Follow  us  on  TwiWer Become  a  fan  on  Facebook     Copyright  ©  2008–2012  Ramesh  Natarajan.  All  rights  reserved  |  Terms  of  Service  |  AdverCse 8  of  8 18  Apr  12  7:06  pm