Home > System Tutorial > LINUX > body text

Explore the basics of Linux: the mysteries of hard drives and partitioning techniques

WBOY
Release: 2024-07-15 18:41:07
Original
885 people have browsed it

探索 Linux 基础知识点:硬盘的奥秘与分区技巧

1. Basic knowledge points of Linux

Hard drive

Optical drive is a medium that can store a large amount of information resources. The hard drive we usually see is a square and heavy iron box. Although the hard drive is round, after adding some control circuits, it is designed into a round case for easy portability. And the hard disk is really round. I'm not going to lie to you. How else would it be called a disk? Second, what you need to know is that hard drives can be partitioned. You can partition the hard disk into multiple partitionsExit without saving under Linux. It seems that partition is both a ranking and a tense. What are the partitions called rankings? Today's hard drives are getting larger and larger, storing more and more resources. In order to more rationally manage the use of hard disk resources and more effectively improve query speed and access quality, we can define the hard disk into multiple partitions to store some information respectively. When you need to read a certain data, the system will manually use the nearest disk to read to increase the reading speed. Hard disk partitioning is a means of reasonably managing resources based on hardware.

Partitions have been understood for a long time, and we can’t just have partitions, we have to use a way to control partitions. The Windows operating system uses the concept of C drive, using a single letter to represent different partitions on the hard drive, for example, C drive, D drive, etc. Before Windows 2000, the C drive corresponded to the first partition, the D drive corresponded to the second partition, and so on. With Winows2000, this correspondence can be adjusted by yourself.

On Linux, we don’t have the concept of c drive, we use directories to manage it.

Let’s talk briefly about the catalog, after all, you all know it. If we throw tens of thousands of kiwis into a basket, will it be difficult to find them? And if we put apples on the basket called apples, and put pears on the basket called pears...does this greatly simplify the speed at which we can find the designated kiwi? If this vegetable is our file, then the basket we use is called a directory. A new problem has arisenExit without saving under Linux. Although we throw the peaches into the basket called peaches, it is still difficult for us to find the peaches from Pengzhou, Guangzhou, Guangdong among thousands of peaches. If you are smart, you must have thought of putting a lot of baskets called Heilongjiang, Sichuan, red hat linux download, and Shanghai into the peach basket, and put peaches from different origins into them. Yes! That’s it! We can complete a new file directory under a file directory and manage the files in a particularly detailed manner. At this point you understand what are called directories, and you also understand that directories can be nested, and that's it. Directory technology is a way to manage resources on the basis of software.

Back to the management of hard disks in Linux: On Linux, we do not have the concept of c drive, we use directories to manage it. Correspond each partition to a certain directory, and subsequent operations on this directory are operations on this partition. This achieves the unification of hardware management methods and software directory management methods. This process of mapping partitions and directories is called mount-mount. These correspondences can be interrupted and changed by the user at any time.

SWAP swap partition

Here we need to mention the swap partition. If we don't have enough video memory, we actually can't run some small software. The solution is to carve out an area on the hard disk as temporary video memory. It seems that the video memory has become larger. The Windows operating system calls this area virtual memory, and Linux calls it the swap partition. In fact, with the increase in hardware prices, video memory no longer limits us, and the concept of swap partitions has been retained, but there are reasons to continue to retain it. In fact, we will not discuss more about kernel issues. What we want to explain is that, When installing Linux and building a swap partition, if your video memory is only 64M or 128M, it is best to set the swap partition to three times its size. If your partition is large enough, 256M or 512M, then set it to the same size. . And please note that the best size is a number of 2 raised to the N power.

Partition format

ハードドライブは、情報を電磁的な形式で記録する単なる媒体であり、さまざまな形式で管理できます。オペレーティング システムが異なれば選択する形式も異なり、同じオペレーティング システムでも複数の形式をサポートする場合があります。 Google のオペレーティング システムは、DOS パーティション フォーマットとして fat16 フォーマットを選択しました。これまで、Windows 95 と Windows 98 は fat32 フォーマットをサポートし、Windows 2000 と XP は NTFS5 と fat32 をサポートしていましたが、Linux では一般的なパーティション フォーマットをサポートしていませんでした。 Linux はオープン オペレーティング システムです。当初は ext2 形式が使用され、その後 ext3 形式が使用されました。また、多くのミニコンピュータで UNIX で使用されている XFS 形式や、Google の Fat 形式、NTFS 形式など、幅広いパーティション形式もサポートしています。

ハードドライブをパーティション分割するときは、使用するパーティション形式を指定する必要があります。

