Expand training --find find, packing compression, server, disk mount

find find, compression packing

1. superuser (administrator user) is _ # prompt , prompt ordinary users is $ _.
2. How quickly return to a directory on where?
cd -
What 3.GNU, GPL that?
GNU的全称是GNU's Not Unix 最初由理查德·斯托曼为GNU计划而撰写。
优秀的项目: gcc gawk bash emacs

GNU GPL(GNU General Public License,通用公共许可证),
1.开源,可自由传播
2.可以任意修改,必须把修改之后的代码发布出来
4.linux shutdown restart command what?
关机 
shutdown -h now
init 0 
halt
poweroff
 重启 
shutdown -r 0 
Reboot
init 6
5. contains a mapping between domain names and IP addresses of files which?
/etc/hosts文件包含了IP地址和主机名之间的映射。

相关知识点:
/etc/resolv.conf文件指定如何解析域名。
/etc/networks文件用来指定服务器上的网络配置信息。
/etc/hostname文件包含了Linux系统的主机名,包括完全的域名。
6. queries only 5 to 15 rows of / etc / passwd file (see implemented in three ways)
head -15 /etc/passwd |tail - 11
sed  -n ‘5,15p’ /etc/passwd
awk  ‘NR==5,NR==15’/etc/passwd
7. create a linux partition, which must create two partitions?
/
/boot
swap
8. Statistics / etc / passwd file, a total of how many lines?
wc -l /etc/passwd
9. query / etc / passwd file contents line containing the root keywords (requires three methods)
grep -n ‘root’ /etc/passwd
awk '/root/' /etc/passwd
 sed -n '/root/p' /etc/passwd
10. explained the difference between soft and hard links?
1)创建命令不同 软链接:ln -s 硬链接:ln
2)目录不能创建硬链接,并且硬链接不可以跨越系统的分区,软链接可以
3)硬链接文件与源文件inode相同,软链接文件与源文件inode不同 
4)删除软链接文件,对源文件无影响,但是删除软链接源文件对软链接文件有影响 
5)删除硬链接文件,对源文件也无影响,并且删除源文件,对硬链接文件也无影响 
6)只有原文件和硬链接同时删除,原文件才真正删除
11. In the Linux system, the system used to store the desired profile directory?
/etc
12. What is the absolute path, what is the relative path?
绝对路径是以 / 为开头
相对路径不以 / 为开头的
13. Write command shortcuts vim and explain its action (at least 10)
gg :将光标移动到文件的开头 ,ngg就是移至n行行首
dd  :  删除一行,(删除多行 ndd dnd :n为数字 + p = 剪切)
D   :  将光标之后的内容都删除
u   :   撤销
$(shift+4) : 将光标移动至行尾
^(shift+6)  :  将光标移动至行首
dG   : 删除光标以下的所有内容(包括光标所在行)
yy :  复制,复制n 行,nyy ,yny
 p :  粘贴(光标所在行的下一行)
 R :  多个字符替换(按ESC退出替换)
14. Review the sshd port number corresponding to this service is.
netstat -lntup |grep sshd
ss -lntup |grep sshd
15. Edit / etc / passwd file, replacing all the strings / sbin / nologin to / bin / bash (use sed command)
sed -i ‘s#/sbin/nologin#/bin/bash#gp’ /etc/passwd
16. Create a regular user user01, uid 1099
useradd user01 -u 1099
17. Connect the question, to which the user login password is set to 123
echo 123 |passwd  --stdin user01
18. A user information file etc / passwd a ':' delimiter meaning, is divided into seven fields, wherein each field is representing
第1列 :用户账户名称 
第2列 :密码占位符,存放账户的口令 
第3列 :用户UID,用户标识号 
第4列 :用户GID,组标识号 
第5列 : 用户注释,用户详细信息 
第6列 :用户家目录,root家目录 
第7列 :用户登陆Linux使用的Shell
19. oldboy.txt file to set permissions to 600.
touch oldboy.txt
chmod 600 oldboy.txt
20. Oldboy to directories and all files and directories below the directory provided owner to www, is a group of oldboy.
mkdir oldboy 
useradd www
groupadd oldboy
chown  -R www.oldboy oldboy
21. The two users to view the newly added information systems?
Tail -2 /etc/passwd 
22. The rose was added to the root user group
Useradd -g root rose
23. The use of "ls -l /" to see the root of the long format, display the first ten file permissions information, write the meaning of each bit represents
文件类型        文件属主权限    文件所属用户组权限  其他用户权限      
(所属用户)      (所属用户组)
    d               r w x                r - x              r - x               
   目录   读写执行权限  读执行权限   读执行权限
