File and partition basics for Linux file systems

Source: Internet
Author: User

Inunix/linux, afile is a sequence of bytes withoutstructure. Any necessary structure (e.g-a database) isadded by the programs, the data in the file. Linuxitself doesn ' t know about the internal structure of a database file–all it does is return bytes.

For Linux Systems, the file is a non-structured byte sequence. So-called any structure file (such as a database file) is for the application, that is,Linux will not know what the structure of the file (and do not need to know),Linux is only responsible for returning or writing to the file byte sequence, The specific how to parse this file is the application's responsibility.

Unix/ Linuxtries its best to treat every device attached to it as if it were alist of bytes. Therefore, everything, including network cards, harddrives, partitions, keyboards, printers, and plain files are Treatedas File-like objects and each have a name in the file system.

    • < Span lang= "en-US" >yourcomputer memory Is/dev/mem .

    • yourfirst hard disk Is/dev/sda .

    • aterminal (keyboard and screen) Is/dev/tty1 .

    • Etc.

Linux Another feature of is the idea that everything is file. linux The makes every effort to treat all devices as a file made up of byte sequences (in fact, the idea is incredible, but let's think about what all the physical devices are going to do in the end). Store data. Whether it is the display / printer / keyboard / disk /usb and so on, is to store data, these data is not a byte sequence, byte sequence is not a file, so this is a good object-oriented abstract thinking, and good implementation of unified management and transparency.

Thereare kinds of major partitions on a Linux system:

    • datapartition: Normal Linux system data, including therootpartition containing all the data to start and run Thesystem; and

    • swappartition: Expansion of the computer ' s physical memory, extramemory on hard disk.

Oneof the Goals of having different partitions are to achieve higher datasecurity in case of disaster. By dividing the hard disk inpartitions, data can be grouped and separated. When a accidentoccurs, only the data in the partition that got the hit would bedamaged, while the data on the other Partit Ions would most likelysurvive.

The organization of the disk is partitioned under Linux , so why do I need to partition it? A piece of disk unified management is all right. Everything in the computer is tradeoff ( weigh ), and we sacrifice something for another, if another thing is more valuable in the actual production environment. Computer time space and security are always in the game. One of the main considerations for Linux Partitioning is security safety questions. Partitioning enables better data security and avoids disaster. By partitioning the disks, the data can be stored separately in different groups. In the event of an accident, only the partition data of the accident will be corrupted, and the data of other partitions will not be affected too much.

Let's take a look at Linux below how to view disk partitions and file system types:

The DF command is only displays information about active non-swappartitions.

The DF command only displays information about mounted partitions (file systems) and non-switched partitions.

Below we mount a partition:

Mount the /dev/sda6 partition under the /media/kitian directory. To see your own partition, you can use the fdisk-l command and DFagain to see the /dev/sda6 on the mount.

DF command does not see the type of file system, then we use another tool parted;parted can see details of all partitions (including file system types)

Enter the printlist command after entering the parted tool and you can see it.



File and partition basics for Linux file systems

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.