Partitions and file systems in Linux (1)

Source: Internet
Author: User
Tags ide hard drive

Our article "Learn Linux, 101: Hard Disk layout" introduces the layout, partition, and usage of hard disk drives.fdiskCommand to view the basic knowledge of partition information. You learnedPrimary Partition,Extended partitionAndLogical PartitionPartition related knowledge, understand the Linux File System contains someFile, They are stored on disks orDirectoryInBlock Storage Devices. Like many other systems, directories on Linux may contain other directories, which are calledSubdirectory. This article also discusses considerations for choosing partitions.

This article will first review Block devices and partitions, and then show how to usefdiskCommand to create, modify, or delete a partition on a block device. You will also learnmkfsMkfs representativeMake filesystem) Various forms of commands;mkfsCommand is used to format a partition into a special file system type.

Note:Except for the tools and file systems required by the LPI test, you may encounter or need other tools and file systems. The other tools and File Systems Section provides a simple summary of other available tools.

Block Device

Block DeviceYes.BlockThe abstraction layer of any storage device. The access of individual blocks can be independent from access of other blocks. Such access is usually calledRandom Access.

Random accessible abstract layers of fixed-size blocks allow applications to use these Block devices without worrying about the underlying devices as hard drive, floppy disk, CD, solid state solid-state drives, network drives, or a virtual device, such as a file system in the memory.

The block device example includes the first IDE Hard Drive/dev/sda or/dev/hda on the system, or the second SCSI, IDE or USB drive/dev/sdb ). Usels -lCommand to display/dev entries. The first character output for each row isBFor a block device, such as a floppy disk, CD drive, IDE hard drive, or SCSI hard drive) and c for a single character device, such as a, terminal tty) or empty device. Listing 1 shows some examples.

Listing 1. Linux Block devices and character Devices

[ian@echidna ~]$ ls -l /dev/loop1 /dev/null /dev/sd[ab] /dev/sr0 /dev/tty0brw-rw----. 1 root disk   7,  1 2010-06-14 07:25 /dev/loop1crw-rw-rw-. 1 root root   1,  3 2010-06-14 07:25 /dev/nullbrw-rw----. 1 root disk   8,  0 2010-06-14 07:25 /dev/sdabrw-rw----. 1 root disk   8, 16 2010-06-14 07:25 /dev/sdbbrw-rw----+ 1 root cdrom 11,  0 2010-06-14 07:25 /dev/sr0crw--w----. 1 root root   4,  0 2010-06-14 07:25 /dev/tty0

Partition

For some Block devices, such as floppy disks and CD or DVD disks, the whole media is usually used as a single file system. However, for large hard drive or even USB memory, it is more common to divide the available space into several differentPartition.

The partition size may vary, and different partitions can have different file systems. Therefore, a single disk can be used for multiple purposes, including sharing the disk among multiple operating systems. For example, the test system I use contains several different Linux releases, and sometimes contains a Windows®System, both of which share one or two hard drive.

The article "Learn Linux, 101: Hard Disk layout" introduces that hard drive hasGeometry)According to the definition of the term cylinder, Head, and sector. Use even modern drivesLogical Block Addressing LBA), Which makes the geometric parameters almost irrelevant. The basic allocation unit for partitioning purposes is usually still a cylindrical.


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.