[Basic knowledge] Linux Novice series of four _unix Linux

Source: Internet
Author: User

  On

  Novice to Linux [Series IV]

OK, I want to talk about the hard disk partition. Before I talk about this question, I'll talk about conceptual issues first, what are conceptual issues? Do you remember the first time, the absolute first time you heard a: disk, B: disk, C disk when the feeling? Before that, you might know that a computer has a place to store data, Because I've seen a tape drive on TV or on an ad. (I never know why I've been here a long, long time, a silly girl. Operating in front of a tape cabinet a tape device that now appears to be garbage will continue to be the default background for television broadcasts of computer-themed programs) or the image of a But you don't have a concept of how computers actually use these devices until you first hit Dir a: or Open Explorer to see A:C: The directory tree of the typeface. If you still remember the feeling, congratulations, this feeling is back.

For the average person, just need to know what the computer can do, so for them, what the simpler the better, the more do not need them to spend time to learn to understand the better, so the computer from the beginning of the punch to the later keyboard screen, and now to voice input intelligent interactive direction. It's good that people who turn computers into tools can be more focused on their work (and, of course, they'll pay us what they pay for the builders of computers). It can be said that MS is doing well in this area, and no one will deny that Windows is a very "good" operating system. This means that from the user, you do not need too much to understand the knowledge inside the chassis, or as far as possible not to understand, you can get the computer to work for you as soon as possible. For example, will be very complex hard drive through its operation in the middle of the C:D: E: Disk Such things, so that a need to be able to type the secretary mm can also know how to store files (of course, there will be stupid hopeless). But one of the problems with this (MS's doing everything for you) is obvious: you don't have a chance, or you don't have the opportunity to be forced to learn a deeper level of knowledge. And when you only Know "C:d: E:" In your head, you have to follow windows to go this way.

OK, here we are. Install the Linux hard drive partition problem. The problem is that every Linux novice, or even a certain level of people are afraid to say very clearly or mastered (including myself). Hard disk is a very strange thing, its basic temper is, a bit bad, a large chunk of data will be lost, and lost clean. I've seen someone's graduation thesis more than once. Three days before the defense due to hard disk problems and no backup! The installation of Linux must be with the hard part of the bottom of the disk to deal with, rather than win under the installation of a program so safe. So my first suggestion is that if you have important data on your hard disk, it's best not to install Linux. A better way is to find a less important machine, the hard disk can be partitioned formatted, more than a few Linux, more than a few tests of Windows and Linux in common. So after the heart of the bottom. If you really want to install, be sure to back up important data, remember.

Down on Linux for hard disk concept. Consider only IDE hard drives. The operation of a hard disk is divided into many layers. What we need to know is that the hard disk is made up of a lot of 512-byte sectors. And these sectors will be organized into a "Partition". These are the same for each operating system, on top of which each operating system manages its own partition. For Windows, it formats the partitions and then manages them according to the CDE disk. and Linux is different. So, a hard disk is divided into multiple partitions, installation of multiple operating systems such as Windows,linux,solaris, etc. is perfectly OK. However, because each operating system is different to partition operation, it can only be said that the operating system is installed into the partition without the installation of the operating system into the CDE disk (Umsdos method is not mentioned).

The No. 0 Sector of each hard disk is a special sector, and it does not belong to any partition. It stores two things: the first is a very small program, which is run by the computer when it is started, this program is typically an operating system with a startup program, it will start an operating system after running or give users the option to start an operating system. Windows 0 Boot program is simple, it is to start Windows, so you will not have multiple operating systems on a hard disk in the concept of coexistence. The Linux startup program allows you to choose which operating system to start, which is called Lilo. This thing we will often encounter it. The 0 sector also holds another important data: partition information. Previously said, the hard disk is partitioned, so in the end, this information is in 0 sectors. The partition rule for a hard disk is this: all sectors of a partition must be contiguous, and the hard disk can have up to four partitions, four of which can be four primary partitions or three primary partitions plus an extended partition. You can continue dividing logical partitions in the extended partition. For example, a 10G hard drive that installs Windows, has C:D: E: three disks. Then its partitioning situation can be as follows:

Partition one: Primary partition 4G, formatted as C: Disk

Partition two: Extended partition 4G Extended partition cannot be formatted, it can only be partitioned into logical partitions

Remaining space (can be partitioned three, four occupy) 2G

In the extended partition, create two logical partitions each 2G, formatted as d:e: disk.

So what does Linux look like? Note I mentioned that partitions are the same for any operating system, although Linux does not agree with C D e disks, but these partitions are the same. So Linux under look is also partition one, partition two things. But it is different to the markings and interpretations of these partitions.

Under Linux, a hard disk is a device, and virtually everything under Linux is a device. For IDE hard disks, Linux believes there are four devices that correspond to the four locations of the IDE's devices. If we've installed the machine, we know there are two slots on the motherboard, IDE0 and IDE1, and two devices can be hung on each slot, the main disk and the disk, which can be the hard drive or the optical drive. So what does Linux think of these devices? Under Linux, these devices are marked with/DEV/HDX. The main disk on the IDE0 is the/dev/hda, from the disk is the HDB, and so on, if you can have more than one IDE slot can be extended to Hde HDF and so on. In short, each of the devices connected to the hard drive line is considered by Linux as a/DEV/HDX device. If your machine is the main disk on the IDE0 slot is the hard drive, then it is HDA, if the IDE1 slot on the main disk is an optical drive, it is HDC. Under Windows Fdisk is to "hard disk 1", "Hard drive 2" to operate, and the Linux under the Fdisk is to/dev/hda,/dev/hdb and so on operation. It's very flexible and intuitive, isn't it?

So how does Linux look at partitions? The partitioning concept under Linux is that each partition on the hard disk is also a device (again). Their logo is/DEV/HDXY, where the hard drive is represented in front of the HDX root, and y represents the first partition. Take HDA as an example. HDA1 is the first partition, and HDA4 is the fourth partition location. Logical partitions start from HDA5. So just in that case, Linux seems to be HDA 10G. HDA1 is the primary partition and the format is indows. Hda2 is an extended partition where Hda5 and Hda6 are zoned out, and the format is windows. HDA also has 2G remaining space to continue to build Hda3 and HDA4. Note that logical partitions cannot be established because the hda2 space is already divided.

These hard drive things are easy to mix, suggest more practice, more summary. can refer to some of the books, the early DOS book in the installation part of some talk. Now there are a lot of Linux installation parts. In addition, there are some information on the Internet.

   Under

Understand the Linux partition processing. Down is the zoning strategy. When you start with a RH6.2 disc, always enter the default setting to a partition interface. Here you need to tell the Linux installer where to install Linux on the hard drive. You need to tell it some information, including building a new Linux partition, how big it is, and where to mount it. Here we need to introduce the concept of mount.

We know that hard disks can be partitioned into partitions, each of which is formatted by each operating system and then used. But there must be a way to use it. Windows, or DOS, is to hang (or mount) a nicely formatted partition into C:D: E: Disk. The allocation of the letter is determined by the operating system (it can be specified by the user after NT). Under Linux a partition how to use must be specified by the user themselves. Under Linux, partitions are not allocated according to C:D: E, but Hang (mount) to a directory. The entire UNIX storage space structure is a directory tree (not each c:d: E: Under each has its own tree). The top level is the root directory (in/out, note that no Windows backslash \) has a different directory at the root. First you need to have a partition mount/, and then create other directories underneath the root and mount the partitions to these directories. So as a whole, a UNIX storage system is a directory tree, but it can include many partitions, even other storage devices such as optical drives, memory disks, or network disks.

In addition to the Linux installation, there are several directories that are/usr,/home, and what we need to know is the/root. No matter what they do, in general we need to divide a space, specify it as the Linux native type, and mount point is one of these directories. It's also important to note that there are two types of Linux partitions, native is the kind that can store files to build directories, and a Linux swap, a Linux memory swap partition that must be specified when installing RH. So in the installation of the minimum need to divide a zone, type Linux native,mount to/on, and then a partition type Linux Swap,swap area does not mount for any directory, the system to deal with it separately.

Down is the partition size problem, install Linux generally 1G space for/almost, the initial installation for convenience, you can build a 2G partition mount point for/, and then a swap. The size of swap is as big as memory, Max 128M. Later installation can be based on their own hard disk requirements to build other partitions to mount such as/home.

For machines that already have Windows installed, you can delete a Windows partition in a Linux installer, typically a logical partition (you don't want to delete the C: disk), and then create a Linux partition in its space.

Linux/Can be a primary partition can be a logical partition. But the problem of 8G is to be noted. I think you've probably heard of 8G, what exactly is 8 g? The specific problem is more complex, simply put, the Linux/partition can not be mount to a hard disk after 8G partition. So if your hard drive has 16G, the former 6G has been divided into C: disk, after which is two 5G d:e: disk, you will have to remove the D-disk partition to build a Linux partition instead of e disk, because E disk already after 8G. Installing Linux after 8G is no problem, just can't start. Of course, this is a solution, but in the novice's state I still suggest as far as possible in accordance with the simplest situation, the future is ripe to practice the other.

After you have divided the area and continue to install, you are required to configure something else. Include root password, Lilo, configure network, x, and other things. of which Lilo is a more important part. You will be asked to install Lilo to the MBR, Partition boot sector, or a floppy disk. You need to choose whether to install it on the MBR or floppy. Generally installed on the MBR can be, in order to insure that the floppy disk, so that the machine to start with the hard disk or Windows, access to Linux can be started with floppy disk. Note that you need to turn off the virus warning in the BIOS, otherwise it cannot be installed on the MBR.

If your machine configuration comparison standard, network card, sound card, display card, etc. can automatically detect the words, all the way back, restart you can enter Linux. If the bad luck (in most cases) the NIC sound card does not match when starting up, it doesn't matter, like windows can be reconfigured in the future. In short these will not affect your installation.

OK, the machine reboots, and unlike ever, I don't see starting MS Windows 98 ... but a lilo: a prompt. This indicates that Lilo has been installed properly. You can enter Linux now by pressing ENTER. If you want to enter windows you can play DOS and then enter. If you specify a different Windows partition boot marker, you can use the [TAB] key to see what options you have.

This is a very often asked question, here's a word. For some reason you want to remove Linux, you know to start with a DOS disk and then fdisk remove the Linux partition or reinstall NT to remove the Linux partition. But when you're done with everything, Windows won't start, Lilo: This symbol is always there and the machine is dead. It is no use to repartition the format. Then some half bottle of vinegar may tell you "hopeless, low lattice bar." Remember, unless the hardware is damaged, the hard drive does not need a low grid at any time. This is because other installers do not rewrite the 0 sector, which is because the lilo caused by the MBR cannot be removed. The solution is simple, keep in mind: Start with a DOS disk, run the DOS fdisk/mbr. The command is to rewrite the 0-sector bootstrapper as a standard program for MS, which can start dos,windows,windowsnt, Windows 2000, without changing any other information on the hard drive partition. So it's absolutely safe, absolutely safe, absolutely safe. When you come across a lilo that can't be deleted, remember fdisk/mbr.

OK, you have successfully started Linux, entered a graphics or character interface requirements landing. Down you'll have piles of questions to ask. Come down I'll talk about how to ask questions and how to find help.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.