China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-25 08:59
中国DOS联盟论坛 » 其它操作系统综合讨论区 » Repost: Introduction to Linux Disk Structure View 1,587 Replies 1
Original Poster Posted 2002-11-03 00:00 ·  中国 湖北 随州 电信
元老会员
★★★
Credits 1,987
Posts 632
Joined 2002-10-27 00:00
23-year member
UID 73
Gender Male
Status Offline
CI hard drives have extremely simple functions, used to reliably store and retrieve data. Before writing data, we need to format the drive.
Formatting, also known as "creating a file system", is a process of writing information to the drive and establishing order in the blank space in an unformatted drive.
The order established by the file system involves some advantages and disadvantages:
1. A very small part of the available space on the drive is used to store data related to the file system, which can be regarded as management costs.
2. The file system divides the remaining space into small, uniformly sized segments. In LINUX, it is called a block (BLOCK).
Due to the possibility of creating directories and files brought about by the file system, the sacrifices made above can be regarded as a very small price to pay.
There is no single universal file system. There can be many different types of file systems on a disk drive, and different file systems are usually incompatible. Writing the file system to the disk is just the beginning. The goal of this process is actually to store and retrieve data.
After dividing the disk into partitions, each partition can be accessed like an independent disk, which is done by adding a partition table (PATITION TABLE). The partition table is saved at the very beginning of the disk, before any file system or user data. The partition table is divided into several parts (up to four), each part contains the information necessary to define a single partition, which means that the partitions defined by the partition table cannot exceed four.
Each partition table entry contains several important characteristics of the partition:
1. The start and end locations of the partition on the disk (defines the size of the partition and its position on the disk).
2. Whether the partition is "active" (used by the boot loader of some operating systems, that is, the operating system on the partition marked "active" will be booted.
3. The type of the partition (the type is a number indicating the intended use of the partition. Some operating systems use the partition type to indicate a specified system type, or mark the partition as a partition associated with an operating system, or to indicate that the partition contains a bootable operating system, or a combination of the three.
In many cases, there is only one partition on the entire disk, basically repeating the method used before partitioning. There is only one entry in the partition table pointing to the start of the partition.
After a period of time, four partitions are obviously not enough. As disk drives continue to increase in size, the possibility of having remaining space after configuring four rather large partitions will become greater and greater. Therefore, there is a need for some methods to create more partitions: extended partitions.
When a partition is created and its type is set to "extended", an extended partition is also created. In short, an extended partition is like an independent disk drive - it has its own partition table pointing to one or more partitions (now called logical partitions, in contrast to four primary partitions). The partition table is completely included within the extended partition. There are some differences between primary partitions and logical partitions - there can be only four primary partitions, but the number of logical partitions that can exist is unlimited (in reality, no more than 12).
When you try to repartition the hard disk, there are three possible situations:
1. There is available unused free space
2. There is an available unused partition
3. There is available free space in the actively used partition.
In the first case, the defined partitions do not extend to the entire hard disk, and do not include the unallocated space that does not belong to any defined partition.

Partition naming scheme:
LINUX uses a combination of letters and numbers to refer to disk partitions. In the DOS/WINDOWS world, partitions are named in the following way:
1. Each partition is checked to determine whether it can be read by DOS/WINDOWS.
2. If the partition type is compatible, it will be assigned a "drive letter", starting from 'C', and then pushed in alphabetical order according to the number of partitions to be labeled.
3. The drive letter can be used to refer to that partition or the file system contained in the partition.
RED HAT LINUX uses a more flexible naming scheme. The information it conveys is more than the naming schemes used by other operating systems. This naming scheme is based on files, and the format of the file name is: /DEV/XXYN
/DEV/ is the directory name where all device files reside. Because partitions reside on the hard disk, and the hard disk is a device, these files represent all possible partitions residing on /DEV/.
XX is the first two letters of the partition name, indicating the type of the device where the partition resides. For example: HD (for IDE disks) or SD (for SCSI disks).
Y is the device where the partition is located. For example, /DEV/HDA (the first IDE disk) or /DEV/SDB (the second SCSI disk)
N The last number represents the partition. The first four partitions (primary partitions or extended partitions) are numbered from one to four. Logical partitions start from 5. For example: /DEV/HADA3 is the third primary partition or extended partition on the first IDE hard disk; /DEV/SDB6 is the second logical partition on the second SCSI hard disk. In the conventional naming, none are based on the partition type. Unlike DOS/WINDOWS, all partitions can be recognized under RED HAT LINUX.
Disk partitions and mount points:
In DOS/WINDOWS, each partition has a "drive letter", and the correct drive letter is used to refer to the files and directories on the corresponding partition. It is very different from how LINUX handles partitions and disk storage. The main difference is that each partition is used to form a part of the storage area necessary to support a group of files and directories. It is achieved by associating the partition with a directory through the mounting (MOUNT) process. Mounting the partition makes the storage area starting from this specified directory (collectively called the mount point) available.
For example: If the partition /DEV/HDA5 is mounted on /USR, it means that all files and directories under /USR physically reside on /DEV/HDA5. Therefore, the file /USR/SHARE/DOC/FAQ/TXT is stored on /DEV/HDA5, while the file /ETC/X11/GDM/SESSIN/GNOME is not. It is also possible that one or more directories under /USR are mount points of other partitions. For example, a partition /DEV/HDA7 cannot be mounted to /USR/LOCAL, which means that /USR/LOCAL/MAN/WHATIS will reside on /DEV/HDA7 instead of /DEV/HDA5.
Unless there is another reason, it is recommended to create at least the following partitions:
1. A swap partition - used to support virtual memory. In other words, when there is not enough memory to hold the data that your system is processing, this data is written to the swap area. A swap partition must be established to use RED HAT LINUX correctly. The minimum value of your swap partition should be twice the memory of the computer.
2. A /BOOT partition - the partition mounted on /BOOT contains the kernel of the operating system (allowing your system to be booted into RED HAT LINUX), and several other files used during the boot process. 32M is enough.
3. A root partition (/) - is where the root directory resides. In the partition layout, all files (except those residing on /BOOT) reside on the root partition. The size of the root partition should be expanded as much as possible. For example, a 1.2GB root partition may allow an installation of a workstation size, while a 3.4GB root partition may allow you to install every software package.

GRUB and LILO are the most common methods to boot RED HAT LINUX on Intel-based systems. As operating system loaders, they operate outside any operating system and only use the basic I/O system (BIOS) built into the computer hardware. In most Intel-based computers, GRUB and LILO have to accept the restrictions imposed by the BIOS. In particular, most BIOS cannot access more than two hard disks, and they cannot access data stored above cylinder 1023 on any drive. All the data that GRUB and LILO need to access during the boot period is located in the /BOOT directory. If you want to use GRUB or LILO to boot the RED HAT LINUX system, the partition where /BOOT resides must comply with the following regulations:
On the first two IDE drives, if there are two IDE or (EIDE) drives, /BOOT must be located on one of them. Note that the limit of two drives also includes any IDE CD-ROM drives on your primary IDE controller. Therefore, if you have an IDE hard disk and a CD-ROM drive on your primary controller, /BOOT must only be located on the first hard disk, even if there is another hard disk on your secondary IDE controller.
On the first IDE or first SCSI drive, if there is an IDE drive and one or more SCSI drives, /BOOT must be located on the IDE drive or the SCSI drive with ID 0. No other SCSI IDs are allowed.
On the first two SCSI drives: If there are only SCSI hard disks, /BOOT must be located on the drive with ID 0 or 1.
The partition is completely below cylinder 1023. If the partition containing /BOOT is located on both sides of 1023, GRUB and LILO may work initially because all necessary information is below 1023. If a new kernel is loaded and resides above 1023, it will fail.

To delete LINUX from your system, you just need to delete the information about GRUB or LILO from your master boot record (MBR).
FDISK /MBR.
If you need to delete LINUX from a hard disk drive and use the default DOS FDISK to do so, you will encounter the problem of "partitions exist but do not exist". The best way to delete non-DOS partitions is to use a tool that understands partitions, not just DOS. You can achieve this with the installation media. Just type LINUX EXPERT at the BOOT: prompt:
Select installation, and select FDISK where you should partition the drive. In FDISK, type to print the partition number, then use the command to delete the LINUX partition. After being satisfied with the changes, use to exit and save the changes. If you delete too much, use the command, which will not make any changes. After deletion, restart and no need to continue the installation.
Create a boot disk: Type MAN MKBOOTDISK after SHELL.
The MBR is the recommended place to install the loader, unless the MBR is already booting the boot loader of another operating system, such as: SYSTEM COMMANDER. The MBR is a special area on the hard disk drive that will be automatically loaded by the BIOS of your computer, and it is the earliest place where the boot loader controls the boot process. If you install the boot loader on the MBR, when your machine boots, GRUB or LILO will present a boot prompt. Then you can boot RED HAT LINUX or any other operating system that you have configured the boot loader to boot.

To become a root user, type: SU
Change the keyboard type after installation: /USR/SBIN/KDBCONFIG or SETUP
Change the mouse type: /USR/SBIN/MOUSECONFIG
To create special characters with multiple keys, use "dead keys" (also known as key combination sequences). Dead keys are enabled by default. To re-enable dead keys, you must comment out the line disabling dead keys INPUTDEVICE in the XF86CONFIG-4 file or XF86CONFIG file under /ETC/X11. It is enabled by default unless there is a "NODEADKEYS" option.

To simulate a three-button mouse, press the two buttons of the mouse simultaneously to simulate the third middle button.
http://dos.e-stone.cn/dosbbs
uploadImages/200311161145850422.swf
Floor 2 Posted 2004-07-31 00:00 ·  中国 浙江 杭州 电信
初级用户
★★
Credits 66
Posts 80
Joined 2004-07-24 00:00
21-year member
UID 28917
Gender Female
Status Offline
Most of the Linux file systems inherit the advantages of the UNIX file system.
Forum Jump: