Take notes on laruence's private kitchen (the third edition of basic)

Source: Internet
Author: User
Tags uncompress
The most traditional disk file system (filesystem) in Linux uses EXT2. centos5 supports EXT3 and 6 supports EXT4. The file system includes the following three parts: 1: superblock: record the overall information of this filesystem, including inode /... the most traditional disk file system (filesystem) in Linux uses EXT2. centos5 supports EXT3 and 6 supports EXT4. The file system consists of the following three parts: 1: superblock: record the overall information of this filesystem, including the total amount of inode/block, usage, remaining amount, and file system format and related information; 2: inode: records the attributes of an archive. an archive occupies one inode and records the block number of the archive data. 3: block: actually records the archive content, if the file size is too large, multiple blocks are occupied. The number of inode and block is large and cannot be easily managed. Therefore, the Ext2 file system is basically divided into multiple block groups during formatting. each block group has an independent inode/block/superblock system. Dumpe2fs [-bh] device File name: query information related to superblock for each block. Df: list the total disk usage of the file system.-h: GBytes, MBytes, KBytes, and other formats are displayed.-I: displays the disk capacity instead of the inode quantity. Du: Evaluate the disk usage of the file system (usually used to estimate the directory capacity ). -S: list the total capacity, rather than the usage of each directory. Ln: hard connection and symbolic connection. If the parameter is not a hard connection, the parameter-s is used as the symbolic connection, that is, the shortcut. When adding a hard disk to the system, you must perform the following operations: 1. split the disk to create available partitions; 2. format the partition ), to build the filesystem available for the system; 3. if you want to be careful, you can check the filesystem you just created; 4. on the Linux system, you need to create a mount point (that is, a directory) and mount it. Fdisk-l lists the system disks. Fdisk disk directory (main directory, without symbols) for disk operations, n New, d deleted, p displayed on the screen disk partition, q does not store left, w writes the previous action to the split table. Finally, execute partprobe <= to force the core to catch the partition table again. Mkfs-t vfat/dev/hdc6: format/dev/hdc6 to a windows-readable vfat format. Mke2fs is also formatted with many parameters. Fsck-C-f-t ext3/dev/hdc6, -l show all mounting file Example 3: Will you use it to install Linux? Mount the original CentOS CD! [Root @ www ~] # Mkdir/media/cdrom [root @ www ~] # Mount-t iso9660/dev/cdrom/media/cdrom [root @ www ~] # Mount/dev/cdrom/media/cdrom example 6: mount/again ,? Question about yuar? Rw does not auto [root @ www ~] # Mount-o remount, rw, auto/[root @ www ~] # Umount [-fn] device file name ring mount point select attachment not parameter:-f: Force unload! Why can't I read the file system (NFS) that is available in a similar network? Paddle m? Close? Nbsp;-n: Do you want to update/etc/mtab? Lu He frozen ?? /Div> In fact,/etc/fstab (filesystem table) is to use the mount ??? When a row is mounted, all? If you select the marker parameter, write it to the file. In addition, the/etc/fstab is added with the dump slave? Why ??? Yes! When I do not boot? Does the row file system check fsck ??. Common compression extensions: *. Z compress program compression? File; *. gz gzip program compression? File; *. bz2 bzip2 program compression? File; * is the. tar package? The data has not been compressed. * is the .tar.gz tar program packaged? File, which is passed through gzip? Compress the * .tar.bz2 tar package? Archive, and pass through bzip2? Example 1: Copy/etc/man. config to/tmp and compress it [root @ www ~] # Cd/tmp [root @ www tmp] # cp/etc/man. config. [root @ www tmp] # compress-v man. config man. config: -- replaced with man. config. Z Compression: 41.86% [root @ www tmp] # ls-l/etc/man. config/tmp/man * Example 2? Uncompress man. config. Z [root @ www tmp] # uncompress man. config. Z [root @ www tmp] # ll man * Example 3: compress man. config into another file? T backup [root @ www tmp] # compress-c man. config> man. config. back. Z [root @ www tmp] # ll man * gzip: used for compression,-v for compression, and-d for decompression. View the compressed gzip file in zcat. Bzip2 and bzcat are also compression commands, with the gzip and zcat parameter types. Is tar the easiest way to package files? If you use tar, you just need to remember it? Method: Compression: tar-jcv-f filename.tar.bz2 to be compressed? For more information, see tar-jtv-f filename.tar.bz2 unzip: tar-jxv-f filename.tar.bz2-C? Directory #2. test the capacity required to back up the file system? [Root @ www ~] # Dump-S/dev/hdc1 5630976 <= Note that the unit is bytes, so it is about 5.6 MBytes. #0. check if any file system has been dumped by dump? Materials? [Root @ www ~] # Dump-W #1. First, create a 10 MB image? FILE In/boot: [root @ www ~] # Dd if =/dev/zero of =/boot/testing. img bs = 1 M count = 10 #2. start to create a differential backup file. here we use level 1: [root @ www ~] # Dump-1u-f/root/boot. dump.1/boot #3. check whether level 1 backup is recorded? What about the time? [Root @ www ~] # Dump-W # Let's run the entire/etc directory through dump? Line Backup and ton compression function [root @ www ~] # After dump-0j-f/root/etc.dump.bz2/etc observes dump with restore? Backup data content [root @ www ~] # Restore-t-f/root/boot. dump #0. first try to change the file system? Content: [root @ www ~] # Cd/boot [root @ www boot] # mv config-2.6.18-128.el5 config-2.6.18-128.el5-back #1. see? Does the row file system not back up files? Between Y? Difference! [Root @ www boot] # restore-C-f/root/boot. dump #2. change the file system back? T! [Root @ www boot] # mv config-2.6.18-128.el5-back config-2.6.18-128.el5 [root @ www boot] # cd/root dd command: Example 1: back up/etc/passwd to/tmp/passwd. [root @ www ~] in back # Dd if =/etc/passwd of =/tmp/passwd. back Example 2: Set yourself? Disk? Y under the first sector backup? T [root @ www ~] # Dd if =/dev/hdc of =/tmp/mbr. back bs = 512 count = 1 0 the beginning of a line, $ the end of a line, the beginning of a gg file, and the end of a G file. H The file header, M File center, T file tail Ctrl + f next page, Ctrl + B previous page, 50 GB to 50th rows d delete single character yy copy row p, P paste I, I, o, O, r, R enter edit mode command mode: w keep q quit! Forced meaning sp multi-window interface
Related Article

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.