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

What are the representation methods of storage devices in Linux system

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "what are the representation methods of storage devices in Linux system". In daily operation, I believe that many people have doubts about the representation of storage devices in Linux system. I have consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "what are the expression methods of storage devices in Linux system?" Next, please follow the editor to study!

Application of different representations of storage devices

1. The application of / dev/hd [a Meiz] representation method

1) used to mount file systems (partitions) on mount

As we mentioned earlier, the partition of the hard disk / dev/hd [amurz] X representation is generally used to mount and read the file system.

[root@localhost] # fdisk-l Disk / dev/hda: 80.0 GB, 80026361856 bytes 255heads, 63 sectors/track 9729 cylinders Units = cylinders of 16065 * 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, I want to mount / dev/hda9 to the system; so 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 ready to mount? Looking at the information below, it shows that it has been mounted, so at this point we can write to the / opt/data directory, and everything written is recorded on / dev/hda9.

[root@localhost ~] # df-lh

Filesystem capacity used available used mount point

/ dev/hda7 11G 9.2G 1.1G 90% /

/ dev/shm 236M 0 236m 0% / dev/shm

/ dev/hda9 22G 3.9G 18G 18% / opt/data

Note: the mount requires kernel support, and the partition also needs to establish a file system. Please refer to the relevant documentation.

2) the location of the root partition used to specify the Linux in GRUB

In the GRUB system boot manager, when starting an operating system from the command line, specify the Linux root / the hard disk partition / dev/hd [amurz] X; such as root=/dev/hda7

2. The application of hd [0murn] representation.

This is generally applied to the specification of the hard disk partition where the / boot of GRUB is located; it should be applied to both the command line of GRUB and the configuration file menu.lst of GRUB

For example, if we want to write GRUB to the MBR of the hard disk, we need to specify it through root (hd [0murn], y) in the command line mode of GRUB; here root (hd [0murn], y) is the partition where / boot is located in GRUB; make no mistake, sometimes the root of / boot and Linux are not in the same partition, it depends on how you install Linux. The root=/dev/hd [a murz] X we mentioned earlier specifies the partition in which the Linux root / is located; although sometimes / boot and / are in the same partition, the two representations have their own uses in GRUB; see?

For example, if / boot is located in the same hard disk partition, you can write GRUB to the MBR of the hard disk in a similar way; for example

[root@localhost ~] # grub Note: run GRUB; grub > root (hd0,6) Note: for example, if / boot is on the (hd0,6) partition, it should be like 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) 1x 15p (hd0,6) / boot/grub/stage2 / boot/grub/grub.conf". Succeeded Done.

Grub > quit Note: exit GRUB command line mode

At this point, the study of "what is the representation of storage devices in the Linux system" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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