24. The display content of the third row to row 10 (three methods) test.txt
cat test.txt| head |tail -8
awk  ‘NR==3,NR==10’ test.txt
sed  -n ‘3,10p’ test.txt
25. Change the permissions / web directory, any user can read and write, but is created in the / web directory any files that belong to the group www
chown .www /web
chmod 2777 /web
26. Enter df -h, remove the current system available disk space remaining root partition
df -h |awk ‘/\/$/{print $(NF-2)}’
27. The command input time "date" is output to the current system time in /data/date.txt
date >/data/date.txt 
28 using the "ls / ta" error outputted to the /data/error.txt
ls /ta 2>/data/error.txt
Input and output in the following explanation symbols 29 standard meanings linux <<<> >> 2> 2 >> &> & >>
<  : 输入
<< :追加输入
>   :标准输出重定向
>>  :标准输出追加重定向
2>  :错误输出重定向
2>> :错误输出追加重定向
&>  :共同输出重定向
&>> :共同输出追加重定向
30. The / etc / fstab file content redirected to the / tmp directory under the file name fstab.out
cat /etc/fstab > /tmp/fstab.out
Under 31 Find / etc / directory, all files .conf suffix, and displays the attribute information.
find /etc/  -name ‘*.conf’xargs ls -ld
32 to find the / var directory .log file for 7 days before, and displays the attribute information.
find /var -type f -mtime +7 -name ‘*.log’ -ls
1M and all files larger than an ordinary type file 33 to find / etc directory
find /etc -type f -size +1M  -ls
34 Find / directory under the file name contains txt file, and the time within seven days.
find / -type f -name ‘*txt*’ -mtime -7
35 Find / directory under the master is oldboy and is a group of files is oldboy
find / -type f -user oldboy -group oldboy  -ls
36 Find the / tmp directory next 15 days the previous file and delete
fing /tmp -type f  -mtime +15 -delete
37 Find all of the files in the root directory at the end of the rpm
find /  -type f -name ‘*rpm’
38. Use the rpm command to see if the installation tree command
 rpm -qa  tree
39 your mirrored device to hang on / data directory
mount/dev/cdrom /data/
40 using the tar command / data / files and directories under bak directory to the directory archive compression / data (name of the archive of his own name)
tar czf /data/gjy.tar.gz  /data/bak
41 uses a lower tar command to view the question / data directory within a compressed content package
 tar tf /data/gjy.tar.gz
42 will be compressed on the question, to the decompression / backup directory
 tar xf /data/gjy.tar.gz -C /root/backup
43 pack / etc directory of all files to the root ordinary user's home directory (Hint: find yourself drawn in conjunction with the use of tar, compressed package name)
find /etc -type f |xargs tar czf /root/oldboy.tar.gz
44 with the tar command to / etc / hosts file compression packing.
 tar czf hosts.tar.gz /etc/hosts
