增加磁盘分区并使用大iNode数

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

[root@localhost dev]# ll sd*
brw-r----- 1 root disk 8, 0 Mar 2 22:32 sda
brw-r----- 1 root disk 8, 1 Mar 2 22:32 sda1
brw-r----- 1 root disk 8, 2 Mar 2 22:32 sda2
brw-r----- 1 root disk 8, 16 Mar 2 22:32 sdb
[root@localhost dev]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
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 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)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
e
Partition number (1-4): 1
First cylinder (1-2610, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610):
Using default value 2610

Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (1-2610, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-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.
Syncing disks.
[root@localhost dev]#

[root@localhost dev]# ll sdb*
brw-r----- 1 root disk 8, 16 Mar 2 22:37 sdb
brw-r----- 1 root disk 8, 17 Mar 2 22:37 sdb1
brw-r----- 1 root disk 8, 21 Mar 2 22:40 sdb5

[root@localhost dev]# 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 2610 20860402+ 8e Linux LVM

Disk /dev/sdb: 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/sdb1 1 2610 20964793+ 5 Extended
/dev/sdb5 1 2610 20964762 83 Linux



----------------------------------
fdisk -l ->命令行,查看分区

1.增加了磁盘 对磁盘分区
fdisk /dev/sdb ->命令行,对第二块磁盘分区


Command (m for help): m 帮助
n add a new partition
Command (m for help): n 新分区
Command action
e extended
p primary partition (1-4)
e 扩展
Partition number (1-4): 1
First cylinder (1-2088, default 1): 全部
Using default value 1

Command action 创建逻辑分区
l logical (5 or over)
p primary partition (1

-4)
l


Command (m for help): w 保存退出



格式化分区
mkfs.ext3 -N 5000000 /dev/sdb5

dumpe2fs -h /dev/sdb5

Inode count: 10007424
Block count: 4192949


挂载目录
[root@redhad ~]# mkdir /newdisk --建立一个新的挂接目录
[root@redhad ~]# mount /dev/sdb1 /newdisk --将sdb1挂接到/newdisk下
[root@redhad ~]# df -lh --查看目前硬盘空闲,新建硬盘已经成功挂接
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 28G 2.4G 24G 9% /
none 506M 0 506M 0% /dev/shm
/dev/sdb1 1004M 18M 936M 2% /newdisk

到此为止,我们的新硬盘已经加载成功了,但是这里有一个问题,一旦我们重新启动系统,还需要用mount命令重新挂接才能访问新硬盘,
如果我需要挂接的工作在系统启动过程中完成,那么我需要用vi配置/etc/fstab文件,将/dev/sdb1 /newdisk ext3 defaults 1 1 添加到/etc/fstab的最后,然后重新启动系统即可。

相关文档
最新文档