1、通过fdisk –l 查找每个磁盘分区的大小。
Disk /dev/sda: 80.0 GB, 80025280000 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 9729 78043770 8e Linux LVM
分区大小:(End - Start) × 8225280 / (1024 * 1024 * 1024) = 74.4GB
2、格式化分区
mkfs.ext4 –L /svncode /dev/sda2
3、挂载分区
mount /dev/sda2 /svncode
4、查找uuid号
ls –l /dev/disk/by-uuid
0ad7ea81-8e54-4b51-9f22-ab08934f40fd -> ../../sda2
5、修改 /etc/fstab 文件
uuid=0ad7ea81-8e54-4b51-9f22-ab08934f40fd /svncode ext4 defaults 1 2
6、重启电脑
shutdown –r now