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

How to format disk in Linux system

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

What this article shares with you is about how to format the disk in the Linux system. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

1. Check the disk 12345df-h # Note that the Ali CVM cannot see the data disk using the df-h command before it is partitioned and formatted. You can view your own data disk fdisk-l using the following command

two。 Run fdisk / dev/xvdb to partition the data disk. According to the prompt, type n _ wq _ 1 in turn, enter enter twice, and the partition will begin.

3. Run the fdisk-l command to view the new partition. A new partition xvdb1 has been created. Such as / dev/xvdb1 in the following example.

4. Run mkfs.ext3 / dev/xvdb1 to format the new partition. The time required for formatting depends on the size of the data disk. You can also choose other file formats, such as ext4, etc.

5. Run echo'/ dev/xvdb1 / mnt ext3 defaults 00'> > / etc/fstab to write the new partition information. When you are finished, you can use the cat / etc/fstab command to view

Note: Ubuntu 12.04 does not support barrier, so the correct command for this system is: echo'/ dev/xvdb1 / mnt ext3 barrier=0 00'> > / etc/fstab if you need to mount the data disk to a folder, for example, to store web pages separately, you can modify the / mnt section of the above command.

6. Run mount / dev/xvdb1 / mnt to mount the new partition, and then execute df-h to view the partition. If the data disk information appears, it means that the mount is successful and the new partition can be used.

123456mount / dev/xvdb1 / mntdf-hFilesystem Size Used Avail Use% Mounted on/dev/xvda1 40G 1.5G 36G 4% / tmpfs 498M 0498M 0% / dev/shm/dev/xvdb1 5.0G 139m 4.6G 3% / mnt

The above is how to format the disk in the Linux system, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report