Configure Ubuntu hard disk partitioning and create a file system
Source: Internet
Author: User
Article Title: Configure Ubuntu hard disk partitioning and create a file system. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open source, and other basic categories 1. List disk partition commands
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
Hard Disk device name:/dev/sda, size: 160 GB
There are six partitions, sda1, sda2, sda3, sda5, sda6, and sda7.
2. Create a New partition. fdisk is followed by the hard disk device name.
Sudo fdisk/dev/sda
Common sub-commands are as follows:
P shows the existing Partition
N create a partition
T disk partition type
D. delete a partition.
A. Change the partition startup flag.
W writes changes to the partition to the hard disk and exits.
Q. Do not save the changes and exit
3. Create a file system (equivalent to windows format)
After creating a partition, you can use
Sudo mkfs-t ext3/dev/sda3
4. Mount the File System
After a file system is created, it must be mounted before use.
Sudo mount device name folder name
Sudo mount/dev/sda3/home
To automatically mount the file system when the system starts, modify the/etc/fstab file.
Sudo vi/etc/fstab
Add a row in the format required.
5. umount File System
If you no longer use a file system, you can use the umount command.
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.