网络文件系统可以实现存储分离

1、windows文件共享

windows文件共享不做演示

2、如何在linux里访问windows文件共享?

[root@localhost ~]# dnf install samba-client -y 安装客户端 
[root@localhost ~]# smbclient  -L //172.25.254.94 -U administrator  windows用户为administrator  -L表示列出目标主机共享资源
[root@localhost ~]# smbclient  //172.25.254.94/westos -U administrator  访问共享目录

3、samba服务的安装及启用

linux共享文件系统的协议叫cifs
windows共享文件系统的协议叫smb
如何用linux将文件共享出去

[root@westos_storage ~]# dnf install samba  samba-common.noarch samba-client.x86_64 -y  在服务器上安装 服务主题,服务配置文件,客户端
[root@westos_storage ~]# systemctl enable --now smb.service  启动服务
Created symlink /etc/systemd/system/multi-user.target.wants/smb.service → /usr/lib/systemd/system/smb.service.
[root@westos_storage ~]# firewall-cmd --permanent --add-service=samba
success
[root@westos_storage ~]# firewall-cmd --reload 
success
[root@westos_storage ~]# smbclient -L //172.25.254.100  访问列出资源
Enter SAMBA\root's password:    因为没有设置密码直接回车
Anonymous login successfulSharename       Type      Comment---------       ----      -------print$          Disk      Printer DriversIPC$            IPC       IPC Service (Samba 4.11.2)
SMB1 disabled -- no workgroup available

4、smb账号的添加

[root@westos_storage ~]# smbpasswd -a westos  添加smb账号 ,-a表示添加, westos必须是在samb服务器真实存在的用户
New SMB password:   samb密码是独立的密码和系统用户westos密码无关
Retype new SMB password:   
Added user westos.
[root@westos_storage ~]# id lee  系统中lee用户不存在,需要添加lee用户,才能添加samb账号
id: ‘lee’: no such user
[root@westos_storage ~]# useradd -s /sbin/nologin lee -M  添加lee用户
[root@westos_storage ~]# smbpasswd -a lee  添加smb账号
New SMB password:
Retype new SMB password:
Added user lee.
[root@westos_storage ~]# pdbedit -L  查看samb用户列表
westos:1000:westos
lee:1001:
[root@westos_storage ~]# pdbedit -x lee  删除samb用户
[root@westos_storage ~]# pdbedit -L  
westos:1000:westos
[root@westos_storage ~]# smbclient -L //172.25.254.100 -U westos   samb用户的访问
Enter SAMBA\westos's password: Sharename       Type      Comment---------       ----      -------print$          Disk      Printer DriversIPC$            IPC       IPC Service (Samba 4.11.2)westos          Disk      Home Directories
SMB1 disabled -- no workgroup available
[root@westos_storage ~]# smbclient  //172.25.254.100/westos -U westos 访问samb用户里面的资源
Enter SAMBA\westos's password: 
Try "help" to get a list of possible commands.
smb: \> 

5.samba服务中对于selinux属性的调试

[root@westos_storage ~]# cd /etc/samba/  samb服务的配置目录
[root@westos_storage samba]# ls
lmhosts    smb.conf (主配置文件) smb.conf.example(配置文件模板)
[root@westos_storage samba]# cp -p smb.conf.example smb.conf  用配置文件模板将配置文件覆盖,重新生成配置文件
cp: overwrite 'smb.conf'? y问题:samb用户不能浏览自己的家目录,如何让samb用户浏览自己的家目录
[root@westos_storage samba]# smbclient -L //172.25.254.100 -U westos
Enter MYGROUP\westos's password: Sharename       Type      Comment---------       ----      -------IPC$            IPC       IPC Service (Samba Server Version 4.11.2)westos          Disk      Home Directories
SMB1 disabled -- no workgroup available
[root@westos_storage samba]# smbclient  //172.25.254.100/westos -U westos
Enter MYGROUP\westos's password: 
Try "help" to get a list of possible commands.
smb: \> ls
NT_STATUS_ACCESS_DENIED listing \*    报错,因为selinux影响,samb用户不能浏览自己的家目录[root@westos_storage samba]# setsebool -P samba_enable_home_dirs on  调整selinux 中smb的波尔直,使用户可以访问家目录
[root@westos_storage samba]# smbclient  //172.25.254.100/westos -U westos   调整完毕之后就samb用户可以访问自己家目录
Enter MYGROUP\westos's password: 
Try "help" to get a list of possible commands.
smb: \> ls.                                   D        0  Sat Aug 28 10:17:40 2021..                                  D        0  Sat Aug 28 10:15:07 2021.mozilla                           DH        0  Sat Aug 28 10:00:56 2021.bash_logout                        H       18  Fri Aug 30 13:30:21 2019.bash_profile                       H      141  Fri Aug 30 13:30:21 2019.bashrc                             H      312  Fri Aug 30 13:30:21 2019.config                            DH        0  Sat Aug 28 10:21:42 2021.esd_auth                           H       16  Sat Aug 28 10:17:36 2021.ICEauthority                       H      310  Sat Aug 28 10:17:37 2021.local                             DH        0  Sat Aug 28 10:17:37 2021.cache                             DH        0  Sat Aug 28 10:21:31 2021Desktop                             D        0  Sat Aug 28 10:17:40 2021Downloads                           D        0  Sat Aug 28 10:17:40 2021Templates                           D        0  Sat Aug 28 10:17:40 2021Public                              D        0  Sat Aug 28 10:17:40 2021Documents                           D        0  Sat Aug 28 10:17:40 2021Music                               D        0  Sat Aug 28 10:17:40 2021Pictures                            D        0  Sat Aug 28 10:17:40 2021Videos                              D        0  Sat Aug 28 10:17:40 2021.pki                               DH        0  Sat Aug 28 10:17:40 20217353344 blocks of size 1024. 2947592 blocks available

问题 :samb用户如何共享自己的目录?

[root@westos_storage samba]# mkdir /westos_share   建立文件
[root@westos_storage samba]# ls -ld /westos_share/   查看权限,对谁可写
drwxr-xr-x. 2 root root 6 Nov  3 11:19 /westos_share/
[root@westos_storage samba]# vim /etc/samba/smb.conf  编辑配置文件,在配置文件最后添加如下参数
314         [westos_share]  共享名词
315         comment = westos share  共享说明
316         path = /westos_share   指定共享的本机目录
[root@westos_storage samba]# systemctl restart smb.service  重启samb服务
[root@westos_storage samba]# smbclient -L //172.25.254.100 -U westos 访问
Enter MYGROUP\westos's password: Sharename       Type      Comment---------       ----      -------westos_share    Disk      westos share     共享目录已经出现IPC$            IPC       IPC Service (Samba Server Version 4.11.2)westos          Disk      Home Directories
SMB1 disabled -- no workgroup available
root@westos_storage samba]# touch /westos_share/westosfile{1..3} 在共享路径里建立三个共享目录
[root@westos_storage samba]# smbclient //172.25.254.100/westos_share -U westos   访问
Enter MYGROUP\westos's password: 
Try "help" to get a list of possible commands.
smb: \> ls
NT_STATUS_ACCESS_DENIED listing \*   报错,如何解决查看配置文件
[root@westos_storage samba]# vim /etc/samba/smb.conf

在这里插入图片描述

[root@westos_storage samba]# semanage fcontext -a -t samba_share_t '/westos_share(/.*)?'  修改安全上下文
[root@westos_storage samba]# restorecon -RvvF /westos_share/   刷新
[root@westos_storage samba]# smbclient //172.25.254.100/westos_share -U westos  访问
Enter MYGROUP\westos's password: 
Try "help" to get a list of possible commands.    里面的内容就可以看了
smb: \> ls.                                   D        0  Wed Nov  3 11:31:10 2021..                                  D        0  Wed Nov  3 11:19:33 2021westosfile1                         N        0  Wed Nov  3 11:31:10 2021westosfile2                         N        0  Wed Nov  3 11:31:10 2021westosfile3                         N        0  Wed Nov  3 11:31:10 20217353344 blocks of size 1024. 2947696 blocks available

