1, DescriptionLiuxThe difference between a soft link and a hard link
The Create command is different, LN command to create a hard link, ln-s Create a soft link
Inode different node numbers, hard links Inode same as source file, soft link Inode different from source file
With different objects, hard links can only be used for files, and soft links may be used for files and directories
Delete source file effect is different, after the source file is deleted, hard link is not affected, soft link invalidation (red white blinking)
The link range is different. Soft links can cross file system, hard link No
Add:
Delete linked files, no impact on source files
Deleting the source file and its hard-linked files will delete the entire file.
Many of the snapshot features in a hardware device, using a hard-link-like principle
2 , Linux Shell single quotes, double quotes, and simple differences without quotes
Single quotes: What you see is what you get
double quotation marks: The variable or command is parsed first. Need to mate with anti-quotes or $ ()
No quotes: same double quotation mark
3 , Linux the principle of file deletion
1. In layman's words:
I_link (number of hard links to the file) and I_count (the number of processes using the file) is 0 , the file is deleted
2, the specific said:
The file name is stored in the top-level directoryBlockdelete files, essentially from the directoryBlcokDelete file name, this does not change filesInodeand theBlockdata in the. Just when the file is not pointing to its correspondingInode, its originalInodeand theBlockwill be released until it is used to store its files and data. So, to delete a file, you need the directory for that fileBlock, so you need permission to the directory. However, for this directory there arerwxpermissions, not necessarily to the file also have this permission, but also to see the specific permissions of the file.
3. Precautions
if the file that the process is using is deleted, the file's Block will not be released, just restart the process.
4 , SSH Service not connected, how to troubleshoot
1, two of the machine is unobstructed, look at the physical network (LAN cable network card, IP is not correct)
ping-ip-t Detection
Does not pass:
a , client-to-server physical link problem
network card, IP , network cable, firewall
2, the service is good
SSH whether the service is good
telnet Address Port (server's IP and the Port )
Does not pass:
a , server-side firewall blocking
/etc/init.d/iptables stop
b , the port is not open, the server does not listen to the port you are connected to
Netstat-lntup | grep ( SSH Service A Port as an example)
Netstat-lntup | grep sshd
/etc/init.d/sshd restart
5 , a 100M ( 100000K ) is written to the disk partition, respectively 1K the file or write 1M the number of files that can be written separately
mainly look Block the size of the block, assuming Block block size is 4K , you
1K File: 25000 a
1M File: - a
6 , if you write data to disk, you are prompted with the following error: No space left on device, through df-h View disk space, found not full, So what is the probable cause? What situations can cause this problem to occur in an enterprise scenario?
Inode The nodes are running out.
If there are many fragmented log small files that are not cleaned up, it may occur
7 , brief RAID0 , RAID1 , RAID5 working principle and characteristics of three kinds of working modes
1, RAID0
Split data sequentially in bits or bytes, parallel read/write on multiple disks, high data transfer rate, but no redundancy
2, RAID1
data redundancy is achieved through disk data mirroring, resulting in mutually backed-up data on paired independent disks. Provides high data security and availability, but disk space utilization is the same, read performance is improved (<n), write performance is Flixbox write performance
3, RAID5
distributed parity of the independent disk structure, its parity code exists on all disks, any one hard disk damage, can be based on the other hard disk check bit to reconstruct the damaged data. Read performance for (n-1)/n, write performance (n-1)/n
4. RAID The summary ( 0,1,5,10 )
redundancy from high to Low: raid1,raid10,raid5,raid0
Performance from high to Low:
read: RAID0 =raid10= RAID5 (approximate RAID0 ) >raid1
Write: RAID0>RAID5>RAID1=RAID10
cost from high to Low: raid1=raid10>raid5>raid0
8 , how to add the script to the system service, implement Serivec called
1. Write a script to move it to /etc/init.d/ directory under
2, the script must set the start level, start order, stop order
3, Chkconfig Add a program
Linux Exercises-3 file and disk Quiz