When using the tar command 45 pack / etc /, the root of a delete operation occurs, how packaging will not be deleted root operation
tar czPf etc.tar.gz /etc
或者cd /
46 pack / etc / directory, asked not to pack / etc / hosts file.
tar czf etc.tar.gz  --exclude=etc/hosts etc/
47 known /etc/grub2.cfg file is a soft link file, in case you do not know, ask how package source files of the file.
tar czhf grub2.tar.gz /etc/grub2.cfg
48 / var / log / directory of all .log file is packaged into a compressed, it is defined as the name of the compressed log.tar.gz.
find /var/log -type f  -name "*.log"  |xargs  tar czf log1.tar.gz 
49 install the service httpd
yum install -y httpd
50 view the contents inside the package httpd.
rpm -ql httpd
51 View netstat command belong to which package.
rpm -qf `which netstat`
或者yum provices  netstat
52 This command deletes the system sl
rpm -e sl
或者yum remove sl -y
53 to see what's available yum source repository in your server has.
yum repolist
The display system 54 can be installed in packages beginning tre
yum list |grep ^tre
yum list tre*
55 This command updates the system tree.
yum update tree -y
56 Please complete a command to create the directory / oldboy / test, that is, create / oldboy directory and / oldboy / test
mkdir -p /oldboy/test
57 See ett.txt file (100 lines total) content of 20 to 30 of the row (three methods)
head -30 ett.txt|tail -10 
awk ‘NR==20,NR==30 ’ett.txt
sed -n‘20p,30p’ett.txt
All the strings 58 / oldboy all directory and its subdirectories to the end of the extension .sh file, the file containing Oldboy replace oldgirl (two ways)
find /oldboy  -type f -name “*.sh”|xargs sed -i‘s#oldboy#oldgirl#g’
sed -i‘s#oldboy#oldgirl#g’$( find /oldboy  -type f -name “*.sh”)
59 pairs / etc performs packing, the time required to bring the attribute information, for example: 19_04_28_etc.tar.gz
tar czf   `date +%y_%m_%d`_etc.tar.gz  /etc
60 How to filter out all the parent directory (Tip: Do not include subdirectories oldboy directory and directory hidden directory that can only be a first-level directory) oldboy is known under the current directory?
find /etc ! -name ".*" -type d -maxdepth 1
或者 ll /oldboy
Tree -L 1 -d
ll / |grep ^d
61 when debugging system services, hoping to see the real-time system log var / log / messages updated /, how to do?
tail -f /var/log/messgaes
62 print configuration file / etc / passwd line number and contents of the content, what to do? (Two ways)
cat -n /etc/passwd
less -N /etc/passwd
grep -n ‘.’ /etc/passwd
63 What command to restart the network card is?
systemctl restart network
ifdown ens33 && ifup ens33
64 dns system configuration file which a few, what's the difference?
/etc/sysconfig/network-scripts/ifcfg-ens33  重启生效
/etc/resolv.conf                                立即生效
How 65centos system to modify the host name, such as modifying web, and its rapid entry into force.
hostnamectl set-hostname web 临时和永久都生效
66 swap use the command passwd root file location and / bin / bash position? All upcoming first column and the last one exchange position
root:x:0:0:root:/root:/bin/bash 
bin:x:1:1:bin:/bin:/sbin/nologin 
daemon:x:2:2:daemon:/sbin:/sbin/nologin
awk -F : '{print $7":"$2":"$3":"$4":"$5":"$6":"$1}' /etc/passwd
67 Extended problem: Print three days of the date format as: 2019-04-26
date -d “-3 day” +%F 
68 translated title
01).command not found               命令没有找到
02).No such file or directory           找不到文件或者目录
03).Permission denied                   权限不足
04).No space left on device             磁盘没有空间
05).File exists                             文件已存在
06).Is a directory                          是一个目录
07).Not a directory                     不是一个目录
08).Warning: Changing a readonly file           警告:正在修改一个只读文件
09).Found a swap file by the name ".1.swp"      找到一个临时文件名字是1.swp
10).unrecognized option '--oldboy'                  不能识别的选项—oldboy
69 known file test.txt content

the Test
lidao
Oldboy

Please give an output file test.txt content, it does not contain the command oldboy string. (three methods)

egrep –v oldboy test.txt
awk  '!/oldboy/' test.txt
Sed  's/oldboy/g' test.txt
70 ifconfigeth0 known to perform the following will result in claim ip address 10.0.0.101 taken (two ways)
ifconfig ens33 | sed '2s#.*t (.*)  n.*#\1#gp' –rn
ifconfig ens33 | awk 'NR==2{print $2}'

Server part

1. Appearance divided according server: rack-mounted servers, blade servers, server tower.

2. What are the procedures, processes and daemons?

程序: c/php/java,代码文件,放在磁盘中的数据。

进程: 正在运行的各类程序,进程运行就是把程序放在内存里执行。

守护进程(daemon): 持续保持运行着的程序。

3. What is a buffer? What is cache?

缓冲区(buffer)
将数据写入到内存中,这个存放数据的内存空间在linux系统中一般被称为缓冲区(buffer),例如:写入到内存缓冲区,即写缓冲。

缓存区(cache)
从内存里读取数据,这个存放数据的内存空间在linux系统中一般被称为缓存区(cache),例如:从内存读取,即读缓存

4, the data conversion unit, 1PB = 1024TB = 1024 * 1024GB = 1024 ^ 3MB = 1024 ^ 4 KB = 1024 ^ 5 B.

5, to talk about the raid and the level of features and application scenarios?

常见的Raid级别有Raid0,Raid1,Raid5,Raid10级别的

6, common Unix system version on the enterprise (not less than five kinds).

ubuntu
redhat
centos
debian
红旗
麒麟
fedora

7. What is the GNU and GPL

GNU的全称是GNU's Not Unix 最初由理查德·斯托曼为GNU计划而撰写。GNU的全称是GNU is nort unix .
优秀的项目: gcc gawk bash emacs