如何共享系统目录?

[root@westos_storage samba]# vim /etc/samba/smb.conf     编辑配置文件,在配置文件最后添加如下参数
321         [etc]
322         comment = etc dir
323         path = /etc
[root@westos_storage samba]# systemctl restart smb.service  重启服务
[root@westos_storage samba]# smbclient -L //172.25.254.100 -U westos   访问
Enter MYGROUP\westos's password: Sharename       Type      Comment---------       ----      -------westos_share    Disk      westos shareetc             Disk      etc dir      /etc目录被共享成功IPC$            IPC       IPC Service (Samba Server Version 4.11.2)westos          Disk      Home Directories
SMB1 disabled -- no workgroup available
[root@westos_storage samba]# smbclient //172.25.254.100/etc -U westos  访问/etc
Enter MYGROUP\westos's password: 
Try "help" to get a list of possible commands.   /etc里面的内容可以被访问
smb: \> ls.                                   D        0  Wed Nov  3 09:58:45 2021..                                  D        0  Wed Nov  3 11:19:33 2021mtab                                N        0  Wed Nov  3 15:06:31 2021fstab                               N      615  Sat Aug 28 09:58:52 2021crypttab                            N        0  Sat Aug 28 09:58:52 2021dnf                                 D        0  Sat Aug 28 10:01:01 2021fonts                               D        0  Sat Aug 28 10:03:30 2021libreport                           D        0  Sat Aug 28 10:04:21 2021skel                                D        0  Sat Aug 28 10:01:35 2021logrotate.d                         D        0  Sat Aug 28 10:09:14 2021X11                                 D        0  Sat Aug 28 10:06:18 2021如果在selinux影响下系统目录里面文件不能被访问,该怎么办?
[root@westos_storage samba]# getsebool -a | grep samba   
samba_create_home_dirs --> off
samba_domain_controller --> off
samba_enable_home_dirs --> on
samba_export_all_ro --> off    将这个功能改为on打开 ,表示selinux将不再对samba服务访问安全上下文进行读限制
samba_export_all_rw --> off   表示selinux将不再对samba服务访问安全上下文写进行限制
samba_load_libgfapi --> off
samba_portmapper --> off
samba_run_unconfined --> off
samba_share_fusefs --> off
samba_share_nfs --> off
sanlock_use_samba --> off
tmpreaper_use_samba --> off
use_samba_home_dirs --> off
virt_use_samba --> off
[root@westos_storage samba]# setsebool  -P samba_export_all_ro on   表示打开读的功能
[root@westos_storage samba]# setsebool  -P samba_export_all_rw on  表示打开写的功能

6、samba服务中的常用参数剖析

访问控制:白名单(全局)
root@westos_storage samba]# vim /etc/samba/smb.conf 编辑配置文件
89,90行为全局访问控制,可以在90行之后直接添加访问控制91  hosts allow = 172.25.254.200    表示只允许200主机来访问当前的samb服务器   ,此位置设定的访问控制为全局访问控制,影响本samb服务器的所有共享root@westos_storage samba]# systemctl restart smb.service   重启服务   [root@localhost ~]# smbclient  -L //172.25.254.100  在200主机上访问samb服务器
Enter SAMBA\root's password: 
Anonymous login successful     允许访问可以查看Sharename       Type      Comment---------       ----      -------westos_share    Disk      westos shareetc             Disk      etc dirIPC$            IPC       IPC Service (Samba Server Version 4.11.2)
SMB1 disabled -- no workgroup available
[root@westos_storage samba]# vim /etc/samba/smb.conf 编辑配置文件hosts allow = 172.25.254.200    172.25.254.250    可以允许多个主机访问,中间用空格隔开访问控制:黑名单(全局)[root@westos_storage samba]# vim /etc/samba/smb.conf   hosts deny = 172.25.254.200   90行之后添加,表示拒绝200主机访问samba服务器, 此位置设定的访问控制为全局访问控制,影响本samb服务器的所有共享
[root@westos_storage samba]# systemctl restart smb.service  重启服务
[root@localhost ~]# smbclient  -L //172.25.254.100   访问
protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE  访问被拒绝

如何让200主机,对某个samb服务器共享??

[root@westos_storage samba]# vim /etc/samba/smb.conf   添加,编辑配置文件
317         [westos_share]
318         comment = westos share
319         path = /westos_share
320         hosts allow =172.25.254.200    表示westos_share共享只能允许200主机访问,此访问设定只针对westos_share生效
[root@westos_storage samba]# systemctl restart smb.service 重启
[root@foundation50 Desktop]# smbclient  //172.25.254.100/westos_share -U westos 在50主机上访问westos_share共享
Enter SAMBA\westos's password: 
tree connect failed: NT_STATUS_ACCESS_DENIED   被拒绝
[root@localhost ~]# smbclient //172.25.254.100/westos_share -U westos   200主机访问westos_share共享
Enter SAMBA\westos's password: 
Try "help" to get a list of possible commands.    可以访问
smb: \> ls.                                   D        0  Wed Nov  3 11:31:10 2021..                                  D        0  Wed Nov  3 11:19:33 2021westosfile1                         N        0  Wed Nov  3 11:31:10 2021westosfile2                         N        0  Wed Nov  3 11:31:10 2021westosfile3                         N        0  Wed Nov  3 11:31:10 20217353344 blocks of size 1024. 2947624 blocks available

如何让共享隐藏起来??

[root@westos_storage samba]# vim /etc/samba/smb.conf   添加,编辑配置文件
317         [westos_share]
318         comment = westos share
319         path = /westos_share
320         browseable = no   表示可以共享但是列不出来 ,隐藏共享目录
[root@localhost ~]# smbclient  -L //172.25.254.100 -U westos  访问列出资源时,可以发现westos_share被硬藏
Enter SAMBA\westos's password: Sharename       Type      Comment---------       ----      -------etc             Disk      etc dirIPC$            IPC       IPC Service (Samba Server Version 4.11.2)westos          Disk      Home Directories
SMB1 disabled -- no workgroup available
[root@westos_storage samba]# vim /etc/samba/smb.conf   添加,编辑配置文件
317         [westos_share]
318         comment = westos share
319         path = /westos_share
320         browseable = yes   表示列出共享资源列表时显示共享资源
[root@localhost ~]# smbclient  -L //172.25.254.100 -U westos  访问列出资源
Enter SAMBA\westos's password: Sharename       Type      Comment---------       ----      -------westos_share    Disk      westos share    显示etc             Disk      etc dirIPC$            IPC       IPC Service (Samba Server Version 4.11.2)westos          Disk      Home Directories
SMB1 disabled -- no workgroup available[root@westos_storage samba]# vim /etc/samba/smb.conf  添加配置文件
317         [westos_share]
318         comment = westos share
319         path = /westos_share
320         browseable = yes
321         valid users = westos    此共享只能通过samba用户westos登陆
[root@westos_storage samba]# systemctl restart smb.service   
[root@localhost ~]# smbclient //172.25.254.100/westos_share -U westos  westos用户可以被访问westos_share共享
Enter SAMBA\westos's password: 
Try "help" to get a list of possible commands.
smb: \> ls.                                   D        0  Wed Nov  3 11:31:10 2021..                                  D        0  Wed Nov  3 11:19:33 2021westosfile1                         N        0  Wed Nov  3 11:31:10 2021westosfile2                         N        0  Wed Nov  3 11:31:10 2021westosfile3                         N        0  Wed Nov  3 11:31:10 20217353344 blocks of size 1024. 2947156 blocks available
[root@localhost ~]# smbclient //172.25.254.100/westos_share -U lee  lee用户不可以访问westos_share共享
Enter SAMBA\lee's password: 
session setup failed: NT_STATUS_LOGON_FAILURE

