Linux8 永久挂载本地yum源
更新时间: 2022-03-16 16:48
首先确定本地有os包,确定位置,然后使用sftp方式传输进linux,
sftp> cd linux文件
sftp> lcd windows文件
put os.ios
挂载操作如下:
[root@dbserver os]# ll
total 10465280
-rw-r--r--. 1 root root 10716446720 Feb 25 14:46 Rocky-8.5-x86_64-dvd1.iso
[root@dbserver os]# pwd
/u01/setup/os
[root@dbserver os]# mount -o loop /u01/setup/os/Rocky-8.5-x86_64-dvd1.iso /mnt
mount: /mnt: /u01/setup/os/Rocky-8.5-x86_64-dvd1.iso is already mounted.
[root@dbserver os]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 1.8G 0 1.8G 0% /dev
tmpfs tmpfs 1.9G 637M 1.2G 35% /dev/shm
tmpfs tmpfs 1.9G 9.7M 1.9G 1% /run
tmpfs tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/mapper/rootvg-root xfs 90G 5.2G 85G 6% /
/dev/sdb1 xfs 120G 33G 88G 28% /u01
/dev/loop0 iso9660 10G 10G 0 100% /mnt
/dev/sda1 xfs 1014M 256M 759M 26% /boot
tmpfs tmpfs 371M 12K 371M 1% /run/user/42
tmpfs tmpfs 371M 0 371M 0% /run/user/0
[root@dbserver os]# echo "/u01/setup/os/Rocky-8.5-x86_64-dvd1.iso /mnt iso9660 defaults,loop 0 0">>/etc/fstab
[root@dbserver os]# mount -a
[root@dbserver os]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sat Feb 26 10:27:34 2022
#
# 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.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/rootvg-root / xfs defaults 0 0
UUID=e29d04f2-88a6-4138-b0d7-cbf81f0e91be /boot xfs defaults 0 0
/dev/mapper/rootvg-swap none swap defaults 0 0
/dev/sdb1 /u01 xfs defaults 0 0
/u01/setup/os/Rocky-8.5-x86_64-dvd1.iso /mnt iso9660 defaults,loop 0 0