GNU GPL(GNU General Public License,通用公共许可证),
1.开源,可自由传播
2.可以任意修改,必须把修改之后的代码发布出来

8, Linux used in three major areas which?

IT 服务器端
嵌入式开发平台
个人PC桌面

9, the installation of the system, how to partition (memory is 8G, the disk is 200G)?

/boot:500-1024M
Swap:8-16G 
/:剩余所有内存

10, which are virtual network model have?

NAT 模式
仅主机模式
桥接模式

11, Windows above remote connectivity tools which (at least two kinds of writing)

xshell
secureCRT
putty
Mac(item2)

12, under normal circumstances the external network, the virtual machine can not get online, what is your idea of ​​investigation

1.检查Linux的ip配置,测试ip地址是否通畅
2.测试网关   ping 10.0.0.250
3.测试DNS   ping 223.5.5.5
4.ping baidu.com

13, has just installed a virtual machine with a remote connection tool to connect, but not connected, how you solve, ideas to write.

1.在虚拟机里查看ip地址
2.在本地测试进行测试该ip是否通畅
3.检查ssh服务的端口是否开启  telnet 10.0.0.100 22
4.防火墙及selinux关掉
services.msc

14, talk about shortcuts you know linux command line and gives effect (not less than 8)

ctrl+a      将光标跳转至行首
ctrl + e    将光标跳转至行末          
ctrl + w    以空格为单位,将当前光标位置之前的内容删除 
ctrl +u     将当前光标位置之前的内容全部删除
ctrl +k     将当前光标位置之后的内容全部删除
ctrl + l    清屏 
ctrl + c    终止当前命令
ctrl + d    退出当前会话窗口,断开当前连接(exit,logout)
ctrl + z    将当前前台运行的程序,放后台执行
ctrl + r    搜索历史命令
ctrl+s      锁屏

15, the system of command and which of help? There must be an example

help   ls --help
man     man ls
info    info ls

16, the command line, write three kinds shutdown command a restart command?

关机:
shutdown -h now
init 0
poweroff 
halt
重启:
reboot

17, write command to see only eth0 card information

ip a s ens33
ifconfig

18, if I'm in the / directory, and then perform the following actions in the current, final directory location where I was: cd / etc / sysconfig /; cd ..; cd ..; cd -; cd ..

/

19, batch create oldboy01, oldboy02, ... oldoby05 these directories and creates conf directory in the list below. Please use a command to complete

mkdir -p oldboy{01..05}/conf

20, talk about the meaning of ①HWADDR card configuration file for each line = 00: 0c: 29: fe: f9: 8a; ②DEVICE = eth0; ③ONBOOT = yes; ④TYPE = Ethernet; ⑤BOOTPROTO = none; ⑥IPADDR = 10.0.0.200; ⑦NETMASK = 255.255 .255.0; ⑧GATEWAY = 10.0.0.2; ⑨DNS1 = 223.5.5.5. (4 points)

1. HWADDR=00:0c:29:90:89:d9    Mac地址 
2. DEVICE=eth0      设备名称
3. ONBOOT=yes       开机自启动
4. TYPE=Ethernet    网络类型 以太网
5. BOOTPROTO=none    手动static
    a. dhcp 自动获取ip地址
    b. none 固定的ip地址
    c. static 固定的ip地址
6. IPADDR=10.0.0.100 IPADDR     ip地址
7.  NETMASK=255.255.255.0     子网掩码 决定这个局域网中最多有多少台机器
 8. GATEWAY=10.0.0.2    网关 整个大楼的大门
9. DNS1=223.5.5.DNS   DNS域名解析器

21, modify the command line command hostname?

hostnamectl set-hostname name
 临时和永久都生效
    

22, set the variable name = oldboy, after canceling a variable, use the command to achieve.

name=oldboy
echo $name
export name=oldboy

23, the stored content of 5 to line 15 of the / etc / passwd file into the /oldboy/test.txt, (no less than three methods)

touch /oldboy/test.txt
awk 'NR==5,NR==15' /etc/passwd > /oldboy/test.txt
sed -n '5,15p' /etc/passwd > /oldboy/test.txt
 head -15 /etc/passwd|tail -10 > /oldboy/test.txt

24, when the debugging system services, hoping to see the real-time system log / var / log / messages updated, how to do?

tail -f /var/log/messages

25, to see how the system is turned on port 22, sshd process and see if there is?

netstat -lntup
ps -ef |grep sshd

