• Linux设置开机自动挂载镜像文件


    1.将文件上传到服务器上(本例上传到/Data/software下)

    2.挂载

    mount -o loop /Data/software/rhel-server-7.6-x86_64-dvd.iso /mnt

    3.使用df -T查看镜像文件格式(一般都是iso9660)

    [root@zabbix_test ~]# df -T
    Filesystem            Type     1K-blocks    Used Available Use% Mounted on
    /dev/mapper/rhel-root xfs       52403200 1054636  51348564   3% /
    devtmpfs              devtmpfs   4074828       0   4074828   0% /dev
    tmpfs                 tmpfs      4086896       0   4086896   0% /dev/shm
    tmpfs                 tmpfs      4086896    8740   4078156   1% /run
    tmpfs                 tmpfs      4086896       0   4086896   0% /sys/fs/cgroup
    /dev/sda1             xfs         508580  128008    380572  26% /boot
    /dev/mapper/rhel-Data xfs       43498752 4424928  39073824  11% /Data
    tmpfs                 tmpfs       817380       0    817380   0% /run/user/0
    /dev/loop0            iso9660    4391278 4391278         0 100% /mnt

    4.编辑fstab文件

    [root@zabbix_test ~]# vi /etc/fstab 
    
    #
    # /etc/fstab
    # Created by anaconda on Tue Oct 27 10:35:21 2020
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    /dev/mapper/rhel-root   /                       xfs     defaults        0 0
    /dev/mapper/rhel-Data   /Data                   xfs     defaults        0 0
    UUID=4394cca8-82c3-4ee7-9cd7-c90a71fb65ef /boot                   xfs     defaults        0 0
    /dev/mapper/rhel-swap   swap                    swap    defaults        0 0
    /Data/software/rhel-server-7.6-x86_64-dvd.iso /mnt iso9660 loop,defaults 0 0

    5.下载/mnt

    umount /mnt

    6.使用mount -a测试是否OK

    [root@zabbix_test ~]# mount -a
    mount: /dev/loop0 is write-protected, mounting read-only
    [root@zabbix_test ~]# df -h
    Filesystem             Size  Used Avail Use% Mounted on
    /dev/mapper/rhel-root   50G  1.1G   49G   3% /
    devtmpfs               3.9G     0  3.9G   0% /dev
    tmpfs                  3.9G     0  3.9G   0% /dev/shm
    tmpfs                  3.9G  8.6M  3.9G   1% /run
    tmpfs                  3.9G     0  3.9G   0% /sys/fs/cgroup
    /dev/sda1              497M  126M  372M  26% /boot
    /dev/mapper/rhel-Data   42G  4.3G   38G  11% /Data
    tmpfs                  799M     0  799M   0% /run/user/0
    /dev/loop0             4.2G  4.2G     0 100% /mnt
  • 相关阅读:
    java传递String参数
    C++ string与int的互相转换
    java插入排序
    凸包Graham Scan算法实现
    求平面上N点最远两点和最近两点距离
    求最大公约数
    n个数连接得到最小或最大的多位整数(携程)
    Java快排
    背包问题
    二分查找离左边元素最近的(可以等于)
  • 原文地址:https://www.cnblogs.com/monkey6/p/13883722.html
Copyright © 2020-2023  润新知