如何让westos组中的成员可以使用此共享??

[root@westos_storage samba]# vim /etc/samba/smb.conf  添加配置文件
317         [westos_share]
318         comment = westos share
319         path = /westos_share
320         browseable = yes
321         valid users = @westos   @或者+表示westos组中的成员可以使用此共享
[root@westos_storage ~]# id lee  可以看出lee 不是westos组成员
uid=1001(lee) gid=1001(lee) groups=1001(lee)
[root@westos_storage ~]# id westos 
uid=1000(westos) gid=1000(westos) groups=1000(westos)
[root@localhost~]# smbclient //172.25.254.100/westos_share -U lee  lee不是westos组成员,所以不能访问共享
Enter MYGROUP\lee's password: 
session setup failed: NT_STATUS_LOGON_FAILURE
[root@westos_storage ~]# usermod -G westos lee  将lee用户添加成westos的组成员
[root@localhost ~]# smbclient  //172.25.254.100/westos_share -U lee  lee访问此共享
Enter SAMBA\westos's password: 
Try "help" to get a list of possible commands.   可以访问
smb: \> ls.                                   D        0  Wed Nov  3 11:31:10 2021..                                  D        0  Wed Nov  3 11:19:33 2021westosfile1                         N        0  Wed Nov  3 11:31:10 2021westosfile2                         N        0  Wed Nov  3 11:31:10 2021westosfile3                         N        0  Wed Nov  3 11:31:10 2021

如何让westos_share以读写的权限共享?

[root@westos_storage ~]# ls -ld /westos_share/
drwxr-xr-x. 2 root root 63 Nov  3 11:31 /westos_share/  
[root@westos_storage ~]# chmod 777 /westos_share/  在文件层面指定目录为满权限对于所有用户都可以写入
[root@localhost ~]# mount //172.25.254.100/westos_share /mnt/ -o username=lee,password=westos  挂载samba共享资源到测试主机mnt目录中,挂载之后在测试主机/mnt目录中建立文件真实存储文件的位置为samba共享服务器共享出来的westos_share
[root@localhost ~]# touch /mnt/file  虽然给westos_share满权限
touch: cannot touch '/mnt/file': Permission denied 但是无法建立文件,因为在samb中设置了共享的westos_share文件不是以写的方式共享出来的
[root@localhost ~]# umount /mnt   卸载掉
[root@westos_storage ~]# vim /etc/samba/smb.conf 添加,编辑配置文件
317         [westos_share]
318         comment = westos share
319         path = /westos_share
320         browseable = yes
322         writable = yes   表示westos_share以读写方式共享
[root@westos_storage ~]# systemctl restart smb.service  重启系统
[root@localhost ~]# mount //172.25.254.100/westos_share /mnt/ -o username=lee,password=westos 冲向将共享挂载到mnt里面
[root@localhost ~]# touch /mnt/file  现在就可以建立文件了
[root@westos_storage ~]# ls -l /westos_share/   可以看出共享文件里已经有file文件
total 0
-rwxr--r--. 1 lee  lee  0 Nov  3 22:55 file
-rw-r--r--. 1 root root 0 Nov  3 11:31 westosfile1
-rw-r--r--. 1 root root 0 Nov  3 11:31 westosfile2
-rw-r--r--. 1 root root 0 Nov  3 11:31 westosfile3

如何对于谁可写,谁不可写??

[root@westos_storage ~]# vim /etc/samba/smb.conf 添加,编辑配置文件
318         comment = westos share
319         path = /westos_share
320         browseable = yes
323         write list = lee   表示共享对lee可写
[root@westos_storage ~]# systemctl restart smb.service 
[root@localhost ~]# mount //172.25.254.100/westos_share /mnt/ -o username=lee,password=westos 用westos用户登陆samba共享目录,
[root@localhost ~]# touch /mnt/file1  可以建立文件,可以实现写的功能
[root@localhost ~]# umount /mnt  卸载
[root@localhost ~]# mount //172.25.254.100/westos_share /mnt/ -o username=westos,password=westos 用westos用户登陆samba共享目录
[root@localhost ~]# touch /mnt/file2  
touch: cannot touch '/mnt/file2': Permission denied 被拒绝,不能实现写的功能如何对lee组成员可写??
[root@westos_storage ~]# vim /etc/samba/smb.conf 添加,编辑配置文件
317         [westos_share]
318         comment = westos share
319         path = /westos_share
320         browseable = yes
323         write list = +lee  表示对lee组成员可写
[root@westos_storage ~]# systemctl restart smb.service  重启服务
[root@localhost ~]# mount //172.25.254.100/westos_share /mnt/ -o username=westos,password=westos 用westos用户登陆samba共享目录
[root@localhost mnt]# touch /mnt/file1   被拒绝不能实现写的功能,因为westos不是lee的组成员
touch: cannot touch '/mnt/file1': Permission denied
[root@localhost mnt]# usermod -G lee westos  通过设定westos被添加到lee用户的组中
[root@localhost mnt]# id westos 
uid=1000(westos) gid=1000(westos) groups=1000(westos),1001(lee) 
root@localhost mnt]# touch /mnt/file4  可以建立文件,有写的功能

如何让共享目录对匿名用户访问??

[root@localhost mnt]# smbclient //172.25.254.100/westos_share    匿名用户访问
Enter SAMBA\root's password: 
Anonymous login successful
tree connect failed: NT_STATUS_ACCESS_DENIED    默认情况下匿名用户不能使用samba共享资源
[root@westos_storage ~]# vim /etc/samba/smb.conf  添加,编辑配置文件
119         map to guest = bad user    添加,把没有用户身份的用户都影射为guest账号317         [westos_share]  
318         comment = westos share
319         path = /westos_share
320         browseable = yes
324         guest ok = yes  添加 ,表示此共享允许guest用户访问
[root@localhost mnt]# smbclient //172.25.254.100/westos_share  没有指定用户,就是匿名用户访问
Enter SAMBA\root's password: 
Try "help" to get a list of possible commands.
smb: \> ls                                   可以访问.                                   D        0  Thu Nov  4 11:05:49 2021..                                  D        0  Wed Nov  3 11:19:33 2021westosfile1                         N        0  Wed Nov  3 11:31:10 2021westosfile2                         N        0  Wed Nov  3 11:31:10 2021westosfile3                         N        0  Wed Nov  3 11:31:10 2021file                                A        0  Wed Nov  3 22:55:11 2021file1                               A        0  Wed Nov  3 23:07:27 2021file4                               A        0  Thu Nov  4 11:05:50 20217353344 blocks of size 1024. 2940808 blocks available
[root@localhost mnt]# mount //172.25.254.100/westos_share /mnt/ -o username=guest  匿名用户的挂载

7、samba服务与客户端的资源挂载优化