linux保存退出vi_linux保存退出命令行_linux下退出不保存

Linuxのディレクトリ構造を理解する

ディレクトリはファイルを便利に管理するためのツールですが、Linux ではどのような種類のファイルがさまざまなディレクトリに保存されますか?

ディレクトリ名の意味

/bin このディレクトリには、一般的な Linux コマンドが保存されます。一部のバージョンでは、ルート ディレクトリと同じディレクトリになります。

/boot このディレクトリには、システムの起動時に使用されるプログラムが保存されます。lilo で Linux を起動するときに、ここの情報の一部が使用されます。

/dev このディレクトリには、Linux システムで使用されるすべての外部デバイスが含まれています。実際には、これらの外部デバイスにアクセスするためのポートであり、ファイルやディレクトリにアクセスすることと何ら変わりません。たとえば、システムで「cd/dev/cdrom」と入力すると、ハードディスク内のファイルが表示され、「cd/dev/mouse」と入力すると、キーボード関連のファイルが表示されます。

/cdrom システムを初めてインストールするとき、このディレクトリは空です。「mount/dev/cdrom/cdrom」のように、このディレクトリにハードディスク ファイル システムをマウントできます。

/etc このディレクトリには、ネットワーク設定ファイル、ファイルシステム、X システム設定ファイル、デバイス設定情報、設定されたユーザー情報など、システム管理に使用されるさまざまな設定ファイルおよびサブディレクトリが保存されます。

/sbin このディレクトリは、システム管理者のシステム管理プログラムを格納するために使用されます。

/home 「xx」という名前のユーザーを作成すると、ユーザーのホーム ディレクトリを保存するために、/home ディレクトリに対応する「/home/xx」パスが作成されます。

/lib このディレクトリは、システム ダイナミック リンク共有ライブラリを保存するために使用されます。ほとんどすべてのアプリケーションは、このディレクトリ内の共有ライブラリを使用します。

/lost+found ほとんどの場合、このディレクトリは空です。ただし、突然の断水や異常クラッシュが発生した場合には、一部のファイルがここに一時的に保管されます。

/mnt このディレクトリは通常は空です。このディレクトリに他のファイル システムを一時的にマウントできます。

/proc は、このディレクトリ内のシステム情報を取得できます。この情報は、システム自体によってビデオ メモリ内に形成されます

/root スーパーユーザーとしてログインしている場合、これはスーパーユーザーのホームディレクトリです

/tmp は、さまざまなプログラムの実行時に形成される一時ファイルを保存するために使用されます

/usr ユーザーの多くのアプリケーションとファイルがこのディレクトリに保存されます

2. Linux の基本コマンドの完全なリスト

ファイアウォールをオフにする

systemctlstopfirewalld.service

linux保存退出vi_linux保存退出命令行_linux下退出不保存

起動時にファイアウォールを有効にすることは固く禁止されています

systemctldisablefirewalld.service

SELinuxをオフにする

nano-w/etc/selinux/config

SELINUX=enforcing を SELINUX=disabled に変更し、保存して終了します: ^x->y->Enter を押します

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

コマンド: ls

-a このオプションは、.

で始まる隠しファイルを表示できます。

-i 各ファイルの i ノード番号を表示します

-m すべての項目をコロンで区切って、行幅全体を埋めます

linux保存退出命令行_linux保存退出vi_linux下退出不保存

-R はすべてのサブディレクトリ レベルを同時に列挙します

-h は、列挙されたファイルのサイズを使いやすい形式で出力します

--color=tty (2 - 数字) ファイルを表示するときに色をプロンプトします

ディレクトリ実行ファイル結合ファイル通常ファイル

黒赤薄黄色ストライプ

ファイルステータスの変更時間を表示する

ls-lc[ファイル名]

ファイルのアクセス時間を表示する

ls-lu[ファイル名]

ファイルが最後に変更された時期を確認する

ls-l

ファイルの詳細なアクセス時間を表示します

ls–フルタイム

ローカルディレクトリ内の「.」で始まるファイルを表示します

ls-d.*

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

コマンド: date は現在のシステム時間を表示します

コマンド形式: date[オプション]

-R は、RFC822 ドキュメントの時間形式に従って時間を実装します

-r filename はファイルの最終変更日を表示します

-u は utc 時間 (世界時) を表示します

過去/未来の時間を表示するには日付を使用します

The above is the detailed content of Explore the basics of Linux: the mysteries of hard drives and partitioning techniques. For more information, please follow other related articles on the PHP Chinese website!

source:itcool.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!