Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux Host Planning and disk Partition

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

The file name of each hardware device in linux

In the Linux system, each device is treated as a file.

For example, the file name of the hard disk of the IDE interface is / dev/hd [a murd], where any one of the parenthetical letters Amurd also means / dev/had/,/dev/hda / dev/hdb / dev/hdc and / dev/hdd.

Almost all the hardware files under Linux are in the / dev/ directory, so you will see / dev/had,/dev/fd0

File name of, etc.

The file name of the device within the linux

IDE hard disk / dev/hd [aMurd]

SCSI | STA/USB / dev/sd [Amurp]

U disk / dev/sd [a Murp] is the same as (sata)

Floppy drive / dev/fd [0-1]

Printer 25 pins: / dev/Ip/ [0-2]

USB:/dev/usb/Ip [0-15]

Mouse USB:/dev/usb/mouse [0-15]

PS2:/dev/psaux

Current CD ROM/DVD ROM/ dev/cdrom

Current mouse / dev/cdrom

Tape drive IDE:/devht

SCSI:/dev/st0

Review of the composition of disks

The composition of the disk is mainly composed of a disk, a mechanical arm, a magnetic head and a spindle motor, and the data is actually written on the disk, which can be subdivided into sectors and cylinders, each of which is as big as 512bytes, and the first sector of the disk is very important, because the first sector records two important information. Are

Primary boot partition: where the boot loader can be installed, by 446bytes

Partition table: record the status of the partition of the whole hard disk, with 64bytes

MBR is very important, because when the system starts up, it will take the initiative to read the contents of this block, so that the system will know where your program is placed and how to boot. If you want to install a multi-boot system, the management of MBR is very important.

Disk partition table

We are dealing with it by referring to the cylindrical number. In the 64bytes capacity where the partition table is located, it is divided into four groups of record areas, each of which records the revelation and ending cylinder number of the section.

Since the partition table has only 64bytes, it can only hold up to four partitions, which are called primary or extended partitions

In fact, the so-called partition is only set for the partition table of that 64bytes.

The default partition table of the hard disk can only write four sets of partition information.

These four sets of partition information are called primary or extended partitions.

The smallest unit of the zone is the cylinder.

When the system wants to write to disk, it must refer to the disk partition table in order to process the data for a partition.

1. Security of data

two。 Performance considerations of the system

The device name number of the logical partition starts with 5.

We have a simple definition of the characteristics of primary partition, extended partition and logical partition.

There can be up to four primary and extended partitions (hard disk limit)

There can be at most one extended partition (operating system limitation)

A logical partition is a partition that is continuously cut by an extended partition

The partition that can be formatted as data access is primary partition and logical partition, but the extended partition cannot be formatted.

The number of logical partitions varies depending on the operating system. In linux systems, IDE hard drives have up to 59 logical partitions, and SATA hard drives have 11 logical partitions (5 to 15).

A partition is a "continuous" disk space at the book level.

If the extended partition is destroyed, all logical partitions will be deleted because the information of the logical partition is recorded in the extended partition.

The extended partition itself is provided for logical partitions to create and use the

CMOS and BIOS and boot

COMS is a memory that records hardware parameters and is embedded on the motherboard.

BIOS is a firmware written to the motherboard, which is a software program written to the hardware.

This Biso is the first program that will be actively executed by the computer system when it is turned on.

Next, BIOS goes back to analyze what storage devices are in the computer. Let's take the hard disk as an example. MBR only 446bytes hard disk capacity will put the most basic boot loader, when the BIOS is complete, and then it is the work of the boot program in the MBR

The purpose of this boot loader is to load kernel files, because the boot loader is provided by the operating system during installation, so it recognizes the file system format in the hard disk, so it can read kernel files. Write it down is the work of the kernel, the boot loader is also completed, and then it is known as the task of the operating system.

To put it simply, the entire boot process should behave like this before it reaches the operating system.

1. BIOS: boot the firmware that executes actively, and you will recognize the first bootable device.

2. MBR: the main boot partition in the first sector of the first bootable device, which contains the boot loader

3. Boot loader, a piece of software that can read kernel files to execute.

4. Kernel files: start the function of the operating system

Boot loader is a set of software installed by the operating system on MBR. Because MBR only has 446bytes, this boot loader is very small and perfect. The main tasks of this boo loader are as follows

Provide menu: users can choose different boot options, which is also an important function of multi-boot

