๐Ÿ’ฌ ETC../๐Ÿ’ป macOS

[Mac] diskutil์„ ์ด์šฉํ•ด์„œ SD์นด๋“œ ๋ฐฑ์—…/๋ณต์›ํ•˜๊ธฐ

iseunghan 2022. 5. 1. 18:12
๋ฐ˜์‘ํ˜•

Disk list ํ™•์ธํ•˜๊ธฐ

  • ๋จผ์ € Terminal์„ ์—ด์–ด ์•„๋ž˜ ๋ช…๋ น์–ด๋กœ ๋””์Šคํฌ ์ด๋ฆ„์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
$ diskutil list

# ์•„๋ž˜๋Š” ์ถœ๋ ฅ ๊ฐ’
... ์ƒ๋žต

/dev/disk4 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *31.9 GB    disk4
   1:             Windows_FAT_32 boot                    268.4 MB   disk4s1
   2:                      Linux                         31.6 GB    disk4s2
  • (์˜ˆ์‹œ ์ด๋ฏธ์ง€)

์‚ฌ์šฉํ•˜๋˜ raspberry pi์˜ sd ์นด๋“œ๊ฐ€ /dev/disk4๋ผ๊ณ  ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

SD ์นด๋“œ ๋ฐฑ์—… ์ด๋ฏธ์ง€ ์ƒ์„ฑ

  • ๋จผ์ € ๋””์Šคํฌ๋ฅผ ์–ธ๋งˆ์šดํŠธ ์‹œํ‚ต๋‹ˆ๋‹ค.
$ diskutil unmountDisk /dev/disk4
Unmount of all volumes on disk4 was successful
  • ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•ด SD ์นด๋“œ๋ฅผ img ํŒŒ์ผ๋กœ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
    • if= ๋’ค์—๋Š” diskutil list๋กœ ํ™•์ธํ–ˆ๋˜ SD์นด๋“œ์˜ ์ด๋ฆ„์„ ์ ์–ด์ฃผ๊ณ 
    • of= ๋’ค์—๋Š” ์ƒ์„ฑํ•  ์ด๋ฏธ์ง€์˜ ๊ฒฝ๋กœ์™€ ์ด๋ฆ„์„ ์ ์–ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
$ sudo dd if=/dev/disk4 of=/Users/shlee/pi_sd_backup.img

# ์ €๋Š” of=~/pi_sd_backup.img๋Š” ์—๋Ÿฌ๋กœ ์ธํ•ด ์ ˆ๋Œ€๊ฒฝ๋กœ๋ฅผ ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค.

๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•˜๊ณ  ์•„๋ž˜ ์™„๋ฃŒ๊ฐ€ ๋ ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฌ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

  • ์™„๋ฃŒ ๊ฒฐ๊ณผ
$ sudo dd if=/dev/disk4 of=/Users/shlee/pi_sd_backup.img
62333952+0 records in
62333952+0 records out
31914983424 bytes transferred in 1467.675304 secs (21745262 bytes/sec)

SD ๋ฐฑ์—… ์ด๋ฏธ์ง€ ๋ณต์›

๋ฐฑ์—…ํ•  ๋•Œ์™€ ๊ฑฐ์˜ ๋™์ผํ•ฉ๋‹ˆ๋‹ค. ๋งˆ์ง€๋ง‰ ๋ช…๋ น์–ด์˜ ์œ„์น˜๋งŒ ๋ฐ”๊ฟ”์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

  • ๋ณต์›ํ•  ๋””์Šคํฌ๋ฅผ ์–ธ๋งˆ์šดํŠธ ์‹œํ‚ต๋‹ˆ๋‹ค.
$ diskutil unmountDisk /dev/disk4
Unmount of all volumes on disk4 was successful
  • ํŒŒ์ผ ์‹œ์Šคํ…œ : ExFAT
  • ํฌ๋งท ํ›„ ๋””์Šคํฌ ์ด๋ฆ„ : boot
  • ํฌ๋งท ํ•  ๋””์Šคํฌ : /dev/disk4
$ sudo diskutil eraseDisk ExFAT boot /dev/disk4
  • ๋ณต์›ํ•  ์ด๋ฏธ์ง€์™€ ๋””์Šคํฌ ์ด๋ฆ„์„ ๋ช…๋ น์–ด๋กœ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.
    • ๋ฐฑ์—…ํ•  ๋•Œ์™€ ๋‹ค๋ฅด๊ฒŒ if=, of= ๋ณ€์ˆ˜๋ฅผ ์„œ๋กœ ๋ฐ”๊ฟ”์„œ ์ง€์ •ํ•ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
$ sudo dd if=/Users/shlee/pi_sd_backup.img of=/dev/disk4

REFERENCE

Easily Format a SD Card in OSX to FAT32 - Michael Crump

๋ฐ˜์‘ํ˜•