Regardless of whether it is Linux or Unix-based macOS, you can use mount
the command to mount the disk to mount the disk.
General status of mounts:
- View disk status
- mount disk
- read and write disk
The last is to unmount the disk.
Similar to Windows, macOS generally mounts mobile storage automatically; some Linux distributions also mount mobile storage (especially those with a GUI interface).
This time, ignore all the GUI interface and see how to operate on the command. Finally, let's take a look at how to automatically mount or unmount (unmount) the disk after booting.
view disk
macOS
To view the disk insertion status on macOS, use the command:
diskutil list
The status after we plug in the U disk:
You can see that there is one disk4
more IDENTIFIER
. The physical interface plugged in is /dev/disk4
.
Linux
Linux disk view, generally use fdisk
the command:
fdisk -l
Plug in the U disk, check the end of the output, you can see our U disk device:
as you can see, my U disk has four partitions.
mount disk
Regardless of whether it is Linux or Unix-based macOS, you can use mount
the command to mount the disk to mount the disk. Mount according to the disk location viewed above:
mount [参数] [需要挂载的分区] [Linux上挂载点]
First we look at macOS:
where:
-t
: disk type-o
: Subsequentrw
,auto
andnobrowse
are all added parameters by this synchronization mode.
The final command is:
sudo mount -t exfat -o rw,auto,nobrowse /dev/disk4 Downloads/MintimateDisk
Mounting result:
Look at our Linux again, this disk is relatively simple:
unmount disk
Uninstallation is simple.
First, look at macOS:
umount Downloads/MintimateDisk
Similarly, uninstallation on Linux is also very simple:
sudo mount /mnt/upan
Boot mount/unmount
Finally, let's see how to automatically mount and unmount disks at startup.
The first is to uninstall, which is generally used in macOS.
On the Intel version of macOS, you can choose to install a dual system. If you have installed a dual system, you may automatically mount the Windows disk partition after booting:
Auto-mount content:
However, we cannot directly write to the Windows partition on macOS, and this is a bit dangerous. To this end, we can automatically uninstall after booting:
the operation is very simple, we write the uninstall command to /etc/fstab
.
First, we view the disk details:
diskutil list
After that, find the Windows partition and use diskutil info
the command to view the details:
diskutil info
Depending on the disk Volume UUID
, add to /etc/fstab
. In this way, macOS will be automatically uninstalled:
UUID=5EE51E74-0E37-42FE-AC22-38184A510981 none ntfs noauto
Similarly, for Linux devices, if you want to automatically mount the U disk. First look at the UUID:
sudo blkid
Afterwards, we add proceeding:
UUID=67E3-17ED /mnt/upan vfat defaults 0 0
However, Linux is more recommended to be configured in the startup service script:
Advantages:
- If the input command is wrong, the normal operation of the operating system will not be affected when Linux restarts