[root@localhost mnt]# mount //172.25.254.100/westos_share /mnt/ -o username=guest 如果用手动挂载samba共享目录到客户端的某个目录,当没有向服务器中写入数据或浏览数据时这个挂载依然存在,那么在闲置时依然使用服务器,这就是浪费资源,我们现在设定客户端使用时自动挂载,不使用时自动卸载,这样才能最大化利用服务器
[root@localhost ~]# dnf install autofs -y  在客户端安装autofs实现自动挂载和卸载
[root@localhost ~]# vim /etc/auto.master  编写挂载策略文件,添加参数
/westos (最终挂载点的上层目录) /etc/auto.share   (子挂载策略文件,此文件名称子定义,并且在系统中默认不存在)[root@localhost ~]# vim /etc/auto.share  编辑子挂载策略文件
samba             -fstype=cifs,username=westos,password=westos   ://172.25.254.100/westos_share
samba表示最终挂在点的相对路径            
-fstype 挂载资源的文件系统类型
username表示使用samba用户的名称
passwd表示该用户的密码
://172.25.254.100/westos_share 表示挂载服务器上的资源共享
[root@localhost ~]# systemctl enable --now autofs.service  启动服务
Created symlink /etc/systemd/system/multi-user.target.wants/autofs.service → /usr/lib/systemd/system/autofs.service.
[root@localhost westos]# cd /westos/samba   进入以挂载目录
[root@localhost samba]# ls
file  file1  file4  westosfile1  westosfile2  westosfile3
[root@localhost samba]# df
Filesystem                    1K-blocks    Used Available Use% Mounted on
devtmpfs                         907616       0    907616   0% /dev
tmpfs                            935412       0    935412   0% /dev/shm
tmpfs                            935412    9388    926024   2% /run
tmpfs                            935412       0    935412   0% /sys/fs/cgroup
/dev/vda3                       7353344 4401360   2951984  60% /
/dev/vda1                        506528  218600    287928  44% /boot
tmpfs                            187080    1180    185900   1% /run/user/42
tmpfs                            187080       4    187076   1% /run/user/0
//172.25.254.100/westos_share   7353344 4411876   2941468  60% /westos/samba   已经自动挂载
[root@localhost samba]# cd  退出samba目录,过300秒自动取消挂载,如果不想等300秒这么久,
[root@localhost ~]# vim /etc/autofs.conf  编辑autofs.conf主配置文件
timeout = 5    将300秒更改5秒,表示挂载资源在5秒以上无任何使用那么自动卸载,默认300秒
[root@localhost ~]# systemctl restart autofs.service  重启服务
[root@localhost ~]# df    没有挂载
Filesystem     1K-blocks    Used Available Use% Mounted on
devtmpfs          907616       0    907616   0% /dev
tmpfs             935412       0    935412   0% /dev/shm
tmpfs             935412    9388    926024   2% /run
tmpfs             935412       0    935412   0% /sys/fs/cgroup
/dev/vda3        7353344 4401364   2951980  60% /
/dev/vda1         506528  218600    287928  44% /boot
tmpfs             187080    1180    185900   1% /run/user/42
tmpfs             187080       4    187076   1% /run/user/0
[root@localhost ~]# cd /westos/samba   进入挂载目录,自动挂载
[root@localhost samba]# df
Filesystem                    1K-blocks    Used Available Use% Mounted on
devtmpfs                         907616       0    907616   0% /dev
tmpfs                            935412       0    935412   0% /dev/shm
tmpfs                            935412    9388    926024   2% /run
tmpfs                            935412       0    935412   0% /sys/fs/cgroup
/dev/vda3                       7353344 4401364   2951980  60% /
/dev/vda1                        506528  218600    287928  44% /boot
tmpfs                            187080    1180    185900   1% /run/user/42
tmpfs                            187080       4    187076   1% /run/user/0
//172.25.254.100/westos_share   7353344 4411896   2941448  60% /westos/samba
[root@localhost samba]# cd  退出目录i
[root@localhost ~]# df    5秒后自动卸载
Filesystem     1K-blocks    Used Available Use% Mounted on
devtmpfs          907616       0    907616   0% /dev
tmpfs             935412       0    935412   0% /dev/shm
tmpfs             935412    9388    926024   2% /run
tmpfs             935412       0    935412   0% /sys/fs/cgroup
/dev/vda3        7353344 4401364   2951980  60% /
/dev/vda1         506528  218600    287928  44% /boot
tmpfs             187080    1180    185900   1% /run/user/42
tmpfs             187080       4    187076   1% /run/user/0

8、samba服务的多用户挂载

[root@localhost ~]# mount //172.25.254.100/westos_share /mnt/ -o username=lee,password=westos  
在客户端root用户用自己的samba账户挂载了服务器资源,自己是可以浏览和使用的
[root@localhost ~]# ls /mnt/
file  file1  file4  westosfile1  westosfile2  westosfile3
[root@localhost ~]# su -- westos
[westos@localhost root]$ ls /mnt/   客户端westos用户没有通过任何samba认证,也可以浏览samba服务器上的资源,这样客户端就出现了很严重的越级漏洞
file  file1  file4  westosfile1  westosfile2  westosfile3

如何让只能通过samba认证才能看资源了??

当用户挂载smb资源时需要书写账号密码如果直接书写那么账号密码可以通过历史被其他人看到所以我 们写到文件中并设定安全权限
[root@localhost ~]# dnf install cifs-utils -y   安装多用户认证安全插件
[root@localhost ~]# man mount.cifs  查看安全插件的用法
[root@localhost ~]# vim /root/smbpass  建立文件
username=lee            添加账号和密码      
password=westos
[root@localhost ~]# chmod 600 /root/smbpass   只给自己读写权限,别人看不了 
[root@localhost ~]# mount -o credentials=/root/smbpass  //172.25.254.100/westos_share /mnt/    用credentials此参数指定密码文件后密码就被隐藏起来了
[root@localhost ~]# [root@localhost ~]# mount -o credentials=/root/smbpass,multiuser //172.25.254.100/westos_share /mnt/  multiuser表示多用户认证,当添加此参数,没用通过认证的用户是不可以访问samb上的资源
[root@localhost ~]# su -- westos   westos用户没有通过samba用户认证不能查看资源
[westos@localhost root]$ ls /mnt 
ls: cannot access '/mnt': Permission denied
[root@localhost ~]# mount -o credentials=/root/smbpass,multiuser,sec=ntlmssp //172.25.254.100/westos_share /mnt/   sec=ntlmssp 表示其他用户使用到的认证方式
[westos@localhost root]$ ls /mnt   westos用户不能访问共享资源
ls: cannot access '/mnt': Permission denied
[westos@localhost ~]$ cifscreds add -u westos 172.25.254.100  

9、nfs的简介和启用

nfs:实现linux与linux,unix与linux,之间的文件共享

nfs启用:
[root@westos_storage ~]# dnf install nfs-utils.x86_64 -y    安装, 客户端和服务端都是此安装包
[root@westos_storage ~]# systemctl enable --now nfs-server.service  启动服务
Created symlink /etc/systemd/system/multi-user.target.wants/nfs-server.service → /usr/lib/systemd/system/nfs-server.service.
nfs的 端口是2049
[root@westos_storage ~]# netstat -antlupe | grep 2049
tcp        0      0 0.0.0.0:2049            0.0.0.0:*               LISTEN      0          43220      -                   
tcp6       0      0 :::2049                 :::*                    LISTEN      0          43231      -  
[root@localhost ~]# showmount -e 172.25.254.100  列出nfs服务器中的共享资源
clnt_create: RPC: Unable to receive    报错
[root@westos_storage ~]# firewall-cmd --permanent --add-service=nfs  
success
[root@westos_storage ~]# firewall-cmd --reload 
success
[root@westos_storage ~]# firewall-cmd --permanent --add-service=rpc-bind    rpc-bind  作用是给访问请求分配一个端口
success
[root@westos_storage ~]# firewall-cmd --permanent --add-service=mountd  mountd控制共享目录的程序
success
[root@westos_storage ~]# firewall-cmd --reload 
success
[root@localhost ~]# showmount -e 172.25.254.100  可以访问了
Export list for 172.25.254.100:

共享原理图:
在这里插入图片描述

10、nfs共享目录及客户端使用方法

