Basic knowledge of Hardware Management in Linux (4)

Source: Internet
Author: User

The following describes my first Linux installation experience and how to handle it. I hope it will help you. If you do not like it, you can skip it. The following is the basic knowledge of Hardware Management in Linux.

4. Application of different representation methods of storage devices;

1./dev/hd [a-z] indicates the application of the method.

1) used to mount a file system partition;

As we mentioned earlier, the hard disk partition/dev/hd [a-z] X representation method is generally used to mount and read file systems;

[Root @ localhost ~] # Fdisk-l Disk/dev/hda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065*512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/hda1 * 1 970 7791493 + 7 HPFS/NTFS/dev/hda2 971 9729 70356667 + 5 Extended/dev/hda5 971 2915 15623181 B W95 FAT32/dev/hda6 2916 4131 9767488 + 83 Linux/dev/hda7 4132 5590 11719386 83 Linux/dev/hda8 5591 6806 9767488 + 83 linux/dev/hda9 6807 9657 22900626 83 Linux/dev/hda10 9658 9729 578308 + 82 Linux swap/Solaris

For example, if I want to mount/dev/hda9 to the system, the process should be like this;

[Root @ localhost ~] # Mkdir/opt/data/Note: Create a mount point directory;
[Root @ localhost ~] # Mount/dev/hda9/opt/data/Note: mount;

Is it mounted? Check the following information and check that the file has been mounted. Therefore, we can write to the/opt/data directory, and all the written content is recorded on/dev/hda9;

[Root @ localhost ~] # Df-lh
Filesystem capacity in use available % mount point
/Dev/hda7 11G 9.2G 1.1G 90%/
/Dev/shm 236 M 0 236 M 0%/dev/shm
/Dev/hda9 22G 3.9G 18G 18%/opt/data

Note: Kernel support is required for mounting, and file systems must be created for partitions. For more information, see related documents;

2) It is used to specify the location of the Linux Root partition in GRUB;
In the GRUB System Boot manager, you must specify the Linux Root/hard disk partition/dev/hd [a-z] X when starting an operating system using the command line; for example, root =/dev/hda7;

2. hd [0-n] indicates the application of the method;
This is generally applied to the specified hard disk partition where GRUB/boot is located; it must be applied to the GRUB command line and GRUB configuration file menu. lst;

For example, if you want to write GRUB to the hard disk MBR, you must specify GRUB through root (hd [0-n], y) in the GRUB command line mode; here, root (hd [0-n], y) is the partition where/boot is located in GRUB. Do not make a mistake, sometimes, the root/of/boot and Linux are not in the same partition. It depends on how you install Linux; the preceding root =/dev/hd [a-z] X specifies the partition where the Linux root/is located. Although sometimes/boot AND/are in the same partition, however, the two methods have their own purposes in GRUB;

For example, if/boot is located in the same hard disk partition, you can use a similar method to write GRUB to the hard disk MBR. For example;

[Root @ localhost ~] # Grub Note: Run GRUB; grub> root (hd0, 6) Note: for example, if/boot is located on the (hd0, 6) partition, Filesystem type is ext2fs, partition type 0x83 grub> setup (hd0) Checking if "/boot/grub/stage1" exists... yes Checking if "/boot/grub/stage2" exists... yes Checking if "/boot/grub/e2fs_stage1_5" exists... yes Running "embed/boot/grub/e2fs_stage1_5 (hd0 )"... 15 sectors are embedded. succeeded Running "install/boot/grub/stage1 (hd0) (hd0) 1 + 15 p (hd0, 6)/boot/grub/stage2/boot/grub. conf "... succeeded Done.
Grub> quit Note: exit the GRUB command line mode;
If you don't understand it, it will take a while. I am only writing for the application. If you want to understand why Linux storage devices express this or that, we recommend that you check the kernel document. Chinese documents may not meet your needs. It is best to look at foreign documents;

I hope that the "Two Representation Methods for storing devices in Linux" will be helpful to you.

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.