26, the filter / etc / services file containing the contents of the line 3306 or 1521 is located two numbers. (Not less than three methods)

grep -E '3306|1521' /etc/services
awk '/3306|1521/' /etc/services
 sed -rn  '/3306|1521/p' /etc/services

27, to talk about the meaning of these special symbols:> >> <<< # .. ~ * |; && || &!

>  标准重定向输出
>> 标准重定向追加输出
<  标准输入
<<   cat >> test.txt <<eof
#   超级用户标示符   注释 
..  当前目录的上层目录
~  当前用户家目录
*  所有
|   管道符
;  两条命令分隔符,不管前面执行成功或失败,都会执行后面
&&  两条命令分隔符,前面执行成功,才会执行后面命令,前面失败,会报错
||  前面命令执行失败,才会执行后面命令
! 非,快速执行指定的命令
\ 转义符
& 把服务或者程序放在后台运行

28, in the modified time / data directory is 7 days ago, and to copy files larger than 100k / tmp directory. (Not less than three methods)

[root@gjy ~]# find /data -type f -mtime +7 -a -size +100k |xargs -I {} cp /tmp{}
find /data -type f -mtime +7 -a -size +100k |xargs} cp -t /tmp

29, write redhat, configure the LAN and dns configuration file what is? And explain the difference?

/etc/sysconfig/network-scripts/ifcfg-ens33   重启生效
/etc/resolv.conf   立即生效

30, listed below linux common packaging tools and write the corresponding compression and decompression parameters (two kinds)

⒈Gzip:不能压缩目录,参数:-r 递归压缩
Zcat:查看压缩文件内容;
Gzip -d 解压
⒉tar:参数

31, Linux file permission a total of 10 lengths, each representing what?

-rw-r--r--. 1 root root  334205 Jul 11 20:09 nginx-1.16.0.tar.gz
-:文件类型(-:普通文件;d:文档;c:块儿设备;l:链接文件;s:socket套接字)
rw-属主权限(r:读,代表数字:4;w:写,代表数字:2;x:执行,代表数字:1)
r--属组权限(r:读,代表数字:4;w:写,代表数字:2;x:执行,代表数字:1)
r--其他用户权限(r:读,代表数字:4;w:写,代表数字:2;x:执行,代表数字:1)

32, soft and hard links connecting difference (creation, meaning the difference, delete aspects)

1. 参数:软连接必须加-s;硬链接不用加参数;
2. 删除:删除软连接对源文件不影响,删除源文件,软连接也被删除;删除源文件不影响硬链接,删除硬链接不影响源文件
3. 软连接就是源文件的快捷方式;硬链接是源文件的复制黏贴版。
4. 软连接可以连接目录,硬链接不能连接目录。

33, the difference between single and double quotation marks without quotes

单引号:所见即所得,即将单引号内的内容原样输出。
双引号:所见即所得,把双引号里面的内容给输出出来,会解析里面的变量,特殊字符。
无引号:所见即所得,如果空格,不会看做一个整体,会解析里面的变量,特殊字符,支持通配符。

34, nginx access log access.log statistics for each visit ip largest number of occurrences 10. (In the first column is known ip)

[root@gjy ~]# awk '{print $1}' /usr/local/nginx/access.log|sort|uniq -c|sort -rn|head

35, give the following format command Example date: 18-02-26. Please give the command.

date +%y-%m-%d

36, three days before the print date format as: 2018-02-26 Give the command.

date -d "-3day" +%F

37, translation

01).command not found  命令找不到
02).No such file or directory  没有这个文件或目录
03).Permission denied  权限不足
04).No space left on device   设备空间不足  
05).File exists 文件已存在
06).Is a directory   这是一个目录
07).Not a directory   这不是一个目录
08).Warning: Changing a readonly file  警告:更改只读文件
09).No route to host   没有主机路径
10).connection refused    连接拒绝
11).Access denied     拒绝访问

38, 755 authorized oldboy directory and its subdirectories permission given command?

chmod -R 755 /oldboy/

39, the oldboy directory and its sub-groups belong to the owner changed oldboy please give the command.

chown -R oldboy.oldboy /oldboy

40, talk about you know vim inside the command and write mean. (Not less than 10)

Ngg:(N为数字),将光标快速跳转至第N行;
G:将光标快速跳转至文件行首;
d:删除光标所在行;
Nyy:复制N行内容;
^:将光标快速跳转至第N行行首;
$:将光标快速跳转至第N行行末;
i:从命令模式进入编辑模式;
I:在当前光标所在行的行首插入字符;
A:在当前光标所在行的行末插入字符;
u:撤回;
p:在当前行所在位置的上一行进行复制;
P:在当前行所在位置的上一行进行复制;