[root@westos_storage ~]# mkdir /westosdir  服务器上建立共享目录
[root@westos_storage ~]# ls -ld /westosdir/   
drwxr-xr-x. 2 root root 6 Nov  6 10:49 /westosdir/
[root@westos_storage ~]# chmod 777 /westosdir/    设定共享权限,设置为777目的是为了实验效果
[root@westos_storage ~]# vim /etc/exports  编辑共享策略文件
/westosdir          *(ro,sync)      表示: 只读共享,并在数据真实发生改变后才同步数据到nfs共享目录
sync表示更改生成后同步到服务器, async表示时时同步到服务器 ,ro表示只读,rw表示读写
[root@westos_storage ~]# exportfs -rv  表示使共享策略生效
exporting *:/westosdir
[root@localhost ~]# showmount -e 172.25.254.100    在客户端可以查看到共享
Export list for 172.25.254.100:
/westosdir *      
[root@localhost ~]# mount 172.25.254.100:/westosdir /mnt/   挂载,共享资源的使用方式
[root@westos_storage ~]# touch /westosdir/westosfile{1..3}  在服务器共享 目录里建立文件
[root@localhost ~]# ls /mnt/  客户端就可以查看
westosfile1  westosfile2  westosfile3
[root@westos_storage ~]# man 5 exports  共享策略方式书写查看
[root@westos_storage ~]# vim /etc/exports 添加,编辑策略文件1 /westosdir              *(ro,sync)2 /westosdir              172.25.254.200(rw,sync)    1或2表示对于除200主机以外的人只读共享,对于200主机读写
[root@westos_storage ~]# exportfs -rv   重启策略
exporting 172.25.254.200:/westosdir
exporting *:/westosdir
同样也可以如下书写方式:1 /westosdir              *(ro,sync) 172.25.254.200(rw,sync)   同样表示对除200以外的主机共享,对200主机读写
[root@westos_storage ~]# exportfs -rv  重启策略,一样的效果
exporting 172.25.254.200:/westosdir
exporting *:/westosdir
也可以对某个网段可以读写;1 /westosdir              *(ro,sync) 172.25.254.0/24(rw,sync)
[root@localhost ~]# mount 172.25.254.100://westosdir /mnt/  挂载,当客户端挂载到本地目录后,使用到的用户身份是服务器上的nobody
[root@localhost ~]# touch /mnt/westosfile4  可以建立
[root@westos_storage ~]# ls -l /westosdir/ 在客户端查看
total 0
-rw-r--r--. 1 root   root   0 Nov  6 11:13 westosfile1
-rw-r--r--. 1 root   root   0 Nov  6 11:13 westosfile2
-rw-r--r--. 1 root   root   0 Nov  6 11:13 westosfile3
-rw-r--r--. 1 nobody nobody 0 Nov  6 11:46 westosfile4    用户身份nodbody
如何更改用户身份
[root@westos_storage ~]# vim /etc/exports  编辑策略文件1 /westosdir              *(ro,sync) 172.25.254.200(rw,sync,anonuid=1000,anongid=1000)   指定客户端在挂载时使用的用户为100,不是默认的nobody
exporting 172.25.254.200:/westosdir
exporting *:/westosdir
[root@localhost ~]# umount /mnt   之前的挂载卸载掉
[root@localhost ~]# mount 172.25.254.100://westosdir /mnt/   重新挂载
[root@localhost ~]# touch /mnt/westosfile5  建立文件
[root@westos_storage ~]# ls -l /westosdir/
total 0
-rw-r--r--. 1 root   root   0 Nov  6 11:13 westosfile1
-rw-r--r--. 1 root   root   0 Nov  6 11:13 westosfile2
-rw-r--r--. 1 root   root   0 Nov  6 11:13 westosfile3
-rw-r--r--. 1 westos westos 0 Nov  6 12:22 westosfile5    可以看出建立的文件用户就变成westos了
默认情况下客户端用的是超级用户挂载,所到服务器中用户身份会转成nobody,如何延用超级用户身份了?
[root@westos_storage ~]# vim /etc/exports  编辑策略文件1 /westosdir              *(ro,sync) 172.25.254.200(rw,sync,no_root_squash)  no_root_squash表示:客户端使用超级用户身份进行nfs资源挂载后延用自己的root身份到服务器中
[root@westos_storage ~]# exportfs -rv  重启策略
exporting 172.25.254.200:/westosdir
exporting *:/westosdir
[root@localhost ~]# umount /mnt 
[root@localhost ~]# mount 172.25.254.100://westosdir /mnt/  重新挂载
[root@localhost ~]# touch /mnt/westosfile6  建立文件
[root@westos_storage ~]# ls -l /westosdir/
total 0
-rw-r--r--. 1 root   root   0 Nov  6 11:13 westosfile1
-rw-r--r--. 1 root   root   0 Nov  6 11:13 westosfile2
-rw-r--r--. 1 root   root   0 Nov  6 11:13 westosfile3
-rw-r--r--. 1 nobody nobody 0 Nov  6 11:46 westosfile4
-rw-r--r--. 1 westos westos 0 Nov  6 12:22 westosfile5
-rw-r--r--. 1 root   root   0 Nov  6 12:36 westosfile6    延用自己的root身份

11、nfs和autofs的自动挂载优化

[root@localhost ~]# dnf install autofs -y  在客户端安装自动挂载服务autofs
[root@localhost ~]# vim /etc/auto.master  添加参数, 编辑主挂载策略文件
/westos (最仲挂载点上层目录) /etc/auto.nfs(子策略文件)
[root@localhost ~]# vim /etc/auto.nfs   添加,编辑子策略文件
nfs    -rw        172.25.254.100:/westosdir   
nfs 表示最终挂载点相对路径
-rw表示挂载参数 读写 
172.25.254.100:/westosdir  表示nfs服务器共享出来的资源       
[root@localhost ~]# systemctl restart autofs.service  重启服务
[root@localhost ~]# cd /westos/nfs  进入挂载目录
[root@localhost nfs]# df
Filesystem                1K-blocks    Used Available Use% Mounted on
devtmpfs                     907616       0    907616   0% /dev
tmpfs                        935412       0    935412   0% /dev/shm
tmpfs                        935412    9392    926020   2% /run
tmpfs                        935412       0    935412   0% /sys/fs/cgroup
/dev/vda3                   7353344 4377740   2975604  60% /
/dev/vda1                    506528  218600    287928  44% /boot
tmpfs                        187080    1180    185900   1% /run/user/42
tmpfs                        187080       4    187076   1% /run/user/0
172.25.254.100:/westosdir   7353344 4382208   2971136  60% /mnt   自动挂载,退出挂载目录自动卸载

12、iscsi简介启用及客户端激活设备过程

在服务器上添加一块设备
[root@westos_storage ~]# fdisk -l
Disk /dev/vda: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x657e7edcDevice     Boot   Start      End  Sectors  Size Id Type
/dev/vda1  *       2048  1026047  1024000  500M 83 Linux
/dev/vda2       1026048  2050047  1024000  500M 82 Linux swap / Solaris
/dev/vda3       2050048 16777215 14727168    7G 83 LinuxDisk /dev/vdb: 5 GiB, 5368709120 bytes, 10485760 sectors    新添加5G设备
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes      
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@westos_storage ~]# fdisk /dev/vdb   划分设备Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x81b83167.Command (m for help): n
Partition typep   primary (0 primary, 0 extended, 4 free)e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-10485759, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-10485759, default 10485759): +2GCreated a new partition 1 of type 'Linux' and of size 2 GiB.Command (m for help): p
Disk /dev/vdb: 5 GiB, 5368709120 bytes, 10485760 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x81b83167Device     Boot Start     End Sectors Size Id Type
/dev/vdb1        2048 4196351 4194304   2G 83 Linux      建立一个2G的设备Command (m for help): wq
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[root@westos_storage ~]# dnf  install  targetcli   安装共享策略管理软件
[root@westos_storage ~]# systemctl enable --now target  启动服务
Created symlink /etc/systemd/system/multi-user.target.wants/target.service → /usr/lib/systemd/system/target.service.
[root@westos_storage ~]# targetcli  用此命令编写共享策略
Warning: Could not load preferences file /root/.targetcli/prefs.bin.
targetcli shell version 2.1.51
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.

在这里插入图片描述

