さくらのクラウドのコントロールパネルでディスクを追加・接続した後に ディスクをマウントして使えるようにします
ディスクのパーティションを確認
# /sbin/fdisk -l Disk /dev/hda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 13 104391 83 Linux /dev/hda2 14 2355 18812115 83 Linux /dev/hda3 2356 2610 2048287+ 82 Linux swap / Solaris Disk /dev/hdb: 107.3 GB, 107374182400 bytes 255 heads, 63 sectors/track, 13054 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hdb1 1 13054 104856223+ 83 Linuxディスク/dev/hdb1が追加された事がわかる
ディスクのパーティションを設定
# /sbin/fdisk /dev/hdb1 Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. The number of cylinders for this disk is set to 13053. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): p Disk /dev/hdb1: 107.3 GB, 107372772864 bytes 255 heads, 63 sectors/track, 13053 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-13053, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-13053, default 13053): Using default value 13053 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 22: Invalid argument. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks.
ext3 形式でファイルシステムを構築
# /sbin/mkfs -t ext3 /dev/hdb1 mke2fs 1.39 (29-May-2006) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 13107200 inodes, 26214055 blocks 1310702 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 800 block groups 32768 blocks per group, 32768 fragments per group 16384 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 23 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
マウントポイントの作成とマウント
# mkdir /hdb1 # mount /dev/hdb1 /hdb1 # df -h Filesystem Size Used Avail Use% Mounted on /dev/hda2 18G 1.5G 16G 9% / /dev/hda1 99M 17M 77M 18% /boot tmpfs 1.8G 0 1.8G 0% /dev/shm /dev/hdb1 99G 188M 94G 1% /hdb1これで、追加したディスクが/hdb1で使えるようになりました
起動時に自動マウントするようにしておく
# emacs /etc/fstab /dev/hdb1 /hdb1 ext3 defaults 1 2