5. Use FDISK/DEV/SDA to enter menu items, m is List menu, p is list partition table, n is add partition, W is save and eject. Since there are only 5 g of disks added here, 5G is zoned as a single zone.
[Email protected] ~]# fdisk-l
disk/dev/sda:16.1 GB, 16106127360 bytes
255 heads, Sectors/track, 1958 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/DEV/SDA1 * 1 104391 Linux
/dev/sda2 1305 10377990 8e Linux LVM
[email protected] ~]# FDISK/DEV/SDA
The number of cylinders for this disk was set to 1958.
There is nothing wrong with the, but this is larger than 1024,
And could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from the other OSs
(e.g., DOS fdisk, OS/2 fdisk)
Command (M for help): P
disk/dev/sda:16.1 GB, 16106127360 bytes
255 heads, Sectors/track, 1958 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device boot start end blocks id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1305 10377990 8e Linux LVM
Command (M for help): N
Command Action
E Extended
P primary partition (1-4)
P
Partition number (1-4): 3
First cylinder (1306-1958, default 1306): +1306
Last cylinder or +size or +sizem or +sizek (1306-1958, default 1958): +1958
Value out of range.
Last cylinder or +size or +sizem or +sizek (1306-1958, default 1958):
Using Default Value 1958
Command (M for help): P
disk/dev/sda:16.1 GB, 16106127360 bytes
255 heads, Sectors/track, 1958 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/DEV/SDA1 * 1 104391 Linux
/dev/sda2 1305 10377990 8e Linux LVM
/dev/sda3 1306 1958 5245222+-Up Linux
Command (M for help): W
The partition table has been altered!
Calling IOCTL () to re-read partition table.
Warning:re-reading the partition table failed with error 16: The device or resource is busy.
The kernel still uses the old table.
The new table is used at the next reboot.
Syncing disks.
/dev/sda3 1306 1958 5245222+-Up Linux
[email protected] ~]# reboot #需reboot一下机器继续如下步骤
[Email protected] ~]#Df-h #挂载前的分区情况
File system capacity has been used with available% mount points
/dev/mapper/volgroup00-logvol00
8.6G 2.8G 5.4G 35%/
/DEV/SDA1 99M 12M 82M 13%/boot
Tmpfs 125M 0 125M 0%/dev/shm
6. Format the partition with Mkfs.ext3/dev/sda3
[Email protected] ~]# Mkfs.ext3/dev/sda3
MKE2FS 1.39 (29-may-2006)
Filesystem label=
OS Type:linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
656000 inodes, 1311305 blocks
65565 blocks (5.00%) reserved for the Super user
First Data block=0
Maximum filesystem blocks=1346371584
Groups block
32768 blocks per group, 32768 fragments per group
16000 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Writing Inode Tables:done
Creating Journal (32768 blocks): Done
Writing superblocks and filesystem accounting Information:done
This filesystem would be automatically checked every mounts or
Whichever comes first. Use Tune2fs-c or-i to override.
[[email protected] ~]# CD/
[email protected]/]# mkdir/cm #增加一个/cm
[Email protected]/]#mount/dev/sda3/cm #挂载分区到/cm
[Email protected]/]#df-h #挂载后的分区情况
File system capacity has been used with available% mount points
/dev/mapper/volgroup00-logvol00
8.6G 2.8G 5.4G 35%/
/DEV/SDA1 99M 12M 82M 13%/boot
Tmpfs 125M 0 125M 0%/dev/shm
/dev/sda3 5.0G 139M 4.6G 3%/cm
7. Set Boot auto-load
Create mount point: After mkdir/cm mount, modify the Vi/etc/fstab partition table file,
At the end of the file add /dev/sda3/cm ext3 defaults 0 0 then save and restart.
(Note: If the partition table is incorrect, it will result in the Linux desktop system, but then the system will enter the CommandLine mode, we can fix the wrong fstab in commandline mode, However, by default this commandline mode will be the Read-only file system, which means that any modifications you make are not allowed, but you can remove this restriction by command mount/O remount,rw.
Linux virtual machines Increase disk space