Load the kernel file: point directly to the boot program section to start the operating system

Transfer to other loader: transfer the boot loading function to other loader

In addition to being installed in MBR, the boot loader can also be installed in the boot sector of each partition. This feature is to create the function of "multi-boot".

Multiple boot

Each partition has its own boot sector

One computer with two systems, the first partition and the second partition

The actual bootable kernel files are placed in each partition

L Loader will only know the bootable kernel files in his system partition and other loader

L Loader may direct or indirectly transfer management rights to another management program

Install Windows before installing linux

Because, if you install Linux before Windows, the boot loader for MBR will only have the option of windows, not the option of linux (because the boot loader of linux, which was originally in MBR, will be overwritten).

Selection of disk partitions in Linux installation mode (extremely important)

Directory tree structure:

The so-called directory tree structure is a kind of file structure which is based on the root directory and then presents the branch directory structure down. Therefore, the most important thing in the whole directory tree structure is the root directory, which is represented by a slash "/".

All files are derived from the root directory, and there can be other data under the subdirectory.

Our file data is actually placed in the disk partition, and the problem now is how to combine the structure of the catalogue with the data in the hard disk, which involves "mounting".

Relationship between file system and directory tree (mount)

The so-called "mount" is to use a directory as the entry point to place the data of the disk partition in that directory; that is, you can read the meaning of the partition by entering the directory. This operation is called "mount", and the directory of the entry point is called "mount point".

The relationship between host service planning and hardware

Common services for small businesses

1.NAT (reach the function of the router)

2.SAMBA (join a neighbor on the windows network)

3.Mail (Mail Server)

4.Web (www server)

5.DHCP (provides the ability for the client to obtain IP automatically)

6.Proxy (proxy server)

7.FTP

Focus on review

When adding new computer hardware configuration, the angles that need to be considered include the consideration of game console / work machine, the consideration of performance-to-price ratio, the consideration of support, and so on.

The old hardware configuration may be due to problems in the explosion or the aging of electronic components, resulting in unknown crashes in the running process of the computer system.

"in the linux system, each device is treated as a file, and each device has a device file name.

The device files of the disk are called / dev/hd [Amurd] of IDE interface and / dev/sd [Amurp] of SATA/SCSI/USB interface.

The first sector of the disks mainly records two important pieces of information, namely:

Primary boot partition (1); where the loader can be installed, there are 446byts; (2)

Partition (2) Partition table: records the status of the partition of the entire hard disk, with 64bytes

There can be up to four primary and extended partitions of a disk, and the device file name and number of logical partitions must start on the 5th.

The process of boot is: BIOS--MBR--boot loader-- kernel file

The main function of subscription Boot loader is to provide menus, load the kernel, and transfer control to other loader

There are two locations where Boot loader can be installed, namely MBR and boot sector

Files in the Linux operating system use the directory tree system, and the corresponding disk needs to be "mounted".

Question and answer section

1. Is the overall speed of a host computer improved as long as the CPU is fast enough?

No, the overall speed should be improved by integrating the overall configuration, such as memory frequency, hard disk capacity, and so on.

What considerations does 2.Linux need for hardware requirements? Does it have to be highly configured to install Linux?

No, the configuration is determined by the functions of the actual application environment and the services provided.

CPU is at least above the 2GHz series level.

The memory can be considered a little higher, because if there is not enough memory, it will take up the hard disk capacity, the so-called swap partition, which is not very good for the overall server performance.

The speed of the hard disk should be higher and the capacity should be larger.

3. Before installing a good host, it is best to plan first. Which are the linux host planning items that must be paid attention to?

1. Select the appropriate distribution (release)

A good choice for Red Hat Enterprise Linux and SuSE Enterp Linux on the server, with less version changes and longer duration of update support

two。 The relationship between the service of the host and hardware

3. Main planning of host hard disk

4. Please write down the following device file names configured in linux

IDE hard disk / dev/hd [aMurd]

CDROM / dev/cdrom

Printer 25 pin: / dev/Ip [0-2] USB:/dev/usb/Ip [0-15]

Floppy drive / dev/fd [0-1]

Network card / etc/sysconfig/network-scprits/if-eth0

If your system often crashes and can't find a solution, which direction of the hardware can you search?

1. CPU temperature is too high, memory is full, power supply is unstable, etc.

5. At present, what are the two common connections between the hard disk and the motherboard on personal computers

Interface between SATA and SCSI

Personal computer SATA server SCSI

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report