School exercise in Chapter 6

(1) Please find information about these terms and tell the difference between them: / dev / hda, / dev / hdb, / dev / sda and / dev / sdb.

answer:

/ Dev / hda, / dev / hdb IDE interface is hard block file. / Dev / hda represents an IDE disk, / dev / hdb IDE disk represents a second block.

/ Dev / sda, / dev / sdb SCSI interface is hard block file. / Dev / sda represents a SCSI disk, / dev / sdb SCSI disk represents a second block.

 

2. Why the results are inconsistent du -b / etc / passwd and du -k / etc / passwd obtained it? Logically speaking 1024b is equal to 1k Ah Ming's / etc / passwd for the 1181b and using k it turned out to be expressed in units of 4k.

answer:

Formatting the disk because the default block size is 4096 bytes i.e. 4K, even a small file will be assigned a block size of 4k. du -b to b units will file size to count, so the results are inconsistent.

 

3. Please check the information, to understand these concepts disks: heads, sectors, cylinders.

answer:

A magnetic head (heads): magnetic head is fixed on a movable robot arm for reading and writing data. Modern hard disk is a double-sided read, the number of heads is equal to twice the number of the disk. The maximum number of heads is 255 (8 bits). It may be represented by the first head of which several magnetic surface data.

Sectors (sectors): a straight line drawn outwardly from the center of the disk, the tracks may be divided into several arcs. An arc segment on each track is called a sector. Sector is the smallest constituent unit of a hard disk, typically 512 bytes. The maximum number of sectors on the track is 63 (6 bits).

Cylinders (cylinders): all the same radius of magnet pieces in concentric tracks constitute a "cylinder." The maximum number of cylinders 1023 (10 bits). Cylinder is the smallest unit of disk partitions.

 

4. disk partition is how much space each sector?

answer:

512 bytes

 

5. What to find information and understand ide scsi disk interfaces are not the same, scsi disk (sda, sdb) the number of logical partitions (this can be understood) can be divided into up to?

answer:

Compared with a common SCSI hard drives and IDE hard disk number of advantages: faster interface speed, and since mainly for the server, so the performance of the hard disk itself is relatively high, fast hard drive speed, large-capacity cache, CPU occupancy rate is low, much better than the extended IDE hard drives, and hot-swappable.

About how many logical partitions can be divided up to the problem, you can understand.

 

6. Once the disk is formatted as ext4 file system, if you specify the block size is not 102,420,484,096 what happens? Specify the block size is the minimum number, maximum and how much?

answer:

When the file system is formatted, if the block size is not specified 1024,2048,4096 these standard values, the following situations occur:

(1) When the designated block is smaller than 1024, then an error "invalid block size", can not be formatted.

(2) When the designated block is larger than 1024 and less than 2048, the actual format of the chunk size 1024.

(3) When the designated block is larger than 2048 and less than 4096, the actual format of the chunk size 2048.

(4) When the designated block is greater than 4096 and less than or equal to 65536, the value is too large block is prompted whether to continue, y choose to continue, places not greater than an integer multiple of the specified block of 4K (from 4K to 32K) format .

(5) When the specified blocks than or equal to 65536, the value is too large block is prompted whether to continue, y choose to continue, places 65536 bytes format.

(6) When the designated block is larger than 65536, then an error "invalid block size", can not be formatted.

 

7. How to view the current system where each partition is what type of file system?

answer:

mount or df -T

 

8. / dev / zero and / dev / null is what linux file system, what role?

answer:

/ Dev / zero is made zero, it can continue to provide 0, 0 which can be used to write a string file or device that can be used to create an empty file length specified for initialization, such as temporary swap documents.

/ Dev / null is an empty device, also called a bit bucket (bit bucket), any writes its output will be discarded. Used to prohibit the standard output and standard error output. If you do not want to display a message or write the file to standard output, you can redirect messages barrels in place.

 

9. Linux under the command df and du two major used to do?

answer:

df view disk partition and file system information

du view directories or files take up more disk space

 

10. In the Linux system, what order to a new disk partition it? And what commands to format the disk?

answer:

fdisk for the new partition, you can use mkfs.ext2, mkfs.ext3, mkfs.ext4, mke2fs commands to format the disk.

 

11. If you can not use mount to mount the disk, we need to use what command to get the associated error message?

answer:

dmesg

 

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

answer:

Reported this wrong, probably because of the current user in the / newdir directory, you can exit the directory, you can also use the command umount -l / newdir

 

13. How to Obtain the UUID of a partition?

answer:

blkid

14. How to use the dd command to generate a file size of 500M?

answer:

dd if=/dev/zero of=/bigfile bs=1024K count=500

 

15. Review the memory size of the order is? How in MB display?

answer:

free -m

 

16. How to view the inode number of each file system usage? ,

answer:

df -i

 

17. Use vmware virtual machine assigned a virtual disk 1G, and uses the newly added to the fdisk utility disk divided into three primary partitions, respectively 200M, and then divided into three logical partitions, respectively 100M.

Answer:
After fdisk / dev / sdb the transport, press n, according to p, input 1, input 1 and then, enter + 200M; by n, by p, an input 2, then Enter, then enter + 200M; press n , by p, an input 3, then enter, then enter + 200M; by n, press E, and then press enter twice; by n, then a carriage return, an input + 100M; n, then the transport, an input + 100M; press n, then the transport, an input + 100M;

 

18. The disk partitions to time, most can be divided into several primary partitions, at most can be divided into several extended partitions, extended partitions and logical relationship when what district?

answer:

After a maximum of four primary partitions, at most one extended partition, only divided the extended partition, it can be divided into logical partitions within the extended partition, that is logical partitions in an extended partition.

 

19. A Ming use fdisk -l / dev / sdb view disk partition situation, I found there are so few partitions: sdb1, sdb3, sdb5, sdb6, sdb7, then please projections about this disk, there are several primary partition and several logical partitions?

answer:

A primary partition, three logical partitions (sdb5, sdb6, sdb7)

 

20. Is there any way you can view the block size specified when a partition is formatted as much (1024,2048,4096)?

answer:

There are two ways:

The first method is a stupid, touch 1; echo 1> 1; du -sh 1 to see a few things the size k, the block size is 1024,2k 1k is the block size is the block size is 4096 2048,4k

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

Guess you like

Origin www.cnblogs.com/wft9/p/12048636.html