Author Topic: ทำการสร้าง boot os และ write iso to usb on mac os ^^  (Read 4356 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
ทำการสร้าง boot os และ write iso to usb on mac os ^^
« on: ธันวาคม 16, 2015, 09:44:47 PM »
วันนี้มีทริปในการทำ .iso file ซึ่งเป็นพวก os installer ครับ ให้ใส่ใน usb drive สามารถไป boot ได้เลย
อุปกรณ์เราก็คือ MBA (Mac Book Air)
Command ที่ใช้เชค disk ก่อนเลยครับ #diskutil list

sh-3.2# diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:          Apple_CoreStorage                         120.5 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.1 MB   disk0s3
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS Macintosh HD           *120.1 GB   disk1
                                 Logical Volume on disk0s2
                                 7E814A02-8B23-4749-B6B7-D333FE0440E0
                                 Unlocked Encrypted
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *2.1 GB     disk2
   1:                 DOS_FAT_32 ^^                      2.1 GB     disk2s1

##ตัว USB drive ที่เราจะให้ใช้งานคือ disk2s1 นะครับ อย่าใส่ผิดตัวละ ดูให้ดีๆด้วยไม่งั้น อาจจะ boot mac ไม่ติดอีกเลย ฮ่าๆๆ !!

ทำการ unmount ออกก่อนครับผม
#sudo umount /dev/disk2s1

##Example command
sudo dd if=/path/image.iso of=/dev/r(IDENTIFIER) bs=1m

จากตัวอย่างเราจะทำการ burn file Ubuntu ISO ที่ชื่อ ‘Ubuntu.iso’ อยู่บนหน้า desktop คำสั่งที่ใช้ก็คือ dd นั่นเอง และทำการเพิ่ม r ลงไปเพื่อให้เป็น bootable flag และ ทำให้การเขียนเร็วขึ้นครับ
ถ้าพร้อมแล้วก็ตั้งสติก่อนรัน เชคความเรียบร้อยอีก 1 รอบครับ
#sudo dd if=~/Desktop/Ubuntu.iso of=/dev/rdisk2s1 bs=1m

หลังจากเสร็จแล้วก็ทำการ unmount ออกครับ
#diskutil eject /dev/disk2s1

The ‘r’ prefixing the identifier signifies the raw data under the visible file system,
which is necessary to make the output volume bootable.
It’s also faster because it’s block aligned IO. Basically, rdisk goes directly to the disk, disk goes through the fileystem.