VisualBox中增大linux硬盘空间的方法
生活随笔
收集整理的這篇文章主要介紹了
VisualBox中增大linux硬盘空间的方法
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1:在VisualBox的安裝目錄命令行中執(zhí)行
VBoxManage.exe modifyhd e:\os\RedHat5.6.vdi --resize 20000
把RedHat5.6.vdi 改為20G,必須停止虛擬機
2:進入linux,root操作
fdisk -l?
可以看到/dev/sda變 21G了。
[jifeng@jifeng04 ~]$ su - 密碼: [root@jifeng04 ~]# fdisk -lDisk /dev/sda: 21.0 GB, 20971520000 bytes 255 heads, 63 sectors/track, 2549 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0001395dDevice Boot Start End Blocks Id System /dev/sda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 64 1045 7875584 8e Linux LVMDisk /dev/mapper/VolGroup-lv_root: 3833 MB, 3833593856 bytes 255 heads, 63 sectors/track, 466 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000Disk /dev/mapper/VolGroup-lv_swap: 4227 MB, 4227858432 bytes 255 heads, 63 sectors/track, 514 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000從1046到2549沒有劃分磁盤,也就是說這一部分是未分區(qū)的。3:創(chuàng)建分區(qū)
[root@jifeng04 ~]# fdisk -lDisk /dev/sda: 21.0 GB, 20971520000 bytes 255 heads, 63 sectors/track, 2549 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0001395dDevice Boot Start End Blocks Id System /dev/sda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 64 1045 7875584 8e Linux LVM /dev/sda3 1045 2549 12086234+ 83 LinuxDisk /dev/mapper/VolGroup-lv_root: 3833 MB, 3833593856 bytes 255 heads, 63 sectors/track, 466 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000Disk /dev/mapper/VolGroup-lv_swap: 4227 MB, 4227858432 bytes 255 heads, 63 sectors/track, 514 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000
必須重啟 [root@jifeng04 ~]# reboot
4:格式化 [root@jifeng04 ~]# mkfs.ext3 /dev/sda3 mke2fs 1.41.12 (17-May-2010) 文件系統(tǒng)標簽= 操作系統(tǒng):Linux 塊大小=4096 (log=2) 分塊大小=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 755904 inodes, 3021558 blocks 151077 blocks (5.00%) reserved for the super user 第一個數(shù)據(jù)塊=0 Maximum filesystem blocks=3095396352 93 block groups 32768 blocks per group, 32768 fragments per group 8128 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208正在寫入inode表: 完成 Creating journal (32768 blocks): 完成 Writing superblocks and filesystem accounting information: 完成This filesystem will be automatically checked every 36 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. 5:掛載硬盤
[root@jifeng04 /]# mount -t ext3 /dev/sda3 /storage [root@jifeng04 /]# df -h 文件系統(tǒng) 容量 已用 可用 已用%% 掛載點 /dev/mapper/VolGroup-lv_root3.6G 1.7G 1.7G 50% / tmpfs 939M 0 939M 0% /dev/shm /dev/sda1 485M 32M 429M 7% /boot /dev/sda3 12G 157M 11G 2% /storage
6:自動掛載硬盤
vi /etc/fstab,最后一行加上
總結(jié)
以上是生活随笔為你收集整理的VisualBox中增大linux硬盘空间的方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Sqoop 1.99.3 hadoop
- 下一篇: MapReduce实现join操作