1. Please check the information to understand these terms:/dev/hda,/dev/hdb,/DEV/SDA,/dev/sdb, what is the difference between them?
A: Hda generally refers to the IDE interface of the hard disk, HDA refers to the first hard disk, HDB refers to the second hard disk, etc.; SDA refers to the SATA interface of the hard disk, SDA refers to the first hard disk, SDB refers to the second hard disk, and so on.
2. Why are the results of du-b/etc/passwd and du-k/etc/passwd inconsistent? According to the truth 1024b equals 1k Amin/etc/passwd 1181b and use K to indicate that it is 4k.
A: Du-b shows the actual size of the file, Du-k displays the size of the disk block that the file occupies, and the du without parameters is the size of the display block by default. A block size of 4KB, a block can only hold one file, less than 4KB of the file occupies a block size, more than 4KB of files occupy more than one block, the size of an integer multiple of 4KB. /etc/passwd size is 1181b, less than 4KB, so use du or du-k display size is 4KB.
3. Please check the information to understand these concepts of disk: Heads, sectors, cylinders.
A: The hard disk is divided into head (Heads), cylinder (Cylinder), Sector (Sector).
Head (Heads): Each of the two sides of the magnetic plate has a head, a magnetic head corresponding to a piece of a face. Therefore, the first magnetic head can be used to represent the surface of the data.
Cylinder (Cylinder): Concentric tracks of the same radius in all the magnets constitute "cylinders", meaning that the series of tracks are stacked vertically together, forming a cylindrical shape. Simply understood, the cylinder is the track.
Sector (Sector): divides the track into a number of small segments, which is the sector. Although very small, but actually a fan shape, it is called sector. The capacity of each sector is 512 bytes.
Hard disk capacity = number of heads x number of cylinders x sectors x512 bytes.
4. How big is each cylinder space when calculating the partition? The second disk of Amin is 8589 MB (8589934592 bytes) with a total of 1044 cylinders.
answer: Cylinder space = disk capacity/number of cylinders =8589934592/1044=8227906bytes
5. Find out what the IDE and SCSI interface disks are different, how many logical partitions can the SCSI disk (SDA, SDB) divide (this understanding)?
Answer: The IDE (intergrated Device Electronics, electronic integrated drive) typically has a flat cable connection, a flat cable can connect 2 IDE hard drives, and a computer typically offers 2 flat cables, so 4 IDE hard drives are generally allowed. IDE after years of development, mature, cheap, stable. In general, old-fashioned computers are loaded with such hard drives. The current mainstream of the rigid board is already SATA hard drive. The IDE is transmitted in parallel, and SATA is transmitted serially.
SCSI (Small computer system Interface: Small Computer system interface) is mainly due to the original IDE interface hard disk speed is relatively low, transmission efficiency is relatively slow. Because the SCSI hard disk is independent of the system bus, its biggest advantage is the low occupancy rate of the system, of course, it has some advantages, high speed, fast transmission speed, more stable. But there are some drawbacks, high prices, installation without IDE convenience.
The maximum partition of a SCSI hard disk can only be divided into three primary partitions plus an extended partition, and the extended partition can be divided into 15 logical partitions, which is a hardware limitation and cannot be breached.
6. What happens if the specified block size is not 1024 2048 4096 when the disk is formatted as a EXT4 file system? What is the minimum size of the specified block and what is the maximum?
A: 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:
(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, whether to continue, select Y to continue, the value is not greater than the specified block of 4K integer multiples (from 4K to 32K) to format.
(5) When the specified block is greater than or equal to 65536, the prompt block value is too large, whether to continue, select Y to continue, then the format of 65536 bytes.
(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?
Answer: (1) Mount
(2) Df-t
8. What are the/dev/zero and/dev/null files in the Linux system and what are the roles?
A: (1)/dev/zero is a build 0 device, it can provide a steady stream of 0, it can be used to write to the device or file string 0, you can use it to create a specified length for initialization of the empty file, such as temporary swap files.
(2)/dev/null It is an empty device, also called a bit bucket, and any output written to it will be discarded. Commonly used to suppress output of standard output and standard errors. If you do not want the message to display or write to the file in standard output, you can redirect the message to the bin.
9. What is the main use of DF and du two commands under Linux?
Answer: (1) DF View disk partition and file system Information
(2) 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?
A: Fdisk is a new disk partition; You can format the disk with commands such as MKFS.EXT2, Mkfs.ext3, MKFS.EXT4, MKE2FS, and so on. MKE2FS features more.
11. What command do we need to use to get the relevant error message if we cannot mount the disk using mount?
Answer: DMESG
12. When uninstalling a disk or partition, error: "Umount:/newdir:device is busy." How do we do that?
A: This error may be reported because the current user in the/newdir directory, you can exit the directory and then uninstall, you can also use the command umount-l/newdir Force Uninstall.
13. How do I get the uuid of a partition?
Answer: Use the Blkid command
14. How do I use the DD command to generate a file of size 500M?
Answer: 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?
Answer: FREE-M
16. How can I view the number of Inode usage for each file system?
Answer: 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, 200M and then 3 logical partitions, respectively 100M.
Answer:fdisk/dev/sdb Enter, first press N, press p, enter 1, then enter 1, and then enter +200m; press N, press p, enter 2, then enter, then input +200m, press N, press p, enter 3, then enter, then input +200m; press N, press E, and then press the two Press N, followed by Enter, input +100m, press N, then enter, input +100m, press N, then enter, input +100m;
18. When partitioning the disk, the maximum number of primary partitions can be divided into several extended partitions, the expansion of the relationship between partition and logical partition what?
A: Up to 4 primary partitions, up to one extended partition, you can partition logical partitions within the extended partition only after partitioning the extended partition, that is, the logical partition is within the extended partition.
19. When I use Fdisk-l/dev/sdb to view disk partition status, I find that 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?
A: A 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?
A: The first method is, touch 1; echo 1 > 1; Du-sh 1 Look at the size of 1 is a few 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 '
Please check the information to understand these terms:/dev/hda,/dev/hdb,/DEV/SDA,/dev/sdb, what is the difference between them?