• 85730

    文章

  • 749

    评论

  • 18

    友链

  • 最近新加了换肤功能,大家多来逛逛吧~~~~
  • 喜欢这个网站的朋友可以加一下QQ群,我们一起交流技术。

Copying an operating system image to an SD card using Mac OS

撸了今年阿里、腾讯和美团的面试,我有一个重要发现.......>>

First,verify the path to your SD card.You can do this by runing the following command from terminal:

diskutil list

In this case i can verify /dev/disk2 is my SD card because the TYPE,NAME and Size values are correct.

IF you have an existing partiton on the disk you may need to unmount it,otherwise you'will get a ''Resource Busy" error message when you try to write the image .

diskutil unmount /dev/disk2s1

Now to write the image file to the disk. Note the 'r' added to rdisk2 which drastically improves write performance by telling dd to operate in raw disk mode:

sudo dd if=2019-09-26-raspbian-buster.img of=/dev/rdisk2 bs=1m

Depending on the size of your SDcard this may take a while. You can press CTRL+T to see the current status of dd. 

Copy the image

  • From Terminal, enter:

    sudo dd bs=1m if=path_of_your_image.img of=/dev/rdiskN conv=sync

    Replace N with the number that you noted before.

    This can take more than 15 minutes, depending on the image file size. Check the progress by pressing Ctrl+T.

    If the command reports dd: bs: illegal numeric value, change the block size bs=1m to bs=1M.

    If the command reports dd: /dev/rdisk2: Operation not permitted you need to disable SIP before continuing.

    If the command reports the error dd: /dev/rdisk3: Permission denied, the partition table of the SD card is being protected against being overwritten by Mac OS. Erase the SD card's partition table using this command:

    sudo diskutil partitionDisk /dev/diskN 1 MBR "Free Space" "%noformat%" 100%

    That command will also set the permissions on the device to allow writing. Now issue the dd command again.

After the dd command finishes, eject the card:

sudo diskutil eject /dev/rdiskN

695856371Web网页设计师②群 | 喜欢本站的朋友可以收藏本站,或者加入我们大家一起来交流技术!

欢迎来到梁钟霖个人博客网站。本个人博客网站提供最新的站长新闻,各种互联网资讯。 还提供个人博客模板,最新最全的java教程,java面试题。在此我将尽我最大所能将此个人博客网站做的最好! 谢谢大家,愿大家一起进步!

转载原创文章请注明出处,转载至: 梁钟霖个人博客www.liangzl.com

0条评论

Loading...


发表评论

电子邮件地址不会被公开。 必填项已用*标注

自定义皮肤
注册梁钟霖个人博客