- 浏览: 279788 次
- 性别:
文章分类
最新评论
一.总结一下CentOS的磁盘分区:
1.查看硬盘内的相关信息,看是否可以继续进行分区(我的虚拟机中只有一块硬盘,为/dev/sda,别的Linux版本可能是/dev/hda)
[root@bogon ~]# 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)
#2610表示共有2610个柱面,故分区只可以到第2610
Command (m for help): m #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
m print this menu
n add a new partition #添加新分区
o create a new empty DOS partition table
p print the partition table #打印分区表
q quit without saving changes #不保存离开
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit #保存离开
x extra functionality (experts only)
Command (m for help): p
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 1912 15358108+ 83 Linux
/dev/sda2 1913 1979 538177+ 82 Linux swap / Solaris
#从/edv/sda2可看出才分到1979,总共可分到2610,故可在进行分区
2.继续新增分区
Command (m for help): n #输入n,新增分区
Command action
e extended #拓展分区
p primary partition (1-4) #主分区
e #添加拓展分区
Partition number (1-4): 3 #随便填一个没有的分区号,注意最多有四个主分区,若还想多分,则必须是3个主分区再加拓展分区
First cylinder (1980-2610, default 1980):
Using default value 1980
Last cylinder or +size or +sizeM or +sizeK (1980-2610, default 2610): #也可自己选择大小如:+1G
Using default value 2610
Command (m for help): p #打印
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 1912 15358108+ 83 Linux
/dev/sda2 1913 1979 538177+ 82 Linux swap / Solaris
/dev/sda3 1980 2610 5068507+ 5 Extended
Command (m for help): d #删除分区
Partition number (1-5): 3
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (1980-2610, default 1980):
Using default value 1980
Last cylinder or +size or +sizeM or +sizeK (1980-2610, default 2610):
Using default value 2610
Command (m for help): p
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 1912 15358108+ 83 Linux
/dev/sda2 1913 1979 538177+ 82 Linux swap / Solaris
/dev/sda3 1980 2610 5068507+ 83 Linux
Command (m for help): w #保存离开,若是练习则输入q,不保存离开
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: 设备或资源忙.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@bogon ~]# reboot
3.磁盘格式化:mke2fes -j -L "fdiskTest" /dev/sda3 #将刚刚建立的/dev/sda3格式化为ext3,且名称为fdiskTest
命令执行完如下:
mke2fs 1.39 (29-May-2006)
Filesystem label=fdiskTest
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
633984 inodes, 1267126 blocks
63356 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1300234240
39 block groups
32768 blocks per group, 32768 fragments per group
16256 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 will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@bogon ~]#
4.磁盘检验:fsck -C -t ext3 /dev/sda3 #检查前面我们建立的/dev/sda3设备
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
fdiskTest: clean, 11/633984 files, 55186/1267126 blocks
[root@bogon ~]#
5.磁盘载入:将刚建立的/dev/sda3载入到/fdiskTest
mkdir /fdiskTest
mount -t ext3 /dev/sda3 /fdiskTest
df
6.设置启动载入
在/etc/fstab中设置
vi /etc/fstab
#在文件中添加 LABEL=fdiskTest /fdiskTest ext3 defaults 0 0
补充:
查看系统分区情况命令: fd -h
发表评论
-
eclipse下配置hadoop插件
2012-12-13 20:31 721http://phz50.iteye.com/bl ... -
virtualbox设置共享文件夹
2012-10-19 16:28 902主机:win7 虚拟机:ubuntu10.04 步 ... -
Oracle VM VirtualBox各种显示模式切换 热键
2012-10-19 14:24 2132里面有个HOME键,注意这个HOME键不一定是键盘上的HOME ... -
Ubuntu下Google Chrome字体模糊的完美解决方案
2012-04-23 12:35 2594整理自:http://diybbs.zol.com.cn/1/ ... -
VirtualBox网络连接小结
2012-04-19 17:00 3567转自:http://www.xcar.com.cn/bbs/v ... -
UBUNTU开启TELNET服务
2011-12-03 15:48 1022源自: http://forum.ubuntu.org.c ... -
搜索所v
2011-12-03 15:18 0斯蒂芬 -
tarball的管理与建议
2011-12-03 10:57 1233源自:http://hi.baidu.com/il ... -
Linux启动过程(详细说明)
2011-12-02 16:21 928源自:http://forum.ubun ... -
linux 系统启动流程
2011-12-02 11:15 678linux系统的启动过程是这样的: ... -
ubuntu恢复默认面板(上下两个)
2011-11-30 09:25 939作为一个 Ubuntu 用户,当你用 Ubuntu/Gnome ... -
linux硬连接和软连接
2011-11-28 19:35 1025Linux中的文件读取方式为: 先通过一层一层的 ... -
Linux FHS目录文件
2011-11-28 15:16 776根据FHS定义,linux中每 ... -
ubuntu10.10重启X-window
2011-11-27 22:00 912重启X-Window 按下 Ctrl + Alt + Bac ... -
ubuntu的一些目录和文件
2011-11-27 22:06 1735文件或目 ... -
ubuntu 技巧
2011-11-27 20:18 1168http://wiki.ubuntu.org.cn/Ub ... -
linux中的硬件设备号
2011-11-26 16:49 1199在Linux系统中 ,每台设备都被当成一个文件来对待,举例来 ... -
winetricks
2011-11-25 09:29 2516以下引自:http://wingo1990.blog.163. ... -
ubuntu wine
2011-11-23 11:14 1571安装完毕后在终端输入:winecfg 这个命令在使用W ... -
ubuntu 下软件的安装与卸载
2011-11-23 10:39 773安装软件 命令: apt-get install sof ...
相关推荐
CentOS5.6环境下设置yum代理
centos5.6安装oracle10g详细过程
Centos5.6中Redmine1.2.1安装过程,自己整理的文档,听过多次安装试验,绝对有效
自己看文档,亲自操作后的整理的关于centos5.6 dns的基本配置步骤,希望帮助迷茫的你
在Win7下的VMWare10下安装CentOS6.5
Centos 5.6搭建构建安全可靠的sendmail邮件服务器.docx
centos详细安装资料,付截图。照着做就行了
Centos5.6安装详细步骤、java开发环境搭建与配置、驱动安装[802.11无线网卡驱动、显卡驱动等] 环境: (联想G460[原系统win7 ,分了150用以装Centos]) 目标操作系统:Centos 5.6 [64位的哟] CPU:Intel(R) Core(TM) i3...
centos 7下的mysql 5.6离线安装包(rpm文件),附readme操作手册,过程详细,亲测可用。
Linux 作为一款开源免费的软件已被大多数人所熟知,并且已经有越来越多的服务器在使用这一系统,然而Linux的发行版本众多,CentOS也是Linux众多发行版中的一员。由于CentOS还需根据服务器的具体用途来配置,所以下面...
安装顺序 rpm -ivh cpp-4.1.2-42.el5.i386.rpm rpm -ihv kernel-headers-2.6.18-92.el5.i386.rpm rpm -ivh glibc-headers-2.5-24.i386.rpm rpm -ivh glibc-devel-2.5-24.i386.rpm rpm -ivh libgomp-4.1.2-42.el5....
说明Centos5.6下安装oracle10g的安装方法。
centos 5.6安装图解,CentOS(Community ENTerprise Operating System)是Linux发行版之一,它是来自于Red Hat Enterprise Linux依照开放源代码规定释出的源代码所编译而成。由于出自同样的源代码,因此有些要求高度...
装完系统,如果发现根目录太小,而home目录又很大,想把home目录空间调整给根目录,该怎么办呢?最佳实践,本人亲测
该文档详细介绍了CentOS5.6平台下DNS安装、配置与测试。
VMware虚拟机CentOS 7 磁盘扩容
CentOS5.6安装手册 CentOS (Commnity Enterprise Operating System)是Linux发行版之一,它是来自于Red Hat Enterprise Linux依照开放源代码规定释出的源代码所编译而成。
centos5.6环境中安装oracle11g的简单步骤。 个人根据Oracle联机帮助文档 安装过程中的记录。
centos5.6上安装oracle 11g rac
CentOS 5.6编译安装Apache2.4.1+MySQL5.5.21+PHP5.3.10