/> /backstores/block create westos:storage1 /dev/vdb1  westos:storage1表示在此软件中设备的别名
/dev/vdb1  表示系统中真实设备
Created block storage object westos:storage1 using /dev/vdb1.  内部指定设备
/> /iscsi create iqn.2021-08.org.westos:storage1  建立对外共享名称,iqn的命名方式iscs限定名称,格式为iqn.YYYY-MM.域名反写:别名
Created target iqn.2021-08.org.westos:storage1.
Created TPG 1.
Global pref auto_add_default_portal=true
Created default portal listening on all IPs (0.0.0.0), port 3260.
/> iscsi/iqn.2021-08.org.westos:storage1/tpg1/luns create /backstores/block/westos:storage1  把共享名称和内部指定设备关联
Created LUN 0.
/> iscsi/iqn.2021-08.org.westos:storage1/tpg1/acls create iqn.2021-08.org.westos:westoskey  为共享设定访问key ,westoskey表示加密字符
Created Node ACL for iqn.2021-08.org.westos:westoskey
Created mapped LUN 0.
/> exit   退出,共享完成
Global pref auto_save_on_exit=true
Configuration saved to /etc/target/saveconfig.json在客户端:
[root@localhost nfs]# dnf install iscsi-initiator-utils.x86_64  -y  安装客户端软件
[root@localhost nfs]# systemctl status iscsid 对客户端控制配置服务
[root@localhost nfs]# systemctl status iscsi  客户端对资源利用服务
[root@localhost nfs]# iscsiadm -m discovery -t st -p 172.25.254.100
-m 表示类型
-t指定识别的设备类型
-p 表示指定资源主机ip(服务器)
iscsiadm: cannot make connection to 172.25.254.100: No route to host     表示连接100服务器失败需要设定火墙
iscsiadm: cannot make connection to 172.25.254.100: No route to host 
iscsiadm: cannot make connection to 172.25.254.100: No route to host
[root@westos_storage ~]# firewall-cmd --permanent --add-port=3260/tcp   开放服务的端口让客户端可以访问
success
[root@westos_storage ~]# firewall-cmd --reload 
success
[root@localhost nfs]# iscsiadm -m discovery -t st -p 172.25.254.100   共享信息可以查询
172.25.254.100:3260,1 iqn.2021-08.org.westos:storage1
[root@localhost nfs]# iscsiadm -m node -T iqn.2021-08.org.westos:storage1 -p 172.25.254.100 -l  挂载,-T表示指定共享设备名称 -l表示登陆共享设备
Logging in to [iface: default, target: iqn.2021-08.org.westos:storage1, portal: 172.25.254.100,3260]
iscsiadm: Could not login to [iface: default, target: iqn.2021-08.org.westos:storage1, portal: 172.25.254.100,3260].
iscsiadm: initiator reported error (24 - iSCSI login failed due to authorization failure)   认证失败,因为在客户端中未指定服务端的共享key所以无法登陆
iscsiadm: Could not log into all portals
[root@localhost nfs]# vim /etc/iscsi/initiatorname.iscsi  需要在客户端的此文件指定key
InitiatorName=iqn.2021-08.org.westos:westoskey    服务器中的共享key
[root@localhost nfs]# systemctl restart iscsid.service   重启服务
[root@localhost nfs]# iscsiadm -m node -T iqn.2021-08.org.westos:storage1 -p 172.25.254.100 -l  再次挂载,挂载成功
Logging in to [iface: default, target: iqn.2021-08.org.westos:storage1, portal: 172.25.254.100,3260]
Login to [iface: default, target: iqn.2021-08.org.westos:storage1, portal: 172.25.254.100,3260] successful.
[root@localhost nfs]# 
[root@localhost nfs]# fdisk -l
Disk /dev/vda: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x657e7edcDevice     Boot   Start      End  Sectors  Size Id Type
/dev/vda1  *       2048  1026047  1024000  500M 83 Linux
/dev/vda2       1026048  2050047  1024000  500M 82 Linux swap / Solaris
/dev/vda3       2050048 16777215 14727168    7G 83 LinuxDisk /dev/sda: 2 GiB, 2147483648 bytes, 4194304 sectors    在客户端系统中会出现一个新的硬盘,大小为服务器共享的设备大小
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@localhost nfs]# fdisk /dev/sda Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xc7c17f0d.Command (m for help): n  
Partition typep   primary (0 primary, 0 extended, 4 free)e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-4194303, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-4194303, default 4194303): Created a new partition 1 of type 'Linux' and of size 2 GiB.Command (m for help): p
Disk /dev/sda: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc7c17f0dDevice     Boot Start     End Sectors Size Id Type
/dev/sda1        2048 4194303 4192256   2G 83 LinuxCommand (m for help): wq
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.[root@localhost nfs]# mkfs.xfs /dev/sda1    格式化
meta-data=/dev/sda1              isize=512    agcount=4, agsize=131008 blks=                       sectsz=512   attr=2, projid32bit=1=                       crc=1        finobt=1, sparse=1, rmapbt=0=                       reflink=1
data     =                       bsize=4096   blocks=524032, imaxpct=25=                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=2560, version=2=                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@localhost nfs]# mount /dev/sda1  /mnt/   挂载
设备就可以使用了 ,iscs直接把服务器中的设备共享出来了

13.客户端永久挂载设备方法

[root@localhost nfs]# blkid  查看设备id
/dev/vda1: UUID="3cc65186-5c1a-4b64-937d-76fa3feec0c8" TYPE="xfs" PARTUUID="657e7edc-01"
/dev/vda2: UUID="a0f0361a-8846-4d19-ac39-653b0b79aff8" TYPE="swap" PARTUUID="657e7edc-02"
/dev/vda3: UUID="0eb49537-4c55-4a43-986f-98bd31d7cfd2" TYPE="xfs" PARTUUID="657e7edc-03"
/dev/sda1: UUID="24a0d435-2066-4d1c-9d8a-3c216d74089d" TYPE="xfs" PARTUUID="c7c17f0d-01"
网络设备因网络通信的缘故可能发生名称变化所以推荐挂载时使用设备的id进行设备的指定
[root@localhost nfs]# vim /etc/fstab   编辑永久挂载文件,添加参数
UUID=24a0d435-2066-4d1c-9d8a-3c216d74089d  /mnt                   xfs     defaults       0 0   
[root@localhost nfs]# reboot  重启系统,会导致系统启动失败

在这里插入图片描述
如何解决此问题:

[root@localhost nfs]# vim /etc/fstab   编辑永久挂载文件,添加参数
UUID=24a0d435-2066-4d1c-9d8a-3c216d74089d  /mnt                   xfs     defaults,_netdev        0 0   
_netdev表示指定此设备在挂载时先启动网络iscs服务后在生效
[root@localhost ~]# reboot  重启系统,系统就可以正常启动
[root@localhost ~]# df   
Filesystem     1K-blocks    Used Available Use% Mounted on
devtmpfs          907616       0    907616   0% /dev
tmpfs             935412       0    935412   0% /dev/shm
tmpfs             935412    9452    925960   2% /run
tmpfs             935412       0    935412   0% /sys/fs/cgroup
/dev/vda3        7353344 4426496   2926848  61% /
/dev/vda1         506528  218600    287928  44% /boot
/dev/sda1        2085888   47580   2038308   3% /mnt                开机自动挂载
tmpfs             187080    1180    185900   1% /run/user/42
tmpfs             187080       4    187076   1% /run/user/0

14、iscsi的删除

