https://www.cnblogs.com/sztom/p/10184766.html 1. 直接从cd压制iso文件: dd if=/dev/cdrom of=file.iso bs=1M 2. 要把某个文件或者目录压到iso文件中: mkisofs -r -o file.iso your_folder_name/ 3. 加载iso mount -t iso9660 -o loop xxx.iso /path 4. 移除光盘 umount /mnt/cdrom
可以看到以下都是可以启动的iso镜像文件, 倒数第二个字段是卷标lable. $ file admincd-amd64-20200520T135827Z.iso admincd-amd64-20200520T135827Z.iso: ISO 9660 CD-ROM filesystem data (DOS/MBR boot sector) 'Gentoo amd64 AdminCD 20200520T13' (bootable) $ file linuxmint-20-xfce-64bit.iso linuxmint-20-xfce-64bit.iso: ISO 9660 CD-ROM filesystem data (DOS/MBR boot sector) 'Linux Mint 20 Xfce 64-bit' (bootable) $ file manjaro-xfce-20.0.3-200606-linux56.iso manjaro-xfce-20.0.3-200606-linux56.iso: ISO 9660 CD-ROM filesystem data (DOS/MBR boot sector) 'MANJARO_XFCE_2003' (bootable)
https://wiki.archlinux.org/index.php/File_systems#Mount_a_file_system
$ sudo mount admincd-amd64-20200520T135827Z.iso /mnt/sc1/ mount: /mnt/sc1: WARNING: device write-protected, mounted read-only. $ sudo mount admincd-amd64-20200520T135827Z.iso /mnt/sc1 -o loop mount: /mnt/sc1: WARNING: device write-protected, mounted read-only. $ sudo umount /mnt/sc1 https://wiki.archlinux.org/index.php/USB_storage_devices#Mounting_USB_memory
$ sudo mount device_node /mnt/usbstick or $ sudo mount -U UUID /mnt/usbstick
$ sudo mount -o gid=users,fmask=113,dmask=002 /dev/sda1 /mnt/usbstick 作为具有fstab的普通用户 https://wiki.archlinux.org/index.php/QEMU#Mounting_a_partition_from_a_raw_image ... mount包含几个选项,其中许多取决于指定的文件系统。可以通过以下方式更改选项:
在命令行上使用mount标志编辑fstab https://wiki.archlinux.org/index.php/Fstab创建udev规则 https://wiki.archlinux.org/index.php/Udev自己编译内核 https://wiki.archlinux.org/index.php/Arch_Build_System或使用特定于文件系统的安装脚本(位于/usr/bin/mount.*)。提示:文件系统也可以使用systemd-mount代替mount来装载。如果未指定安装点,则文件系统将在处安装。这样可以轻松地挂载文件系统,而不必决定将文件挂载在何处。有关用法和更多详细信息,请参见systemd-mount(1)。/run/media/system/device_identifier/ https://jlk.fjfi.cvut.cz/arch/manpages/man/systemd-mount.1
$ findmnt
Options: (mount & umount)
$ mount --helpmount [-lhV] $ umount --helpumount [-hV]Mount a filesystem.mount -a [options] Unmount filesystems.umount -a [options]Usage:mount [options] [--source] <source> | [--target] <directory> Usage:umount [options] <source> | <directory> mount [options] <source> <directory> mount <operation> <mountpoint> [<target>] $ mount --helpOptions: $ umount --help选项:-c, --no-canonicalizedon't canonicalize paths相同的选项-c, --no-canonicalize不要规范化路径-n, --no-mtabdon't write to /etc/mtab-n, --no-mtab不要写到/ etc/mtab-O, --test-opts <list>limit the set of filesystems (use with -a)-O, --test-opts <list>限制文件系统集(与-a一起使用)-t, --types <list>limit the set of filesystem types-t, --types <list>限制文件系统类型集-v, --verbosesay what is being done-v, --verbose说出正在做什么-h, --helpdisplay this help-h, --help显示此帮助-V, --versiondisplay version-V, --version显示版本-a, --allmount all filesystems mentioned in fstab挂载fstab中提到的所有文件系统相反或相近选项-a, --allunmount all filesystems卸载所有文件系统-i, --internal-onlydon't call the mount.<type> helpers不要调用安装。<type>助手-i, --internal-onlydon't call the umount.<type> helpers不要调用umount。<type>助手-N, --namespace <ns>perform mount in another namespace在另一个名称空间中执行挂载-N, --namespace <ns>perform umount in another namespace在另一个名称空间中执行umount-r, --read-onlymount the filesystem read-only (same as -o ro)挂载文件系统为只读(与-o ro相同)-r, --read-onlyin case unmounting fails, try to remount read-only万一卸载失败,请尝试以只读方式重新安装-f, --fakedry run; skip the mount(2) syscall空转跳过mount(2)syscall--fakedry run; skip the umount(2) syscall空转跳过umount(2)syscall-F, --fork || fork off for each device (use with -a) || 为每个设备分叉(与-a一起使用)-T, --fstab <path> || alternative file to /etc/fstab || /etc/fstab的替代文件-l, --show-labels || show also filesystem labels || 同时显示文件系统标签--options-mode <mode> || what to do with options loaded from fstab || 从fstab加载的选项怎么办--options-source <source> || mount options source || 挂载选项源--options-source-force || force use of options from fstab/mtab || 强制使用fstab/mtab中的选项-o, --options <list> || comma-separated list of mount options || 逗号分隔的安装选项列表--source <src> || explicitly specifies source (path, label, uuid) || 明确指定来源 (path, label, uuid)--target <target> || explicitly specifies mountpoint || 明确指定安装点--target-prefix <path> || specifies path use for all mountpoints || 指定所有安装点的路径使用-w, --rw, --read-write || mount the filesystem read-write (default) || 以读写方式挂载文件系统(默认)不同的选项-A, --all-targets || unmount all mountpoints for the given device in the current namespace || 卸载当前名称空间中给定设备的所有安装点-d, --detach-loop || if mounted loop device, also free this loop device || 如果安装了回路设备,请同时释放此回路设备-f, --force || force unmount (in case of an unreachable NFS system) || 强制卸载(如果无法访问NFS系统)-l, --lazy || detach the filesystem now, clean up things later || 立即分离文件系统,稍后再清理-R, --recursive || recursively unmount a target with all its children || 以其所有子代递归卸载目标-q, --quiet || suppress 'not mounted' error messages || 禁止显示“未安装”错误消息mount: (Source, Operations)
$ mount --helpSource:资源:-L, --label <label>synonym for LABEL=<label>LABEL = <label>的同义词-U, --uuid <uuid>synonym for UUID=<uuid>UUID = <uuid>的同义词LABEL=<label>specifies device by filesystem label通过文件系统标签指定设备UUID=<uuid>specifies device by filesystem UUID通过文件系统UUID指定设备PARTLABEL=<label>specifies device by partition label通过分区标签指定设备PARTUUID=<uuid>specifies device by partition UUID通过分区UUID指定设备<device>specifies device by path按路径指定设备<directory>mountpoint for bind mounts (see --bind/rbind)绑定安装的安装点(请参阅--bind/rbind)<file>regular file for loopdev setup用于loopdev设置的常规文件 Operations:操作方式:-B, --bindmount a subtree somewhere else (same as -o bind)在其他地方安装子树(与-o bind相同)-M, --movemove a subtree to some other place将子树移到其他地方-R, --rbindmount a subtree and all submounts somewhere else安装一个子树,所有子安装在别处--make-sharedmark a subtree as shared将子树标记为共享--make-slavemark a subtree as slave将子树标记为从属--make-privatemark a subtree as private将子树标记为私有--make-unbindablemark a subtree as unbindable将子树标记为不可绑定--make-rsharedrecursively mark a whole subtree as shared递归地将整个子树标记为共享--make-rslaverecursively mark a whole subtree as slave递归地将整个子树标记为slave--make-rprivaterecursively mark a whole subtree as private递归地将整个子树标记为私有--make-runbindablerecursively mark a whole subtree as unbindable递归地将整个子树标记为不可绑定FILES: (mount & umount)
/etc/fstabfilesystem table文件系统表/etc/mtabtable of mounted filesystems (deprecated and usually replaced by symlink to /proc/mounts)已挂载文件系统表(已弃用,通常由/proc/mounts的符号链接代替)mount FILES /run/mountlibmount private runtime directorylibmount私有运行时目录/etc/mtabtable of mounted filesystems or symlink to /proc/mounts挂载文件系统表或/ proc/mounts的符号链接/etc/mtab~lock file (unused on systems with mtab symlink)锁定文件(在具有mtab symlink的系统上未使用)/etc/mtab.tmptemporary file (unused on systems with mtab symlink)临时文件(在具有mtab symlink的系统上未使用)/etc/filesystemsa list of filesystem types to try尝试的文件系统类型列表umount FILES /proc/self/mountinfotable of mounted filesystems generated by kernel.内核生成的已挂载文件系统表。udisks2: Disk Management Service, version 2 https://wiki.gentoo.org/wiki/Udisks 过时的文章... https://wiki.gentoo.org/wiki/Category:Outdated_articles udisks是提供存储相关服务的D-Bus守护程序。提供的服务包括:枚举存储设备,类似于udev,但有更多详细信息; 挂载文件系统; 存储设备分区; 监视存储设备; 存储设备的配置。 https://wiki.archlinux.org/index.php/Udisks udisks提供了一个守护程序udisksd,该守护程序实现了用于查询和操作存储设备的D-Bus接口,还提供了一个命令行工具udisksctl,用于查询和使用该守护程序。 udisksd(8)由 D-Bus按需启动,因此不应显式启用。可以使用 udisksctl(1)通过命令行进行控制。 Polkit限制了用户可以使用udisk执行的操作。如果未激活或不存在用户会话(例如,当从systemd / User服务控制udisk时),请相应地调整Polkit规则。
有关组的通用udisk权限,请参见: https://github.com/coldfix/udiskie/wiki/Permissions有关限制性更强的示例storage,请参见: https://gist.github.com/grawity/3886114#file-udisks2-allow-mount-internal-js如果您正在使用Dolphin,则可能会看到: https://gist.github.com/Scrumplex/8f528c1f63b5f4bfabe14b0804adaba7https://wiki.archlinux.org/index.php/Dolphin Dolphin是KDE的默认文件管理器。有关视频游戏机模拟器,请参阅Dolphin emulator 。$ udisksctl mount -b /dev/sdc1 $ udisksctl unmount -b /dev/sdc1
$ udisksctl loop-setup -r -f image.iso 这将创建一个循环设备,并显示准备安装的ISO映像。卸载后,循环设备将由udev终止。 挂载到/run/media/用户/目录下, 以卷标为文件夹名称: /run/media/toma/Gentoo amd64 20200520T135827Z/ /run/media/toma/MANJARO_XFCE_2003/
如果希望防止某些分区或驱动器出现在桌面上,则可以创建udev规则,例如/etc/udev/rules.d/10-local.rules: KERNEL=="sda1", ENV{UDISKS_IGNORE}="1" KERNEL=="sda2", ENV{UDISKS_IGNORE}="1" 因为块设备名称可以在重新引导之间更改,所以也可以使用UUID(从执行blkid /dev/sdX命令收集到的)来隐藏分区或整个设备: # blkid /dev/sdX /dev/sdX: LABEL="Filesystem Label" UUID="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX" UUID_SUB="YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY" TYPE="btrfs" 然后可以使用以下行: SUBSYSTEM=="block", ENV{ID_FS_UUID}=="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX", ENV{UDISKS_IGNORE}="1"
默认情况下,Udisks2对用户隐藏某些设备。如果这是不想要的或其他问题,复制/usr/lib/udev/rules.d/80-udisks2.rules到/etc/udev/rules.d/80-udisks2.rules并删除复制以下部分: # Devices which should not be display in the user interface [...]
$ sudo pacman -Fl udisks2 |grep bin udisks2 usr/bin/udisksctl udisks2 usr/bin/umount.udisks2 $ udisksctl help
$ udisksctl helpUsage: udisksctl COMMAND Use "udisksctl COMMAND --help" to get help on each command. Commands: helpShows this information显示此信息dumpShows information about all objects显示有关所有对象的信息statusShows high-level status(disk and block devices)显示高级状态 (disk and block devices)monitorMonitor changes to objects监视对象的更改infoShows information (object, device, drive)显示信息 (object, device, drive)mountMount a filesystem挂载文件系统unmountUnmount a filesystem卸载文件系统unlockUnlock an encrypted device解锁加密设备lockLock an encrypted device锁定加密的设备loop-setupSet-up a loop device设置回路设备loop-deleteDelete a loop device删除循环设备power-offSafely power off a drive安全关闭驱动器电源smart-simulateSet SMART data for a drive设置驱动器的SMART数据$ udisksctl COMMAND --help
-p, 对象,路径–object-path-b, 块设备–block-device--no-user-interaction主项目各自选项Y objectY blockYmount-o, --optionsMount options挂载选项-t, --filesystem-typeFilesystem type to use要使用的文件系统类型Y objectY blockYunmount-f, --forceForce/lazy unmount强制/延迟卸载Y objectY blockYunlock--key-fileKeyfile for unlocking解锁密钥文件--read-onlyUnlock the device as read-only将设备解锁为只读Y objectY blockYlock Yloop-setup-o, --offsetStart at <num> bytes into file从<num>个字节开始到文件-f, --fileFile to set-up a loop device for用于设置回路设备的文件-r, --read-onlySetup read-only device设置只读设备-s, --sizeLimit size to <num> bytes将大小限制为<num>个字节Y objectY DeviceYloop-delete Y objectY block info-d, --driveDrive to get information about获取驱动有关的信息Y PashY DeviceYpower-off Y PashY DeviceYsmart-simulate-f, --fileFile with libatasmart blob用libatasmart blob归档$ devmon --help
$ devmon --helpdevmon version 1.1.9 (distributed with udevil)devmon版本1.1.9(随udevil一起分发) Automounts and unmounts optical and removable drives自动挂载和卸下光盘驱动器和可移动驱动器Requires:udevil bash>=4udevil bash> = 4Also Recommended:eject spacefm|zenity弹出空间Optional:udisks v1 may be substituted for udeviludisks v1可以代替udevil If udevil is not set suid, udisks v1/v2 or pmount is required如果未将udevil设置为suid,则需要udisk v1 / v2或pmountUsage: devmon [AUTOMOUNT-OPTIONS]# Run as daemon to automount#作为守护程序运行以自动挂载devmon [MOUNT-OPTIONS]# Or run as client to manually un/mount#或以客户端身份运行以手动卸载/挂载 AUTOMOUNT-OPTIONS: (these can be used only in daemon mode)AUTOMOUNT-OPTIONS :(只能在守护程序模式下使用)--exec-on-device DEVICE "COMMAND"Execute COMMAND after mounting DEVICE挂载DEVICE后执行COMMAND--exec-on-label "LABEL" "COMMAND"Execute COMMAND after mounting LABEL安装标签后执行命令--exec-on-video "COMMAND"Execute COMMAND after video DVD mount装入视频DVD后执行命令--exec-on-audio "COMMAND"Execute COMMAND after audio CD insertion插入音频CD后执行命令--exec-on-disc "COMMAND"Execute COMMAND after data CD/DVD mount装入数据CD / DVD后执行COMMAND--exec-on-drive "COMMAND"Execute COMMAND after drive mount安装驱动器后执行命令--exec-on-unmount "COMMAND"Execute COMMAND after unmount卸载后执行命令--exec-on-remove "COMMAND"Execute COMMAND after drive removal卸下驱动器后执行命令 Where the following in COMMAND will be replaced with:COMMAND中的以下内容将替换为:%dmount point directory (eg /media/cd)挂载点目录(例如/ media / cd)