Linux下增加硬盘空间
来源:互联网 发布:windows10虚拟mac系统 编辑:程序博客网 时间:2024/05/01 06:46
虚拟机VMWare分配硬盘太小,预增加硬盘空间
查看当前分区情况:
# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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 650 5116702+ 83 Linux
/dev/sda3 651 841 1534207+ 82 Linux swap / Solaris
# fdisk /dev/sda
The number of cylinders for this disk is set to 2610.
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)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Selected partition 4
First cylinder (842-2610, default 842):
Using default value 842
Last cylinder or +size or +sizeM or +sizeK (842-2610, default 2610):
Using default value 2610
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: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
再次查看,分区已经划好:
[root@db1 /]# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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 650 5116702+ 83 Linux
/dev/sda3 651 841 1534207+ 82 Linux swap / Solaris
/dev/sda4 842 2610 14209492+ 83 Linux
但是格式化的时候,报错:
[root@db1 /]# mkfs -t ext3 /dev/sda4
mke2fs 1.39 (29-May-2006)
Could not stat /dev/sda4 --- No such file or directory
The device apparently does not exist; did you specify it correctly?
解决方法:执行下partprobe 命令
partprobe包含在parted的rpm软件包中。partprobe可以修改kernel中分区表,使kernel重新读取分区表。 因此,使用该命令就可以创建分区并且在不重新启动机器的情况下系统能够识别这些分区。
我们执行一下该命令:
# partprobe
Warning: Unable to open /dev/hdc read-write (Read-only file system). /dev/hdc has been opened read-only.
然后在格式化,就ok了:
# mkfs -t ext3 /dev/sda4
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1778880 inodes, 3552373 blocks
177618 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=3640655872
109 block groups
32768 blocks per group, 32768 fragments per group
16320 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
挂载硬盘
#mkdir /disk2# mount /dev/sda4 /disk2即将硬盘sdb4挂载到目录/disk2
验证挂载是否成功
# df -k
设置系统启动自动挂载硬盘
以上设置后,系统关闭挂载将消失,设置系统启动自动挂载硬盘方法为:
# vi /etc/rc.d/rc.local
在文件后增加
mount /dev/sda4 /disk2
- Linux下增加硬盘空间
- vmware增加linux硬盘空间
- Linux增加硬盘空间
- VMware ubuntu下增加硬盘空间
- Server2003 下带数据增加硬盘空间
- 通过vmware-vdiskmanager增加虚拟机Linux硬盘空间
- 通过vmware-vdiskmanager增加虚拟机Linux硬盘空间
- Vmware为Linux虚拟机增加硬盘空间
- 通过vmware-vdiskmanager增加虚拟机Linux硬盘空间
- vmware-vdiskmanager增加虚拟机Linux硬盘空间
- 应用vmware-vdiskmanager增加虚拟机Linux硬盘空间
- VMware 中linux(redhat)增加硬盘空间
- VMWare下扩展Linux硬盘空间
- VMware 下扩展linux硬盘空间
- VMWare下扩展Linux硬盘空间
- VMWare下扩展Linux硬盘空间
- VMWare下扩展Linux硬盘空间
- Linux下查看文件,文件夹,硬盘空间
- myeclipse10下修改默认字符为utf8
- 搜索智能提示suggestion,附近点搜索
- 越来越多地Windows Phone被西欧各国政府所采纳
- CUDA学习,第一个kernel函数及代码讲解
- C语言中fflush函数的使用方法
- Linux下增加硬盘空间
- hdu 2546 饭卡(有小小限制的 01背包)
- boost库学习随记六:使用同步定时器、异步定时器、bind、成员函数回调处理、多线程的同步处理示例等
- 内核同步机制概述
- <Practical C Programming> chapter 4
- 十字路口的老罗掉队了
- Overload 与 Override 的区别
- 通过系统缓冲流类提高I/O操作
- javaEE Tomcat目录结构