ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Solved Dumb question - linux dd write 0s to multiples disks at once

    IT Discussion
    linux dd command line
    9
    38
    3.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DustinB3403D
      DustinB3403 @scottalanmiller
      last edited by

      @scottalanmiller said in Dumb question - linux dd write 0s to multiples disks at once:

      What is the result of this command..

      echo $0
      

      Not at the office, so I don't know

      1 Reply Last reply Reply Quote 0
      • black3dynamiteB
        black3dynamite
        last edited by

        https://unix.stackexchange.com/revisions/284489/1

        dd if=/dev/zero | tee >(dd of=/dev/sdb) >(dd of=/dev/sdc) | dd of=/dev/sdd
        
        1 Reply Last reply Reply Quote 0
        • ObsolesceO
          Obsolesce @DustinB3403
          last edited by

          @dustinb3403 said in Dumb question - linux dd write 0s to multiples disks at once:

          Is it possible to use linux DD to write 0's to multiple disks at once?

          The goal would be to wipe 4 drives at once.

          What if you create a SW RAID 10 with them quick, then write zeros?

          scottalanmillerS 1 Reply Last reply Reply Quote 1
          • A
            Alex Sage
            last edited by

            Does writing zeros to an SSD drive affect the drive life?

            scottalanmillerS 1 Reply Last reply Reply Quote 0
            • 1
              1337
              last edited by 1337

              No need to wipe all the disks. It's a waste of time.

              • If you wanted to erase the partition table you don't have to erase the whole disk. Just the first / last bytes of the drive. Or just remove it with fdisk or parted.
              • If you wanted to remove superblocks after an earlier md raid installation you wouldn't need to wipe the disk either. You do: mdadm --zero-superblock /dev/sdX

              You could also use wipefs -a /dev/sdX to remove just partition tables and raid signatures - if you have it installed.

              And as soon as you put together a raid-10 it will start synchronizing the disk and write the same zeros one more time.

              If you really, really wanted to wipe the drive so no residual data where on them, wipe just what is needed to make a raid-10 array out of it. Then wipe the array with zeros, as a block device. It will save a lot of time. As the synchronization process will write the zeros for you on the other drives.

              1 Reply Last reply Reply Quote 3
              • scottalanmillerS
                scottalanmiller @Obsolesce
                last edited by

                @obsolesce said in Dumb question - linux dd write 0s to multiples disks at once:

                @dustinb3403 said in Dumb question - linux dd write 0s to multiples disks at once:

                Is it possible to use linux DD to write 0's to multiple disks at once?

                The goal would be to wipe 4 drives at once.

                What if you create a SW RAID 10 with them quick, then write zeros?

                That would be faster. Or RAID 1. Any RAID, actually.

                1 Reply Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller @Alex Sage
                  last edited by

                  @aaronstuder said in Dumb question - linux dd write 0s to multiples disks at once:

                  Does writing zeros to an SSD drive affect the drive life?

                  No, shouldn't affect anything unless you are trying to obfuscate the old data

                  1 Reply Last reply Reply Quote 0
                  • M
                    manxam
                    last edited by manxam

                    "screen" is available within the bootable USB.
                    screen dd if=/dev/zero of=/dev/sda1 bs=1M
                    Ctrl-A then D to detach
                    Up arrow then enter 3 more times...

                    This will continue to run even if the console is lost (ssh) or if the user logs out
                    screen -R to re-attach a session if you want to check the status

                    Having said that:
                    dd if=/dev/zero of=/dev/sda bs=512 count=1 conv=notrunc
                    Should take only seconds and delete the partition table and is less work than using fdisk in the event that wipefs isn't available on the bootable USB.

                    1 Reply Last reply Reply Quote 2
                    • travisdh1T
                      travisdh1 @scottalanmiller
                      last edited by

                      @scottalanmiller said in Dumb question - linux dd write 0s to multiples disks at once:

                      @travisdh1 said in Dumb question - linux dd write 0s to multiples disks at once:

                      dd if=/dev/zero of=/dev/sdb bs=4k

                      nohup dd if=/dev/zero of=/dev/sdb bs=4k &
                      nohup dd if=/dev/zero of=/dev/sdc bs=4k &
                      nohup dd if=/dev/zero of=/dev/sdd bs=4k &
                      

                      Like that 🙂

                      Dang it, I'm always mixing those up.

                      1 Reply Last reply Reply Quote 0
                      • stacksofplatesS
                        stacksofplates @scottalanmiller
                        last edited by

                        @scottalanmiller said in Dumb question - linux dd write 0s to multiples disks at once:

                        @travisdh1 said in Dumb question - linux dd write 0s to multiples disks at once:

                        dd if=/dev/zero of=/dev/sdb bs=4k

                        nohup dd if=/dev/zero of=/dev/sdb bs=4k &
                        nohup dd if=/dev/zero of=/dev/sdc bs=4k &
                        nohup dd if=/dev/zero of=/dev/sdd bs=4k &
                        

                        Like that 🙂

                        And if you're set on a one-liner like before:

                        for i in {b..d}; do nohup dd if=/dev/zero of=/dev/sd$i bs=4k &; done
                        
                        1 Reply Last reply Reply Quote 3
                        • stacksofplatesS
                          stacksofplates
                          last edited by stacksofplates

                          Another way would be to use make. Just create a makefile with:

                          all: disk1 disk2 disk3 
                          
                          .PHONY: disk1
                          disk1:
                              dd if=/dev/zero of=/dev/sdb bs=4k
                          
                          .PHONY: disk2
                          disk2:
                              dd if=/dev/zero of=dev/sdc bs=4k
                          
                          .PHONY: disk3
                          disk3:
                              dd if=/dev/zero of=/dev/sdd bs=4k
                          

                          Then just run make -j and it will run all of the targets in parallel. If you want them to loop then just don't give the -j flag.

                          M 1 Reply Last reply Reply Quote 2
                          • M
                            manxam @stacksofplates
                            last edited by

                            @stacksofplates : Now you're just showing off 🙂

                            stacksofplatesS 1 Reply Last reply Reply Quote 2
                            • stacksofplatesS
                              stacksofplates @manxam
                              last edited by

                              @manxam said in Dumb question - linux dd write 0s to multiples disks at once:

                              @stacksofplates : Now you're just showing off 🙂

                              Ha I didn't mean for it to look like that, but you did make me realize I made a mistake so I'll have to fix it. Make has a lot of uses outside of jsut building software. It's a pretty awesome utility.

                              1 Reply Last reply Reply Quote 0
                              • 1
                              • 2
                              • 2 / 2
                              • First post
                                Last post