- 论坛徽章:
- 1
|
紧急求救:根目录满了怎么办?
此文转贴,恕不负文责。另,请通读全文后再操作。
ZT: How to increase the size of root Partition.
overview:
() go to single user mode
() backup root partition
() boot cdrom
() use format to resize root/swap partitions
() create a new (empty) partition on root partition
() restore root partition
() run installboot to tell HW where to boot blocks are
on the root partition
() reboot to mulituser mode
instructions:
(1) bring machine to single user mode
(2) run fsck on root to make sure the filesystem is clean:
fsck /dev/dsk/c0t3d0s0
(3) load a tape and run ufsdump (the options to ufsdump
assume you've got an 8mm tape drive):
ufsdump 0vbf 126 /dev/rmt/<tape>; /dev/rdsk/c0t3d0s0
where <tape>; is your tape device. the 'v' option is
for verify, which'll take a bit longer since it verifies
the tape after the dump finishes by comparing its contents
the the filesystem. When the dump is done, remove the
tape, write protect it, and reload the tape.
(4) halt the system and boot into single user mode from cdrom:
boot cdrom -s
(5) when the OS is loaded, run format and select the appropriate
disk. hit 'p' to get to the partition menu, then 'p' again
to print the partition table. I'll use my disk as an example.
Here are my root and swap listings.
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 91 25.16MB (92/0/0)
1 swap wu 92 - 384 80.12MB (293/0/0)
I hit '0' to change the size of the root partition:
partition>; 0
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 91 25.16MB (92/0/0)
Enter partition id tag[root]: <return>;
Enter partition permission flags[wm]: <return>;
Enter new starting cyl[0]: <return>;
Enter partition size[51520b, 92c, 25.16mb]: 180c
I've just increased the size of my root partition from 92
cylinders to 180. The table now looks like:
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 179 49.22MB (180/0/0)
1 swap wu 92 - 384 80.12MB (293/0/0)
Note the new ending cylinder for root (179).
Now I change slice 1:
partition>; 1
Part Tag Flag Cylinders Size Blocks
1 swap wu 92 - 384 80.12MB (293/0/0)
Enter partition id tag[swap]: <return>;
Enter partition permission flags[wu]: <return>;
Enter new starting cyl[92]: 180
Enter partition size[164080b, 293c, 80.12mb]: 205c
The new starting cylinder for swap (180) is one greater than the
root's ending cylinder (179)
I reduced the size from 293c to 205c (205 = 384 - 179: the
swap's ending cylinder number minus the root's ending
cylinder number). I verify that there's no overlap:
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 179 49.22MB (180/0/0)
1 swap wu 180 - 384 56.05MB (205/0/0)
Make sure that root's ending cylinder is one less than the
swap's starting cylinder, and that the swap's ending cylinder is the
same as before the changes.
I now label the disk to make the new partition table permanent
partition>; label
You can quit out of format now.
(6) create a new filesystem on the root partition:
newfs /dev/rdsk/c0t3d0s0
This'll take a minute or two.
(7) run fsck on the new partition to make sure it's ok:
fsck /dev/rdsk/c0t3d0s0
( if the directory /a doesn't exist, create it, and
then mount the new root partition on it:
mount /dev/dsk/c0t3d0s0 /a
(9) verify the mount, cd into /a and run ufsrestore
(make sure in in /a!):
ufsrestore -rf /dev/rmt/<tape>;
(10) run installboot:
/usr/sbin/installboot /usr/lib/fs/ufs/bootblk /dev/rdsk/c0t3d0s0
(11) umount /a and reboot the system.
|
|