Access to devices in 14.linux

Source: Internet
Author: User

One Device access
1. Equipment identification
/DEV/XDXN # #硬盘设备/DEV/SDA1
/dev/cdrom # #光驱
/dev/mapper/* # #虚拟设备

2. Use of the device
# # "Discovery of Equipment" # #
Fdisk-l # #查看真实存在的设备
Cat/proc/partitions # #系统能够识别的设备
Blkid # #系统能够挂载使用的设备id
DF # #查看设备被系统使用的情况

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/91/C8/wKioL1j4WEjii0vYAABnMrFq7nY662.png-wh_500x0-wm_ 3-wmp_4-s_3546228878.png "style=" Float:none; "title=" screenshot from 2017-04-18 14-01-13.png "alt=" Wkiol1j4wejii0vyaabnmrfq7ny662.png-wh_50 "/>

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/91/C8/wKioL1j4WEmxwD7bAABLKd6npWI518.png-wh_500x0-wm_ 3-wmp_4-s_755952794.png "style=" Float:none; "title=" screenshot from 2017-04-18 14-01-44.png "alt=" Wkiol1j4wemxwd7baablkd6npwi518.png-wh_50 "/>

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/91/C8/wKiom1j4WEnxM2LOAABmhYGwRWA815.png-wh_500x0-wm_ 3-wmp_4-s_3921239757.png "style=" width:232px;height:200px; "title=" screenshot from 2017-04-18 14-02-34.png "Width=" 232 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" wkiom1j4wenxm2loaabmhygwrwa815.png-wh_50 "/>

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/91/C8/wKiom1j4WEqTWWdpAABtTMYFtaM866.png-wh_500x0-wm_ 3-wmp_4-s_4015143353.png "style=" Float:none; "title=" screenshot from 2017-04-18 14-03-13.png "alt=" Wkiom1j4weqtwwdpaabttmyftam866.png-wh_50 "/>

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/91/C8/wKiom1j4WEqj9HZjAACPHp9Ovis209.png-wh_500x0-wm_ 3-wmp_4-s_1054975882.png "style=" Float:none; "title=" screenshot from 2017-04-18 14-03-43.png "alt=" Wkiom1j4weqj9hzjaacphp9ovis209.png-wh_50 "/>

# # "Use of equipment" # #
1. Mounting of the device
Mount Device mount point
Mount/dev/sdb1/mnt #把系统中第二块硬盘的第一个分区挂载到 the/mnt directory


650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/91/C9/wKiom1j4WSbjo1CAAACzzQhTyPI319.png-wh_500x0-wm_ 3-wmp_4-s_1583797885.png "style=" Float:none; "title=" screenshot from 2017-04-18 14-08-10.png "alt=" Wkiom1j4wsbjo1caaaczzqhtypi319.png-wh_50 "/>

2. Uninstalling the device

Umout Equipment | mount point

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/91/C8/wKioL1j4WSWRW_DHAADp7A6FvVU880.png-wh_500x0-wm_ 3-wmp_4-s_3373342714.png "title=" screenshot from 2017-04-18 14-07-51.png "style=" Float:none; "alt=" wKioL1j4WSWRW_ Dhaadp7a6fvvu880.png-wh_50 "/>
If the following conditions occur:
[Email protected] ~]# UMOUNT/DEV/SDB1
Umount:/home/kiosk/desktop/photo:target is busy.
(In some cases useful info aboutprocesses this use
The device is found by lsof (8) or fuser (1))
Solve:
FUSER-KVM Device | mount point-K kill,-V show details,-m scan device
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/91/C8/wKioL1j4WSfSFoF2AAKbNs57Uic650.png-wh_500x0-wm_ 3-wmp_4-s_2677863096.png "title=" screenshot from 2017-04-18 17-44-12.png "style=" Float:none; "alt=" Wkiol1j4wsfsfof2aakbns57uic650.png-wh_50 "/>
# # # #2. Soft and Hard Links # # #
Ls-i # #查看文件节点号
Ln-s/file/file1 # #软链接 multiple nodes corresponding to a block of data

Ln/file/file1 # #硬链接 A node corresponds to multiple blocks of data

A hard link is a copy of the file in order to save the device node number

Soft links When file shortcuts, in order to save device storage fast

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/91/C8/wKioL1j4Wcvy9tyuAADTxmTzQkc505.png-wh_500x0-wm_ 3-wmp_4-s_437814914.png "style=" Float:none; "title=" screenshot from 2017-04-18 18-06-13.png "alt=" Wkiol1j4wcvy9tyuaadtxmtzqkc505.png-wh_50 "/>

Hard links Delete one file and another can find

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/91/C9/wKiom1j4WcyjBQ65AADAl3BUA-k589.png-wh_500x0-wm_ 3-wmp_4-s_4191660052.png "style=" Float:none; "title=" screenshot from 2017-04-18 18-06-44.png "alt=" Wkiom1j4wcyjbq65aadal3bua-k589.png-wh_50 "/>

Soft connection Delete one file, another cannot be found, cannot find


# # # #3. File Search # # #
1.locate filename # #在文件数据库中搜索filename信息, updatedb update file database

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/91/C8/wKioL1j4W2KRypVnAABtqs2DdJQ283.png-wh_500x0-wm_ 3-wmp_4-s_3974690634.png "title=" screenshot from 2017-04-18 18-08-51.png "style=" width:358px;height:200px; "Width=" 358 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" wkiol1j4w2krypvnaabtqs2ddjq283.png-wh_50 "/>

2.find

Find Lookup Location-condition condition value-exec action {} \;

-exec  command {} \; # # #对查找出的结果做相应处理

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/91/CA/wKioL1j4YWiwfoyyAABcVz23zTg606.png-wh_500x0-wm_ 3-wmp_4-s_2498175442.png "title=" screenshot from 2017-04-18 19-24-08.png "alt=" Wkiol1j4ywiwfoyyaabcvz23ztg606.png-wh_50 "/>

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/91/CB/wKiom1j4YiPhaIV4AACO899VQUQ962.png-wh_500x0-wm_ 3-wmp_4-s_2063850856.png "title=" screenshot from 2017-04-18 19-24-44.png "alt=" Wkiom1j4yiphaiv4aaco899vquq962.png-wh_50 "/>

Copy the files in the root directory to the/mnt/mailbackup/group Mail

-name

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/91/C9/wKiom1j4W2jykfXnAACq3MRuOoU057.png-wh_500x0-wm_ 3-wmp_4-s_474038596.png "title=" screenshot from 2017-04-18 19-15-00.png "style=" Float:none; "alt=" Wkiom1j4w2jykfxnaacq3mruoou057.png-wh_50 "/>-not
-user Users
-group Group

-A and relationship
-O or relationship

650) this.width=650; "Src=" Https://s4.51cto.com/wyfs02/M01/91/C9/wKiom1j4W2LBRl7ZAADY3DoN2W8145.png-wh_ 500x0-wm_3-wmp_4-s_2594563449.png "title=" screenshot from 2017-04-18 18-38-53.png "style=" width:339px;height:300px; " Width= "339" height= "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" wkiom1j4w2lbrl7zaady3don2w8145.png-wh_50 "/>

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/91/C8/wKioL1j4W2PQ5pLOAACkgkRS5Z0516.png-wh_500x0-wm_ 3-wmp_4-s_1927121736.png "title=" screenshot from 2017-04-18 18-39-15.png "style=" Float:none; "alt=" Wkiol1j4w2pq5ploaackgkrs5z0516.png-wh_50 "/>

-size Numbers |-Digital |+ NUMBER # # #查找大小符合条件的文件

--maxdepth Max Depth
--mindepth min. depth

Create a file first

DD If=/dev/zero of=/mnt/file1 bs=1024 count=10
DD If=/dev/zero of=/mnt/file2 bs=1024 count=20
DD If=/dev/zero of=/mnt/file3 bs=1024 count=30

DD # #数据截取
If # #数据模板
of # #数据存放文件
BS # #数据快大小
Count # #数据快个数


650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/91/C9/wKiom1j4W2OCvfdLAABV2mKSWGA260.png-wh_500x0-wm_ 3-wmp_4-s_2929926318.png "title=" screenshot from 2017-04-18 18-53-22.png "style=" width:428px;height:250px; "Width=" 428 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" wkiom1j4w2ocvfdlaabv2mkswga260.png-wh_50 "/>

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/91/C8/wKioL1j4W2Px3KHSAABHlUsn6Tc973.png-wh_500x0-wm_ 3-wmp_4-s_3119776664.png "title=" screenshot from 2017-04-18 18-53-40.png "style=" Float:none; "alt=" Wkiol1j4w2px3khsaabhlusn6tc973.png-wh_50 "/>

--perm 444 # # #文件全权必须是rrr
--perm-444 # # #文件每一位都要含有r权限
--perm/444 # # #文件任意一位含有r权限

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/91/C8/wKioL1j4W2PAVX93AABfrD3n8R8630.png-wh_500x0-wm_ 3-wmp_4-s_2868975180.png "title=" screenshot from 2017-04-18 19-01-43.png "width=" 310 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:310px;height:250px; "alt=" Wkiol1j4w2pavx93aabfrd3n8r8630.png-wh_50 "/>

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/91/C9/wKiom1j4W2Ti57GcAACOfHorzX4660.png-wh_500x0-wm_ 3-wmp_4-s_915273600.png "title=" screenshot from 2017-04-18 19-05-54.png "style=" Float:none; "alt=" Wkiom1j4w2ti57gcaacofhorzx4660.png-wh_50 "/>



-type F File
Catalog D
C-Character device
B-Block Equipment
s set of section words
L Link
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/91/C8/wKioL1j4W2eze_qAAAAYzVouFcY395.png-wh_500x0-wm_ 3-wmp_4-s_175659581.png "style=" Float:none; "title=" screenshot from 2017-04-18 19-07-17.png "alt=" WKioL1j4W2eze_ Qaaaayzvoufcy395.png-wh_50 "/>

Change permissions


650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/91/C8/wKioL1j4W2iyHfLPAABt-TJi-Zg382.png-wh_500x0-wm_ 3-wmp_4-s_3301237615.png "style=" Float:none; "title=" screenshot from 2017-04-18 19-16-49.png "alt=" Wkiol1j4w2iyhflpaabt-tji-zg382.png-wh_50 "/>






Access to devices in 14.linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.