Basic Linux commands with SD card

  • dd
    • use of the dd tool can overwrite any partition of your machine. If you specify the wrong device in the instruction, you could delete your primary Linux partition. Please be careful.
  •  df -h
    • to see which devices are currently mounted.
  •  dmesg | tail
    • display the most recent system messages, which should contain information on the naming of the SD card device. The naming of the device will follow the format described in the next paragraph. Note that if the SD card was not automounted, you do not need to unmount later.
  •  unmout /dev/sdx1
    • Run umount /dev/sdX1, replacing sdX1 with whatever your SD card's device name is, including the partition number.
  • Copying the image to the SD card

    • In a terminal window, write the image to the card with the command below, making sure you replace the input file if= argument with the path to your .img file, and the /dev/sdX in the output file of= argument with the correct device name. This is very important, as you will lose all the data on the hard drive if you provide the wrong device name. Make sure the device name is the name of the whole SD card as described above, not just a partition. For example: sdd, not sdds1 or sddp1, and mmcblk0, not mmcblk0p1.
      dd bs=4M if=2017-11-29-raspbian-stretch.img of=/dev/sdX conv=fsync
       
    • Please note that block size set to 4M will work most of the time. If not, try 1M, although this will take considerably longer.
    • Also note that if you are not logged in as root you will need to prefix this with sudo.

Comments

Popular posts from this blog

Arduino with Speakers Project #01 a

Speakers with Arduino

QUADRATURE ENCODER