Linux 124 Lesson 14, accessing the Linux file system

Source: Internet
Author: User

, identify file system hierarchies
Storage device--block device/storage location dev/

Disk naming rules, when the system checks for physical devices
  
SCSI/STAT/USB First Disk/DEV/SDA
Second hard drive/dev/sdb
  
Virtual Disk/dev/vda/dev/vdb
  
Fdisk-l View all disks
/dev/sda
/DEV/SDA1 First partition on first disk
/DEV/SDB3 a third partition on the second disk
  
Df-h T System File system specific information, you can view the Mount situation
Du-h/etc/View disk footprint
  
2. Mount and unmount the file system
Partition capacity is still unusable and must be mounted if it is allocated and not mounted
  
To access a disc:
Df-ht you can see the location of the inserted disc, you can view the default mount point
  
The default mount point is not saved after a reboot, and you need to manually create a mount point to mount
Disc Type: iso9660
Default location:/dev/sr0/dev/cdrom
  
(1) Temporary mounting
Mount-t iso9660/dev/sro0/mnt
  
umount/mnt/If you cannot uninstall using the lsof command to view the process
LSOF/MNT See which process is consuming the/mnt/file
Kill-9 1517 kills 1517 processes, then unloads

(2) Permanent mount, import into config file, still valid after reboot
Vim/etc/fstab
/DEV/SR0 (uuid available)/mnt iso9660 defaults 0 0
  
UUID through a unique identification code
Blkid See UUID
  
Mount-a Find Fstab
  
Mount the hard drive,
Partitioning and formatting of disks in the 134 course
  
Lab FS Setup Instructional scripts
Rht-vmctl Fulreset Server
  
Vim/etc/fstab
Uuid= ""/disk1 xfs defaults 0 0
Mount-a
  
3. Use hard links and symbolic links
  
Hard Links:
(1) When the data is stored, it has the same inode node, but stores two copies of the same data;
Sector 512 bytes Data is stored in the smallest unit of block 8 sectors for a fast (4 bytes)
Meta information (creator, creation date, size) stored in Inode node (index node)
Ll-li I view inode nodes
  
Touch File1
echo Date >file1
ln file1/tmp/file1 Creating a hard link
  
Ll-li/file1
Ll-li/tmp/file1
  
Hard links cannot be implemented across regions;
Use Inode data from one disk
  
Cannot make hard links to directories;

Soft Links: Shortcuts
  
Ln-s/usr/local AA
  
Ll-li/usr/local
Ll-li/root/aa
If the source file is deleted, the linked file fails

One file changes and the other changes

(4) You can make a soft link to the directory
  
Usage Scenario: Hard Link: Data backup

4. Search for files in the file system
(1) Locate find data in locate database, locate data need to be refreshed manually
  
Touch File1
cd/tmp/
The newly created file, which is not written to the locate database, requires a manual update of the database UpdateDB
  
UpdateDB

Find/tmp-name File2
Find/-USESR Student
Find/-type L
Find/-perm 777
Find/-size +100m
Find/-mmin 30
Find/-exec Execute next command
Find/-user student-exec scp-rf {}/tmp/\;
  
Force recursion {} represents the previous search result

Linux 124 Lesson 14, accessing the Linux file system

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.