41, a detailed description of the function and meaning of umask.

进程掩码:改变文件权限;目录默认权限为:755,文件的权限是:644。
当umask三位数都为偶数时,对目录及文件都为:777-umask;
当umask三位数都为奇数时,对目录:777-umask;对文件:777-umask+111;
当umask三位数后两位为奇数时,对目录:777-umask;对文件:777-umask+11;
当umask三位数后一位为奇数时,对目录:777-umask;对文件:777-umask+1;

42, all blank lines oldboy.txt delete the file, there are tab keys and the space (two ways) and some blank lines inside

awk NF a.txt
sed -r '/^[ \t]*$/d' a.txt
awk '!/^[ \t]*$/' a.txt

Disk mount and single-user mode

1 mounted to the / data directory

[root@gjy ~]# mkfs.xfs /dev/sdd     #格式化并创建文件系统
meta-data=/dev/sdd               isize=512    agcount=4, agsize=13107200 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=52428800, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=25600, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@gjy ~]# mkdir /data          #/目录下创建data 目录
[root@gjy ~]# mount /dev/sdd /data     #把sdd分区挂载到/data下
[root@gjy ~]# df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda3       19399680 2232940  17166740  12% /
devtmpfs         1012904       0   1012904   0% /dev
tmpfs            1023744       0   1023744   0% /dev/shm
tmpfs            1023744    9116   1014628   1% /run
tmpfs            1023744       0   1023744   0% /sys/fs/cgroup
/dev/sda1         508580  122100    386480  25% /boot
tmpfs             204752       0    204752   0% /run/user/0
/dev/sdd       209612800   32992 209579808   1% /data

2. A directory to store a "docs.txt"

[root@gjy ~]# dd if=/dev/zero of=/data/docs.txt
[root@gjy ~]# ll /data
total 7072008
-rw-r--r--. 1 root root 7241732608 Jul 17 00:41 docs.txt

3. To achieve the boot mount (please test)

[root@gjy ~]#  vim /etc/fstab        #编辑永久挂载
[root@gjy ~]# tail -1 /etc/fstab     #查看
/dev/sdd                /data             xfs     defaults        0 0
#reboot重启
#重启后查看
[root@gjy ~]# df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda3       19399680 2233128  17166552  12% /
devtmpfs         1012904       0   1012904   0% /dev
tmpfs            1023744       0   1023744   0% /dev/shm
tmpfs            1023744    9124   1014620   1% /run
tmpfs            1023744       0   1023744   0% /sys/fs/cgroup
/dev/sdd       209612800 7105000 202507800   4% /data
/dev/sda1         508580  122100    386480  25% /boot
tmpfs             204752       0    204752   0% /run/user/0

4. Prepare a 200GB of disk space

The lower mount / data_read directory

[root@gjy ~]# umount /dev/sdd
[root@gjy ~]# df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda3       19399680 2232932  17166748  12% /
devtmpfs         1012904       0   1012904   0% /dev
tmpfs            1023744       0   1023744   0% /dev/shm
tmpfs            1023744    9120   1014624   1% /run
tmpfs            1023744       0   1023744   0% /sys/fs/cgroup
/dev/sda1         508580  122100    386480  25% /boot
tmpfs             204752       0    204752   0% /run/user/0
[root@gjy ~]# mkdir /data_read
[root@gjy ~]# mount -r /dev/sdd /data_read
[root@gjy ~]# df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda3       19399680 2232952  17166728  12% /
devtmpfs         1012904       0   1012904   0% /dev
tmpfs            1023744       0   1023744   0% /dev/shm
tmpfs            1023744    9120   1014624   1% /run
tmpfs            1023744       0   1023744   0% /sys/fs/cgroup
/dev/sda1         508580  122100    386480  25% /boot
tmpfs             204752       0    204752   0% /run/user/0
/dev/sdd       209612800 7072232 202540568   4% /data_read

6. Can not write files to / data_read directory

[root@gjy ~]# mount -r /dev/sdd /data_read
[root@gjy ~]# dd if=/dev/zero of=/data_read/test.txt bs=10M count=50 
dd: failed to open ‘/data_read/test.txt’: Read-only file system

Guess you like

Origin www.cnblogs.com/gongjingyun123--/p/11209487.html