- スペースが無い?
容量が足りなくなってきたなぁという時のために slice を split する方法を考えてみます。この例では / 下に作成していた /export を別の disk へ split します。
- format
hardware としての disk は増設されているという前提です。
まずはパーティションを作成し slice を切ります。
super-user で format コマンドを実行し fdisk サブコマンドで以下のように Solaris の領域を確保します(他の OS の領域が存在しても構いません)。
Total disk size is 8188 cylinders Cylinder size is 2180 (512 byte) blocks
Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === 1 Active Solaris 1 8187 8187 100
|
format コマンドの partition, modify コマンドを使用して slice を作成します。以下は一例です。
Part Tag Flag Cylinders Size Blocks 0 root wm 1 - 8184 8.51GB (8184/0/0) 17841120 1 unassigned wu 0 0 (0/0/0) 0 2 backup wm 0 - 8184 8.51GB (8185/0/0) 17843300 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 0 0 (0/0/0) 0 6 unassigned wm 0 0 (0/0/0) 0 7 unassigned wm 0 0 (0/0/0) 0 8 boot wu 0 - 0 1.06MB (1/0/0) 2180 9 unassigned wm 0 0 (0/0/0) 0
|
label したあと format コマンドを終了します。
format> label Ready to label disk, continue? y
format> q #
|
- newfs
newfs コマンドを使用してファイルシステムを作成します。
# newfs /dev/dsk/c1t1d0s0 newfs: construct a new file system /dev/rdsk/c1t1d0s0: (y/n)? y
|
指定する論理デバイス名は format コマンドで調べることが出来ます。
# format Searching for disks...done
AVAILABLE DISK SELECTIONS: 0. c1t0d0 <DEFAULT cyl 524 alt 2 hd 255 sec 63> /pci@0,0/pci9004,7178@b/sd@0,0 1. c1t1d0 <DEFAULT cyl 8185 alt 2 hd 10 sec 218> /pci@0,0/pci9004,7178@b/sd@1,0 Specify disk (enter its number): ^D #
|
- slice のマウント
newfs した slice をマウントしてみます。
# mount /dev/dsk/c1t1d0s0 /mnt
|
- ファイルのコピー
マウントしたディレクトリに split するディレクトリ下のファイルをコピーします。コピーするディレクトリによっては他メディアの mini root から起動する必要があります。
# pwd /export # find . | cpio -pdum /mnt/ 186709 ブロック
|
コピーが終了したらアンマウントします。
- /etc/vfstab の編集
ブート時にマウントされるように /etc/vfstab を編集します。/export の場合、以下を追加します。
#device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # /dev/dsk/c1t1d0s0 /dev/rdsk/c1t1d0s0 /export ufs 1 yes -
|
- マウントポイントの作成
オリジナルのディレクトリをリネームしたあと、マウントポイントを作成します。
# mv /export /export_ # mkdir /export # chown root:sys /export #
|
一度手動でマウントしてみて問題無ければリブートします。
- リブート
リブート後、正しくマウントされている事を確認した後、オリジナルのディレクトリを削除して split の完了です。