環境
服務器安裝有一個
Command (m for help): p
Disk /dev/hda:
Units = cylinders of
Device Boot Start End Blocks Id System
/dev/hda
/dev/hda
/dev/hda
/dev/hda
/dev/hda
然後現在希望從/home分區裡面分出大約
過程
首先
文章以我自己用的系統為例子
用慣了傳統調整硬盤工具的人可能會認為文件系統和硬盤的分區之間是統一的
|<-- hda1------>|<-- hda2------>|
+
|XXXXXXXXXXXXXXX|XXXXXXXXXX| |
|XXXXXXXXXXXXXXX|XXXXXXXXXX| |
+
硬盤分區/dev/hda
基本的原理就是這樣
[root@ringmail root]# umount /home
[root@ringmail root]# resize_reiserfs
<-------------resize_reiserfs, 2002------------->
reiserfsprogs
You are running BETA version of reiserfs shrinker
This version is only for testing or VERY CAREFUL use
Backup of you data is recommended
Do you want to continue? [y/N]:y
Processing the tree:
nodes processed (moved):
int
leaves
unfm
total
check for used blocks in truncated region
ReiserFS report:
blocksize
block count
free blocks
bitmap block count
Syncing
由於/home原來的大小是
這樣我們就已經完成了文件系統大小調整的工作
調整完文件系統的大小以後
[root@ringmail root]# reiserfsck
現在我們已經完成文件系統的大小調整工作
現在我們要開始進行整個操作裡面最危險的操作
啟動fdisk
[root@ringmail root]# fdisk /dev/hda
The number of cylinders for this disk is set to
There is nothing wrong with that
and could in certain setups cause problems with:
(e
Command (m for help): p
Disk /dev/hda:
Units = cylinders of
Device Boot Start End Blocks Id System
/dev/hda
/dev/hda
/dev/hda
/dev/hda
/dev/hda
Command (m for help): d
Partition number (
Command (m for help): n
Command action
l logical (
p primary partition (
l
First cylinder (
Last cylinder or +size or +sizeM or +sizeK (
Command (m for help): p
Disk /dev/hda:
Units = cylinders of
Device Boot Start End Blocks Id System
/dev/hda
/dev/hda
/dev/hda
/dev/hda
/dev/hda
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re
WARNING: Re
busy
The kernel still uses the old table
The new table will be used at the next reboot
Syncing disks
這裡需要說明的是
通過以上步驟
[root@ringmail root]# umount /home/
[root@ringmail root]# resize_reiserfs /dev/hda
<-------------resize_reiserfs, 2002------------->
reiserfsprogs
ReiserFS report:
blocksize
block count
free blocks
bitmap block count
Syncing
完成以後原有分區的大小調整操作已經結束
[root@ringmail root]# fdisk /dev/hda
The number of cylinders for this disk is set to
There is nothing wrong with that
and could in certain setups cause problems with:
(e
Command (m for help): p
Disk /dev/hda:
Units = cylinders of
From:http://tw.wingwit.com/Article/program/Oracle/201311/18109.html