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 Ubuntu hard disk partition commands

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

Share

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

This article mainly introduces what Ubuntu hard disk partition commands have, with certain reference value, interested friends can refer to, I hope you have a lot of gains after reading this article, let Xiaobian take you to understand.

1. List Disk Ubuntu Hard Disk Partitions Command

sudo fdisk -l

Take my machine configuration as an example:

Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xd3b7d3b7 Device Boot Start End Blocks Id System /dev/sda1 * 1 2591 20812176 7 HPFS/NTFS /dev/sda2 2592 17876 122776762+ f W95 Ext'd (LBA) /dev/sda3 17877 19457 12699382+ 83 Linux /dev/sda5 2592 12790 81923436 7 HPFS/NTFS /dev/sda6 12791 17814 40355248+ 7 HPFS/NTFS /dev/sda7 17815 17876 497983+ 82 Linux swap / Solaris

Device name of hard disk: /dev/sda, size: 160GB There are 6 Ubuntu hard disk partitions, sda1,sda2,sda3,sda5,sda6,sda7

2. Create a new Ubuntu hard disk partition, followed by the hard disk device name.

sudo fdisk /dev/sda

Common subcommands are as follows:

p Show existing Ubuntu hard drive partitions n Create Ubuntu hard drive partitions t Change Ubuntu hard drive partition type d Delete Ubuntu hard drive partitions a Change Ubuntu hard drive partition boot flag w Change to Ubuntu hard drive partition Write hard drive and exit q Exit without saving changes

3. Create a file system (format equivalent to windows)

When Ubuntu hard disk partitions are created, you can use sudo mkfs -t ext3 /dev/sda3

4. mount file system

After the file system is established, it must be mounted before it can be used.

sudo mount device name folder name

sudo mount /dev/sda3 /home

If you want to mount the file system automatically at system startup, modify the/etc/fstab file

sudo vi /etc/fstab Add a line following the required format.

5. umount file system

If a file system is no longer in use, you can use the umount command. sudo mount device name or sudo mount mount point

Thank you for reading this article carefully, I hope Xiaobian shared "What are the Ubuntu hard disk partition commands" This article is helpful to everyone, but also hope that everyone will support more, pay attention to the industry information channel, more relevant knowledge waiting for you to learn!

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: 302

*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