0

My intent:

i wanted to fill my external HDD (1TB) with zeros so i used:

dd if=/dev/zero | pv -t -e -r -a -b -s 930000000000 | dd of=/media/usb/clearAll ; rm /media/usb/clearAll ; shutdown -P 00

Explaining the command above:

After completely filling the HDD with zero I wanted to delete that file and after deleting that file i wanted to shutdown my laptop due the fact that it will take several hours and I need to sleep as well. Yeah i know, i did forget to unmount the external HDD before shutting down.

pv is just to monitor to progress of the file transfers.

The problem:

Everything worked fine for 2minutes then ubuntu was shutting down normally! After 2 minutes? Where just about 6-7GB where occupied.

So i did start my laptop again to take a closer look at the syslog getting following:

Mar 15 20:04:18 Mikes-Laptop kernel: [27033.291030] init: tty4 main process (1006) killed by TERM signal
Mar 15 20:04:18 Mikes-Laptop kernel: [27033.291240] init: tty5 main process (1010) killed by TERM signal
Mar 15 20:04:18 Mikes-Laptop kernel: [27033.291383] init: tty2 main process (1016) killed by TERM signal
Mar 15 20:04:18 Mikes-Laptop kernel: [27033.291525] init: tty3 main process (1017) killed by TERM signal
Mar 15 20:04:18 Mikes-Laptop kernel: [27033.291672] init: tty6 main process (1020) killed by TERM signal
Mar 15 20:04:18 Mikes-Laptop kernel: [27033.313817] init: irqbalance main process (1081) killed by TERM signal
Mar 15 20:04:18 Mikes-Laptop kernel: [27033.313957] init: cron main process (1083) killed by TERM signal
Mar 15 20:04:18 Mikes-Laptop kernel: [27033.314282] init: tty1 main process (1195) killed by TERM signal
Mar 15 20:04:18 Mikes-Laptop rsyslogd: [origin software="rsyslogd" swVersion="7.4.4" x-pid="747" x-info="http://www.rsyslog.com"] exiting on signal 15.

and also

Mar 15 20:06:36 Mikes-Laptop kernel: [   11.319099] EXT4-fs (sda5): re-mounted. Opts: errors=remount-ro

but i'm not sure if it is corresponding to the unexpected shutdown.

The question:

So can someone tell me what i did wrong? I thought every command after ; will be execute after the preceding one has finished.

Specs:

Ubuntu 14.04 LTS Seagate 1TB external HDD MSDOS FAT32 one Partition occupying the whole drive

0

I detected a error, if the filesystem is formatted in FAT32 or a similar file system that supports a maximum of 4GB per file and you tried to make a 1TB file on the HDD, the most probable fail is that when the file reached 4GB, the program stopped and the computer halted.

The correct command would be:

dd if=/dev/zero | pv -t -e -r -a -b -s 930000000000 | dd of="/dev/sdX"; shutdown -P 00

where the correct path may be /dev/sdb or /dev/sdc. You can find that letter in the "Disks" program of Ubuntu.

Warning: ENSURE THAT YOU ENTER THE CORRECT DEVICE, IT MAY PRODUCE A BIG DATA LOSS

  • Can i look that up in a specified log? Also, you mean my internal HDD was faulty and because of that mounted as read only forcing the system to reboot? Was it harmful? – Mike Mar 15 '15 at 19:52
  • You can look in /var/log/syslog for disk error messages. I'm not sure of your disk health, I can't say something absolute. I not said that the disk forced the system to reboot, I said that when the hdd seemed to fail, dd stopped and executed the last command. – Helio Mar 15 '15 at 20:02
  • Sorry, I failed, I don't read well your command. I edited my answer. – Helio Mar 15 '15 at 20:09
  • Yeah, i can't find anything with disk and error in syslog using: sudo cat /var/log/syslog | grep disk? – Mike Mar 15 '15 at 20:09
  • Ah ok, but i mounted the external HDD to /media/usb! Is this not allowed using data description (dd) ? – Mike Mar 15 '15 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.