客户端:
[root@localhost ~]# vim /etc/fstab    删除网络设备自动挂载信息
UUID=24a0d435-2066-4d1c-9d8a-3c216d74089d  /mnt                   xfs     defaults,_netdev        0 0  这一条信息删除
[root@localhost ~]# umount /mnt  卸载掉设备
[root@localhost ~]# tree /var/lib/iscsi/  在客户端读取到的服务器的所有数据存放目录
/var/lib/iscsi/
├── ifaces
├── isns
├── nodes
│   └── iqn.2021-08.org.westos:storage1
│       └── 172.25.254.100,3260,1
│           └── default
├── send_targets
│   └── 172.25.254.100,3260
│       ├── iqn.2021-08.org.westos:storage1,172.25.254.100,3260,1,default -> /var/lib/iscsi/nodes/iqn.2021-08.org.westos:storage1/172.25.254.100,3260,1
│       └── st_config
├── slp
└── static
[root@localhost ~]# iscsiadm -m node -T iqn.2021-08.org.westos:storage1 -p 172.25.254.100 -u  -u表示退出登陆
Logging out of session [sid: 1, target: iqn.2021-08.org.westos:storage1, portal: 172.25.254.100,3260]
Logout of [sid: 1, target: iqn.2021-08.org.westos:storage1, portal: 172.25.254.100,3260] successful.
[root@localhost ~]# fdisk -l   退出登陆后设备消失,但是数据还在重启iscs设备服务器后设备会自动出现
Disk /dev/vda: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x657e7edcDevice     Boot   Start      End  Sectors  Size Id Type
/dev/vda1  *       2048  1026047  1024000  500M 83 Linux
/dev/vda2       1026048  2050047  1024000  500M 82 Linux swap / Solaris
/dev/vda3       2050048 16777215 14727168    7G 83 Linux
[root@localhost ~]# systemctl restart iscsi  重启iscs服务
[root@localhost ~]# fdisk -l    查看设备,设备又回来了
Disk /dev/vda: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x657e7edcDevice     Boot   Start      End  Sectors  Size Id Type
/dev/vda1  *       2048  1026047  1024000  500M 83 Linux
/dev/vda2       1026048  2050047  1024000  500M 82 Linux swap / Solaris
/dev/vda3       2050048 16777215 14727168    7G 83 LinuxDisk /dev/sda: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc7c17f0dDevice     Boot Start     End Sectors Size Id Type
/dev/sda1        2048 4194303 4192256   2G 83 Linux    设备又回来了
如何永久删掉 ??
[root@localhost ~]# iscsiadm -m node -T iqn.2021-08.org.westos:storage1 -p 172.25.254.100 -u  登出
Logging out of session [sid: 2, target: iqn.2021-08.org.westos:storage1, portal: 172.25.254.100,3260]
Logout of [sid: 2, target: iqn.2021-08.org.westos:storage1, portal: 172.25.254.100,3260] successful.
[root@localhost ~]# iscsiadm -m node -T iqn.2021-08.org.westos:storage1 -p 172.25.254.100 -o delete  ,delete作用:删除客户主机此网络设备的数据
[root@localhost ~]# tree /var/lib/iscsi/   可以发现数据信息不见了
/var/lib/iscsi/
├── ifaces
├── isns
├── nodes
├── send_targets
│   └── 172.25.254.100,3260
│       └── st_config
├── slp
└── static
[root@localhost ~]# systemctl restart iscsi  重启iscs服务
[root@localhost ~]# tree /var/lib/iscsi/     还是么有数据信息,这次就彻底删除了
/var/lib/iscsi/
├── ifaces
├── isns
├── nodes
├── send_targets
│   └── 172.25.254.100,3260
│       └── st_config
├── slp
└── static服务端如何删除:
[root@westos_storage ~]# targetcli   
targetcli shell version 2.1.51
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'./> ls
o- / ................................................................................................... [...]o- backstores ........................................................................................ [...]| o- block ............................................................................ [Storage Objects: 1]| | o- westos:storage1 ........................................... [/dev/vdb1 (2.0GiB) write-thru activated]| |   o- alua ............................................................................. [ALUA Groups: 1]| |     o- default_tg_pt_gp ................................................. [ALUA state: Active/optimized]| o- fileio ........................................................................... [Storage Objects: 0]| o- pscsi ............................................................................ [Storage Objects: 0]| o- ramdisk .......................................................................... [Storage Objects: 0]o- iscsi ...................................................................................... [Targets: 1]| o- iqn.2021-08.org.westos:storage1 ............................................................. [TPGs: 1]|   o- tpg1 ......................................................................... [no-gen-acls, no-auth]|     o- acls .................................................................................... [ACLs: 1]|     | o- iqn.2021-08.org.westos:westoskey ............................................... [Mapped LUNs: 1]|     |   o- mapped_lun0 ................................................. [lun0 block/westos:storage1 (rw)]|     o- luns .................................................................................... [LUNs: 1]|     | o- lun0 ..................................... [block/westos:storage1 (/dev/vdb1) (default_tg_pt_gp)]|     o- portals .............................................................................. [Portals: 1]|       o- 0.0.0.0:3260 ............................................................................... [OK]o- loopback ................................................................................... [Targets: 0]
/> clearconfig confirm=True    表示清空服务器中的共享数据
All configuration cleared
/> ls   查看,已经删除了
o- / ................................................................................................... [...]o- backstores ........................................................................................ [...]| o- block ............................................................................ [Storage Objects: 0]| o- fileio ........................................................................... [Storage Objects: 0]| o- pscsi ............................................................................ [Storage Objects: 0]| o- ramdisk .......................................................................... [Storage Objects: 0]o- iscsi ...................................................................................... [Targets: 0]o- loopback ................................................................................... 
/> exit 
Global pref auto_save_on_exit=true
Configuration saved to /etc/target/saveconfig.json
查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. 【docker】 docker import导入docker export导出的容器

    【docker】 docker import导入docker export导出的容器 1、背景2、导入容器的tar文件3、示例1、背景 docker export导出的容器tar文件,再次导入到docker软件中需要使用docker import 命令。 docker import 将container容器tar文件导入后,恢复成一个image镜像。 相比于docke…...

    2024/5/5 7:09:44
  2. smplify-x 复现记录

    其实已经配过一遍了,但是ubuntu,cuda,pytorch,没按readmel来弄,用的ubuntu20.0.4cuda11.0pytorch1.7配了环境,网络可以跑,但是文章里面用到的自渗透检测的方法要求的pytorch版本很低,要求pytorch1.0,高了编译不了,会报一个Compile…...

    2024/5/5 17:44:48
  3. C:大数加法

    问题描述:两个很大很大的数相加,例如: 111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111111111111110 思路&#xff1…...

    2024/5/6 2:18:29
  4. 水洼数目(dfs)

    水洼数目有一个大小为N * M的院子&#xff0c;雨后积起了水&#xff0c; 八连通的积水被认为是连在一起的&#xff0c;请求出园子里面总共有多少水洼&#xff08;八连通指的是下图中相对w大的*部分&#xff09; *** *w* *** 限制条件 N, M <100 样例&#xff1a; 输入&#…...

    2024/5/6 0:11:03
  5. RL2021有关机器学习和强化学习的相关内容总结(草稿版一稿)

    机器学习强化学习总结 一、机器学习模型框架 模型学习&#xff1a; 数据&#xff1a;测试集、训练集 训练集-模型训练-模型评估 模型使用&#xff1a;输入数据-通过训练好的模型-输出 模型训练过程&#xff1a;1.模型选择&#xff08;通过人类经验选择选择更合适的模型&…...

    2024/4/19 19:28:58
  6. ROS系列——如何把ROS和STM32之间联系起来

    ROS系列——如何把ROS和STM32之间联系起来 本节内容包括如何实现ros主控和stm32之间的通信&#xff0c;以及ros主控对stm32发送的数据做了哪些处理 一. 两种控制器的功能 1.1 ROS主控实现的功能 ①雷达信息采集 ②摄像头信息采集 ③路径规划1.2 STM32控制器实现的功能 ①里…...

    2024/5/6 3:09:59
  7. Java入门

    Java入门 java 特性&#xff1a; 简单性&#xff0c;java是c语法的纯净版&#xff0c;没有头文件&#xff0c;指针运算&#xff0c;而且也不需要分配内存。语法基于C。面向对象&#xff0c;是程序设计技术。将重点放在接口和接口的对象之上。模拟的是人的思维去写程序。万物皆…...

    2024/5/6 3:45:57
  8. Python爬取B站历史观看记录并用Bokeh做数据可视化

    待爬取的数据 爬虫代码 import os import time import requests import pandas as pd# cookie 用浏览器登录B站&#xff0c;按F12打开开发人员工具&#xff0c;找到自己的cookie替换 cookies_dict {_uuid: "1C7F0395-1CDC-5BBF-E859-528F14EA305F09211infoc",bili_…...

    2024/4/17 22:25:57
  9. ROS系列——ROS话题

    ROS系列——ROS话题 话题通信是ROS最常用以及最基础的通信方法 1. Ros话题通信机制&#xff1a; 话题通信是一种支持一对多的异步通信机制&#xff0c;一般来说话题通信有一个发布者和一个订阅者&#xff0c;发布者将信息发布到话题上&#xff0c;订阅者从话题订阅信息&#…...

    2024/4/17 0:38:24
  10. SDRAM

    简介、优缺点、历史 1、译为“同步动态随机存取内存”&#xff0c;区别于异步DRAM。 2、同步(Synchronous)&#xff1a;与通常的异步 DRAM 不同&#xff0c; SDRAM 存在一个同步接口&#xff0c;其工作时钟的时钟频率与对应控制器(CPU/FPGA)的时钟频率相同&#xff0c;并且 S…...

    2024/4/15 2:54:18
  11. Makefile中执行pwd赋值给变量

    export CUR_DIR$(shell pwd) 参考&#xff1a; Makefile中利用shell的方式来给变量赋值的两种方法_猫瑾的博客-CSDN博客...

    2024/4/14 20:25:47
  12. ROS系列——launch para

    ROS系列——launch para launch文件&#xff1a;可实现多节点启动和参数配置的xml文件 1.launch标签总览 <launch> ... </launch> &#xff1a; 根标签 <node> &#xff1a;启动节点 <include> &#xff1a;嵌套 <remap> &#xff1a;重命名 …...

    2024/4/16 22:12:30
  13. 宜浩服务队隐私政策

    本隐私政策介绍本公司或本人的隐私数据相关政策和惯例&#xff0c;这将涵盖我们如何收集、使用、处理、存储和/或披露那些通过本公司的移动App收集的关于您的个人信息。请你仔细阅读我们的隐私政策。 一、如何收集您的个人信息 个人信息是可用于唯一地识别或联系某人的数据。…...

    2024/4/14 20:26:17
  14. 第十七届全国大学生智能车竞赛第一次组委会扩大会议在线上召开

    在今天&#xff08;2021,11&#xff0c;7&#xff09;上午&#xff0c; 全国大学生智能车竞赛 组委会通过线上举行了第十七届智能车竞赛组委会扩大会议。来自中国自动化学会、竞赛秘书处、各分赛区、省赛区、全国总决赛承办学校以及省赛区挂靠单位负责人参加了此次会议。 会议首…...

    2024/4/14 20:25:52
  15. 基于用户投诉信息的知识图谱构建与实现

    自从google公司推出旗下的产品Knowledge Graph以来&#xff0c;知识图谱这个概念越来越受到学术与工业界的关注。如何以质量参差不齐的网页数据作为原始数据源&#xff0c;构建知识图谱已经成为了一个热门的研究课题。 互联网技术的迅速发展导致了网民数量的快速增长。愈来愈多…...

    2024/4/18 4:47:59
  16. leetcode学习笔记(打家劫舍 II)

    213. 打家劫舍 II 和第192打家劫舍类似&#xff0c;当房间数为1时不用选择&#xff0c;房间数为2时选较大的一家。 在大于2家时由于首尾相连&#xff0c;可以分成两种情况&#xff0c;选中第一家&#xff0c;不选第一家&#xff0c; 选中第一家&#xff1a; 则一定不能选最后一…...

    2024/4/5 5:33:59
  17. 太阳之子的力扣之路 11.7

    一 统计字符串中的元音字符串 暂时只想到了O&#xff08;n&#xff09;的写法 class Solution {public int countVowelSubstrings(String word) {HashMap<Character,Integer> mapnew HashMap<>();int result0;for(int i0;i<word.length();i){for(int ji;j<w…...

    2024/4/14 20:26:02
  18. redis 指定配置文件启动报错replica-serve-stale-data yes

    现象: # redis-server redis.conf *** FATAL CONFIG FILE ERROR *** Reading the configuration file, at line 309 >>> replica-serve-stale-data yes Bad directive or wrong number of arguments 解决&#xff1a; redis.conf指定位置有误&#xff0c;改为正确的…...

    2024/4/14 20:26:12
  19. 基于Python机器学习的手写数字识别研究与应用

    深度学习是传统机器学习下的一个分支&#xff0c;得益于近些年来计算机硬件计算能力质的飞跃&#xff0c;使得深度学习成为了当下热门之一。手写数字识别更是深度学习入门的经典案例&#xff0c;学习和理解其背后的原理对于深度学习的理解有很重要的作用。 本文将采用深度学习中…...

    2024/4/7 3:20:16
  20. python高校学生消费行为分析系统

    ​ 随着高校信息化建设的不断完善&#xff0c;在校大学生日常生活和学习行为被各大业务系统记录和存储下来&#xff0c;并且得到了持续的积累&#xff0c;初步形成了具有大规模&#xff0c;多类型学生个人大数据环境。数字化校园系统的广泛运用&#xff0c;数据的快速传递和使用…...

    2024/4/14 20:26:58

