Adding new partitions and setting mount points in Ubuntu are recently working on Android projects. However, after extracting the root file system, an alarm is reported that the hard disk is not enough. The configured size is 15 GB. However, it is very convenient to expand partitions. Of course, first you have to set the size of the hard disk to be added. this time I will increase it...
Adding new partitions and setting mount points in Ubuntu are recently working on Android projects. However, after extracting the root file system, an alarm is reported that the hard disk is not enough. The configured size is 15 GB. However, it is very convenient to expand partitions. Of course, first you have to set the size of the hard disk to be added. this time, I upgraded it to 30 GB to see if it has an alarm. 1. create a new partition first check the existing partition: root @ ubuntu:/# fdisk-l www.2cto.com Disk/dev/sda: 32.2 GB, 32212254720 bytes255 heads, 63 sectors/track, 3916 cylindersUnits = cylinders of 16065*512 = 8225280 bytesSector size (logical/physical): 512 bytes/512 bytesI/O size (minimum/optimal): 512 bytes/512 bytesDisk identifier: 0x000e11ac Device Boot Start End Blocks Id System/dev/sda1 * 1 1871 15021056 83 Linux/dev/sda2 1871 1958 704513 5 Extended/dev/sda5 1871 1958 704512 82 Linux swap/Solarisroot @ ubuntu: // # From the above information, we can see two primary partitions:/dev/sda1 and/dev/sda2, then we can create a/dev/sda3root @ ubuntu: // # fdisk/dev/sda WARNING: DOS-compatible mode is deprecated. it's stronugly recommended to switch off the mode (command 'C') and change display units to sectors (command 'u '). command (m for help): m for help. input m for help. Command action a toggle A bootable flag B edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu www.2cto.com n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table W write table to disk and exit x extra functionality (experts only) Command (m for help): From the above information, n is the add partition, that is, the new partition; w is the save. Command (m for help): nCommand action l logical (5 or over) p primary partition (1-4) create a logical partition or a primary partition. enter p here to create a primary partition. If: Selected partition 4No free sectors available indicates there is no idle hard disk, you have to manually add it to the virtual machine. Then press the default data input, and remember to input w to save. Q: exit. II. format the new partition and set the mount point. Format: root @ ubuntu:/# mkfs. create a mount point for ext4/dev/sda3: root @ ubuntu:/# mount-t ext4/dev/sda3/home/work to mount the new partition to the/home/work directory, the size of the/home/work directory is the size of the hard disk that you add first. Then you can see that there is a lost + found directory in home/work. 3. add a line to/etc/fstab to enable automatic mounting at system startup. the root file system should know: /dev/sda3/home/work ext4 defaults 1 0 www.2cto.com restart to get the result. View usage: root @ ubuntu: /# dfFilesystem 1K-blocks Used Available Use % Mounted on/dev/sda1 14784996 5147264 8886680 37%/none 248640 208 248432 1%/devnone 254244 248 253996 1%/dev/shmnone 254244 384 253860 1%/var /runnone 254244 0 254244 0%/var/lock/dev/sda3 15480852 8684096 6010376 60%/home/workroot @ ubuntu: // # of course, I have added many things in the/home/work directory.
Author centralperk
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.