coLinuxでのディスクイメージ容量拡張
coLinuxのサイトから入手できるDebian lennyイメージは2GBしかないので、8GBに拡張しました。
- coLinux 0.7.7.1
まずfsutilでイメージファイルを用意します。
> fsutil file createnew lenny.8gb 8589934592 File C:\Program Files\coLinux\lenny.8gb is created
debian-lenny.confにcobd3="lenny.8gb"を加えてcoLinuxを起動し、mkfsでファイルシステムを作成します
colinux:~# mkfs.ext3 /dev/cobd3 mke2fs 1.41.3 (12-Oct-2008) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 524288 inodes, 2097152 blocks 104857 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=2147483648 64 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 28 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. colinux:~#
ddでデバイスの中身をコピーし、resize2fsで拡張します。
colinux:/# dd if=/dev/cobd0 of=/dev/cobd3 4194304+0 records in 4194304+0 records out 2147483648 bytes (2.1 GB) copied, 340.82 s, 6.3 MB/s colinux:/# e2fsck -f /dev/cobd3 e2fsck 1.41.3 (12-Oct-2008) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/cobd3: 10751/262144 files (0.1% non-contiguous), 78918/524288 blocks colinux:/# resize2fs -p /dev/cobd3 resize2fs 1.41.3 (12-Oct-2008) Resizing the filesystem on /dev/cobd3 to 2097152 (4k) blocks. Begin pass 1 (max = 48) Extending the inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX The filesystem on /dev/cobd3 is now 2097152 blocks long. colinux:/#
cobd3をcobd0と入れ替えて完了です。