在做Oracle 备份恢复实验时,发现我的Linux虚拟机空间不足。
以下为增加10G空间的步骤。
一 将Linux系统Power Off ,在虚拟机设置中选择 Add-->Hard Disk-->Next ....
二 启动Linux,用Root用户进入系统
三 为磁盘创建文件系统:mkfs.ext3 /dev/sdb
四 挂载
[root@xugj ~]# mkdir /mnt/sdb
[root@xugj ~]# mount /dev/sdb /mnt/sdb
五 分区: fdisk /dev/sdb
-
[root@xugj ~]# fdisk /dev/sdb
-
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklab el
-
Building a new DOS disklabel. Changes will remain in memory only,
-
until you decide to write them. After that, of course, the previous
-
content won't be recoverable.
-
The number of cylinders for this disk is set to 1305.
-
There is nothing wrong with that, 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 other OSs
-
(e.g., DOS FDISK, OS/2 FDISK)
-
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
-
Command (m for help): m
-
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
-
………………
-
Command (m for help): n
-
Command action
-
e extended
-
p primary partition (1-4)
-
p
-
Partition number (1-4): 1
-
First cylinder (1-1305, default 1):
-
Using default value 1
-
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305):
-
Using default value 1305
-
Command (m for help): p
-
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
-
255 heads, 63 sectors/track, 1305 cylinders
-
Units = cylinders of 16065 * 512 = 8225280 bytes
-
Device Boot Start End Blocks Id System
-
/dev/sdb1 1 1305 10482381 83 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 0: 成功.
-
The kernel still uses the old table.
-
The new table will be used at the next reboot.
-
Syncing disks.
六: 将“挂载”动作添加到开机执行中
[root@xugj ~]# vi /etc/fstab
添加一行:
/dev/sdb /mnt/sdb ext3 defaults 0 1
七:检验
[root@xugj ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-LogVol00 5.7G 4.8G 596M 90% /
/dev/sda1 99M 9.8M 84M 11% /boot
tmpfs 379M 0 379M 0% /dev/shm
/dev/mapper/VolGroup00-LogVol01 4.9G 2.8G 1.9G 61% /home
/dev/mapper/VolGroup00-LogVol03 279M 48M 218M 18% /tmp
/dev/sdb 9.9G 151M 9.2G 2% /var
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30066956/viewspace-2105607/
,如需转载,请注明出处,否则将追究法律责任。