Some issues with disk partitioning

Source: Internet
Author: User
Tags inode usage

The hard disk interface is divided into IDE, SATA, SCSI, Fibre Channel and SAS five kinds, IDE interface hard disk is used in household products, also

Part of the server, SCSI interface hard disk is mainly used in the server market, and Fibre Channel only in the high-end service

Expensive on the device. SATA is a new type of hard disk interface and is also in the market penetration stage.

-----------------------------------------------------------------------------------------

The difference between 1./dev/hda,/dev/hdb,/DEV/SDA,/dev/sdb, and extension:

Hda generally refers to the IDE interface of the hard disk, HDA generally refers to the first hard disk, similar to the HDB,HDC, etc.

SDA generally refers to the SATA interface of the hard disk, SDA generally refers to the first hard disk, similar to SDB,SDC, etc.

Now the kernel will be hard disk, mobile hard disk, such as a U disk recognized as the form of SDX, and the quantity is identified from A-Z, up to 26 blocks


2. Why are the results of du-b/etc/passwd and du-k/etc/passwd inconsistent? 1024b, as the truth says

Equals 1k, but 1181b uses K to indicate that it is 4k.

Because the block size of the default format disk is 4096 bytes or 4K, even a small file will have a block size of 4k.

The du-b will be counted in B units of the file size, so the results are inconsistent.


3. Understand these concepts of disk: Heads, sectors, cylinders.

Head (heads): The head is fixed on a movable manipulator for reading and writing data. Modern hard drives are both double-sided and readable, so the head

The number is equal to twice times the number of discs. The maximum number of heads is 255 (8 two) with the second head can be used to indicate the magnetic surface of the data.

Sector (sectors): Draws a straight line from the center of the disk, dividing the track into several arcs. Each arc segment is called a

Sector. A sector is the smallest constituent unit of a hard disk, usually 512 bytes. The maximum number of sectors on a track is 63 (6 bits

Cylinder (cylinders): concentric tracks of the same radius in all the magnets form "cylinders". The maximum number of cylinders is 1023 (10 binary

(System position). A cylinder is the smallest unit of a disk partition.


4. How big is each cylinder space when calculating the partition?

Cylinder Space size = number of heads * Number of sectors per track * Sector size =255*63*512 (bytes) =8225280 bytes


5. What is the difference between IDE and SCSI interface disks, and how many logical partitions can a SCSI disk (SDA, SDB) divide?

SCSI drives have many advantages over ordinary IDE drives: The interface is fast, and because it is primarily used for servers, the nature of the hard disk itself

can also be relatively high, hard disk speed, large cache capacity, low CPU usage, scalability is far better than the IDE hard disk, and support hot Plug and unplug.

Primary partition up to 4 logical partitions: SCSI up to 16; IDE up to 63


6. What happens if the specified block size is not 1024 2048 4096 when the disk is formatted as a EXT4 file system? Specify block size

How much is the smallest, and how much is the largest?

When you format the file system, if you specify a block size that is not a standard value of 1024, 2048, 4096, there are several things that can happen:

(1) When the specified block is less than 1024, the error "Invalid block size" is indicated and cannot be formatted.

(2) When the specified block is greater than 1024 and less than 2048, it is actually formatted with a block size of 1024.

(3) When the specified block is greater than 2048 and less than 4096, it is actually formatted with a block size of 2048.

(4) When the specified block is greater than 4096 and less than or equal to 65536, the prompt block value is too large, continue, select Y to continue, then do not

Integer multiples of 4K (from 4K to 32K) that are larger than the specified block are formatted.

(5) When the specified block is greater than or equal to 65536, the prompt block value is too large, continue, select Y to continue, then 65536 bytes

Formatted.

(6) When the specified block is greater than 65536, the error "Invalid block size" is indicated and cannot be formatted.


7. How do I see what type of file system each partition is in the current system?

Mount or Df-t


8. What are the/dev/zero and/dev/null files in the Linux system and what are the roles?

/dev/zero is a built-in 0, it can be continuously provided 0, it can be used to write to the device or file string 0, can be used

It creates an empty file of the specified length for initialization, such as a temporary swap file.

/dev/null is an empty device, also called a bit bucket, and any output written to it will be discarded. Commonly used to prohibit standard

Output and standard error output. You can redirect unwanted messages directly to this.


9. What is the main use of DF and du two commands under Linux?

DF View disk partition and file system Information

Du view the size of the disk space occupied by the directory or file


10. Under the Linux system, what is the command to partition a new disk? And what commands are you using to format the disk?

FDISK is a new disk partition, and you can format the disk with commands such as MKFS.EXT2, Mkfs.ext3, MKFS.EXT4, MKE2FS, and so on.


11. What command do we need to use to get the relevant error message if we cannot mount the disk using mount?

Dmesg


12. When uninstalling a disk or partition, error: "Umount:/newdir:device is busy." How do we do that?

You can exit this directory first, or use the command umount-l/newdir


13. How do I get the uuid of a partition?

Blkid


14. How do I use the DD command to generate a file of size 500M?

DD If=/dev/zero of=/bigfile bs=1024k count=500


15. What is the command to view memory size? How do I display it in m units?

Free-m


16. How can I view the number of Inode usage for each file system?

Df-i


17. Use the VMware virtual machine to allocate a 1G virtual disk and use the Fdisk partitioning tool to divide the newly added disk into 3 primary partitions,

Do not 200M, then divide 3 logical partitions, respectively 100M.

Fdisk/dev/sdb Enter, first press N, press p, enter 1, then enter 1, and then enter the +200m; press N, press p, enter 2, then enter, and then input +200m; press N, press p, enter 3, then enter, type +200m, press N, press E, then press two to enter; Press N, then enter, input +100m; Press N, then enter, input +100m, press N, then enter, input +100m;

In fact, just remember that the FDISK device name is the rest of the operation according to the prompt.


18. To partition the disk, the maximum number of primary partitions can be divided into several extended partitions, extended partition and logical partition

What is the relationship?

Up to 4 primary partitions, up to one extended partition, can be partitioned within the extended partition only after partitioning the extended partition, or

This means that the logical partition is within the extended partition.


19. Using Fdisk-l/dev/sdb to view disk partition status, there are several partitions: SDB1, SDB3, SDB5, SDB6, sdb7, so please figure out how many primary partitions and several logical partitions there are in this disk?

One primary partition, three logical partitions (SDB5,SDB6,SDB7)


20. What is the method to see how much block size (1024,2048,4096) is specified when a partition is formatted?

There are two ways of doing this:

The first one is a stupid method, touch 1; echo 1 > 1; Du-sh 1 Look at the size of 1 K, is 1k block size is 1024,2k

Block size is 2048,4k block size is 4096

The second method is that tune2fs-l/dev/sda1 |grep ' Block size '


Some issues with disk partitioning

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.