coLinux日記

coLinuxはフリーソフトを種として、よろずのシステムとぞなれりける。

ファイルシステムサイズ増設2

2007-01-31 22:34:01 | インストールと設定
前回に続いて、サイズを大きくした新しいファイルシステム fs-home5G に /home の内容をコピーします。
まず、新しいファイルシステムを確認します。
# mount /dev/cobd3 /mnt
# df /home /mnt
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/cobd2             2064208   1911028     48324  98% /home
/dev/cobd3             5160576    141440   4756992   3% /mnt
# ls /mnt
lost+found
#

/home の内容をコピーします。ここでは、dump と restore を使います。
# cd /mnt
# dump -0u -f - /home |restore -rf -
  DUMP: Date of this level 0 dump: Wed Jan xx 22:18:38 2007
  DUMP: Dumping /dev/cobd2 (/home) to standard output
  DUMP: Label: none
  DUMP: Writing 10 Kilobyte records
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 1947516 blocks.
  DUMP: Volume 1 started with block 1 at: Wed Jan xx 22:18:39 2007
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
restore: ./lost+found: File exists
  DUMP: 80.85% done at 5248 kB/s, finished in 0:01
  DUMP: Volume 1 completed at: Wed Jan xx 22:24:41 2007
  DUMP: Volume 1 1945290 blocks (1899.70MB)
  DUMP: Volume 1 took 0:06:02
  DUMP: Volume 1 transfer rate: 5373 kB/s
  DUMP: 1945290 blocks (1899.70MB)
  DUMP: finished in 362 seconds, throughput 5373 kBytes/sec
  DUMP: Date of this level 0 dump: Wed Jan xx 22:18:38 2007
  DUMP: Date this dump completed:  Wed Jan xx 22:24:41 2007
  DUMP: Average transfer rate: 5373 kB/s
  DUMP: DUMP IS DONE
#

# ls /home
data  espiya  intel  local  lost+found  mysql  named  sser01  www
# ls /mnt
data    intel  lost+found  named            sser01
espiya  local  mysql       restoresymtable  www
# df /home /mnt
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/cobd2             2064208   1911028     48324  98% /home
/dev/cobd3             5160576   2051600   2846832  42% /mnt
#

およそ 6 分かかりました。うまくコピーできました。fsck もしてみます。
# cd /
# sync;sync
# umount /mnt
# fsck /dev/cobd3
fsck 1.38 (30-Jun-2005)
e2fsck 1.38 (30-Jun-2005)
/dev/cobd3: clean, 54369/655360 files, 533476/1310720 blocks
#

シャットダウンして、fedora5.bat を以下のように修正して完了です。
colinux-daemon.exe kernel=vmlinux initrd=initrd.gz mem=128 
   cobd0=Fedora5-2gb.ext3 cobd1=swap.img  cobd2=fs-home5G 
   cofs0=C:\Temp 
   eth0=pcap-bridge,"ローカル エリア接続" 
   root=/dev/cobd0 fastboot nogui
(1 行です。)

fedora5.bat をダブルクリックして df コマンドを実行してみます。
$ df /home
Filesystem           1K-ブロック    使用   使用可 使用% マウント位置
/dev/cobd2             5160576   2051632   2846800  42% /home
$

これで当分大丈夫です。dump と restore で、サイズが異なっても、ext2 から
ext3 へのコピーもできることが分かりました。
コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする