XsY /mnt/usb` command (replace diskxsy with your usb drive’s device name and partition number). this will create a new directory called “usb” in your home folder and mount the selected partition to it.
4. copy the linux iso file into the mounted directory using `cp ~/downloads/linux-iso /mnt/usb` command (replace linux-iso with the name of your downloaded iso file). this will transfer the contents of the iso file to the usb drive’s partition.
5. unmount the partition by running `sudo umount /dev/diskXsY && sudo rmdir /mnt/usb` command (replace diskxsy with your usb drive’s device name and partition number). this will remove the mounted directory from your system and free up its resources.
6. finally, create a bootable usb drive using `sudo dd if=linux-iso of=/dev/diskX bs=4M && sync` command (replace linux-iso with the name of your downloaded iso file). this will copy the contents of the iso file to the selected partition and make it bootable.
7. eject the usb drive by running `sudo diskutil unmount /dev/diskXsY && sudo rm -rf /mnt/usb` command (replace diskxsy with your usb drive’s device name and partition number). this will safely remove the usb drive from your system and delete its mounted directory.
Alright, let me break it down for you in simpler terms:
1. Insert your USB drive into your computer and find out which one is being used for bootable purposes using `lsblk` command. This will show you all the connected devices with their respective names and sizes. 2. Use `sudo diskutil list` to identify which partition on your USB drive has an “ef” or “fat32” file system type, as this is what we need for a bootable USB drive. 3. Mount that partition using `sudo mkdir /mnt/usb && sudo mount -t msdos /dev/diskXsY /mnt/usb` command (replace diskxsy with your USB drive’s device name and partition number). This will create a new directory called “usb” in your home folder and mount the selected partition to it. 4. Copy the Linux ISO file into that mounted directory using `cp ~/downloads/linux-iso /mnt/usb` command (replace linux-iso with the name of your downloaded ISO file). This will transfer the contents of the ISO file to the USB drive’s partition. 5. Unmount the partition by running `sudo umount /dev/diskXsY && sudo rmdir /mnt/usb` command (replace diskxsy with your USB drive’s device name and partition number). This will remove the mounted directory from your system and free up its resources. 6. Create a bootable USB drive using `sudo dd if=linux-iso of=/dev/diskX bs=4M && sync` command (replace linux-iso with the name of your downloaded ISO file). This will copy the contents of the ISO file to the selected partition and make it bootable. 7. Eject the USB drive by running `sudo diskutil unmount /dev/diskXsY && sudo rm -rf /mnt/usb` command (replace diskxsy with your USB drive’s device name and partition number). This will safely remove the USB drive from your system and delete its mounted directory. And that’s it! You now have a bootable USB drive for Linux using dd tool on macOS terminal.