最新文章

  1. 【分布式系统的金线】——Base理论深度解析与实战指南

    关注微信公众号 “程序员小胖” 每日技术干货&#xff0c;第一时间送达&#xff01; 引言 在当今这个数据密集、服务分布的数字时代&#xff0c;设计高效且可靠的分布式系统成为了技术领域的核心挑战之一。提及分布式系统设计的理论基石&#xff0c;CAP理论——即一致性(Cons…...

    2024/5/6 4:32:47
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/3/20 10:50:27
  3. 关于ansible的模块 ③

    转载说明&#xff1a;如果您喜欢这篇文章并打算转载它&#xff0c;请私信作者取得授权。感谢您喜爱本文&#xff0c;请文明转载&#xff0c;谢谢。 接《关于Ansible的模块①》和《关于Ansible的模块②》&#xff0c;继续学习ansible的user模块。 user模块可以增、删、改linux远…...

    2024/5/1 18:52:02
  4. composer常见错误解决

    在Java中&#xff0c;常见的问题和解决方法包括&#xff1a; 内存不足错误&#xff1a;Java应用程序在运行时可能会遇到内存不足的错误。可以通过增加JVM的堆内存大小来解决&#xff0c;可以通过设置-Xms和-Xmx参数来指定初始堆大小和最大堆大小。 java -Xms2G -Xmx4G YourAppl…...

    2024/5/5 8:38:08
  5. C++ 【原型模式】

    简单介绍 原型模式是一种创建型设计模式 | 它使你能够复制已有对象&#xff0c;客户端不需要知道要复制的对象是哪个类的实例&#xff0c;只需通过原型工厂获取该对象的副本。 以后需要更改具体的类或添加新的原型类&#xff0c;客户端代码无需改变&#xff0c;只需修改原型工…...

    2024/5/5 8:37:55
  6. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/5/4 23:54:56
  7. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/5/4 23:54:56
  8. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/5/4 23:54:56
  9. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/5/4 23:55:17
  10. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/5/4 23:54:56
  11. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/5/4 23:55:05
  12. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/5/4 23:54:56
  13. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/5/4 23:55:16
  14. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/5/4 23:54:56
  15. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/5/6 1:40:42
  16. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/5/4 23:54:56
  17. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/5/4 23:55:17
  18. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/5/4 23:55:06
  19. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/5/4 23:54:56
  20. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/5/4 23:55:06
  21. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/5/5 8:13:33
  22. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/5/4 23:55:16
  23. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/5/4 23:54:58
  24. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/5/4 23:55:01
  25. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/5/4 23:54:56
  26. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  27. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  28. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  29. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  30. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  31. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  32. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  33. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  34. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  35. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  36. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  37. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  38. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  39. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  40. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  41. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  42. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  43. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  44. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  45. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57