2009年5月28日木曜日

Vine Linux Install

システムをCopyしてみたが、起動しないのであきらめて再インストール
Vine4.2のインストールはなれたもの
hda1 /boot format
md0 / format
md1/home keep
問題なく起動、usr設定もちゃんと引き継がれた
Synapticでupdate

メール環境設定
Courier-IMAPをインストール
Postfixでは標準でMailbox形式なので、/etc/postfix/main.cfを編集
home_mailbox = Maildir/
/etc/rc.d/init.d/postfix restart
Thunderbirdをインストール

参考 Courier-IMAPのインストールと設定

fetchmailをインストール
~/.fetchmailrcは前のままのがCopyされているのでOK
自動起動の設定
$ crontab -e
0-59/1 * * * * /usr/bin/fetchmail > /dev/null 2>&1

参考 FetchMail象歩

うまくいきました。/home をそのままコピーしているのでFirefoxの設定等も引き継がれました。

2009年5月24日日曜日

Test Copied System

Copyができたら必要な修正をする。

Fetchmailでメールを取り込んでるので、片方だけに入らないように
/home/~/.fetchmailrcを修正する。
コメントを示す行頭の"#"を削除して、defaultsセクションに"keep"を追加。

defaults
proto pop3
no rewrite
keep
fetchall

Copyedシステムでは、物理ドライブのアサインが変わっているので、fstabを修正

Old systemをbootするときは、hdaからboot
Current systemをbootするときは、sdaからboot
ブートドライブと/bootパーティションの位置は変更ないので、grubの設定はそのまま
Current sda hda1 (hd0,0)
Old hda1 (hd0,0)
後で必要に応じ、menu.lstを編集

Copy Current System

まず、Copy先のパーティションをきれいに消します。
rootでnautilusを起動して慎重に。

現在のシステムを/oldにCopy
cp -ax / /mnt/old/
cp -ax /home /mnt/old/
cp -ax /boot /mnt/old/

-a, --archive
コピー先で、できる限り元のファイルの構成と属性を 保
持する (ディレクトリ構造体は保存しない)。 -dpR と同
じ。
-x, --one-file-system
コピーを始めたディレクトリと異なるファイルシステ ム
上 にあるサブディレクトリをコピーをしない。マウント
ポイントは同じファイルシステム上にあるのでコピー さ
れる。

念のためファイル構造をパーティションごとに確認。
umount /mnt/old/boot
umount /mnt/old/home
umount /mnt/old
fsck /dev/hda1
fsck /dev/md1
fsck /dev/md0
mount /mnt/old
mount /mnt/old/home
mount /mnt/old/boot

ちゃんとCopyされてるか確認します。
find / -path /proc -prune -o -path /mnt -prune -o -xtype f -exec cmp {} /mnt/old{} \;
かなり時間がかかります。ときどき、log fileやcache fileの違いが報告されます。

参考
Hard Disk Upgrade Mini How-To

grub

HDが3台あるので、どのHDからでも起動できるように、
全部のドライブのMBRにbrubをインストールする。

GNU GRUB manual
より抜粋

(hd0,1)
Here, hd means it is a hard disk drive. The first integer `0 indicates the drive number, that is, the first hard disk, while the second integer, `1 indicates the partition number (or the pc slice number in the BSD terminology). Once again, please note that the partition numbers are counted from zero, not from one. This expression means the second partition of the first hard disk drive. In this case, GRUB uses one partition of the disk, instead of the whole disk.

(hd0,4)
This specifies the first extended partition of the first hard disk drive. Note that the partition numbers for extended partitions are counted from `4', regardless of the actual number of primary partitions on your hard disk.
Note that GRUB does not distinguish IDE from SCSI - it simply counts the drive numbers from zero, regardless of their type. Normally, any IDE drive number is less than any SCSI drive number, although that is not true if you change the boot sequence by swapping IDE and SCSI drives in your BIOS.

BIOSの設定でどのドライブがhd0になるか決まる!


If you decide to install GRUB in the native environment, which is definitely desirable, you'll need to create a GRUB boot disk, and reboot your computer with it. Otherwise, see Installing GRUB using grub-install.


Once started, GRUB will show the command-line interface (see Command-line interface). First, set the GRUB's root device4 to the partition containing the boot directory, like this:


grub> root (hd0,0)
(stage1のファイルがあるパーティションを指定)

Once you've set the root device correctly, run the command setup (see setup):

grub> setup (hd0)  
(hd0ブートしたドライブのMBRにgrubをインストール)
grubのインストール

2009年5月23日土曜日

$ df -h

$ df -h
ファイルシステム サイズ 使用 残り 使用% マウント位置
/dev/md4 21G 3.8G 16G 20% /
/dev/md2 190M 26M 155M 15% /boot
none 251M 0 251M 0% /dev/shm
/dev/md5 125G 31G 88G 26% /home
/dev/sdb10 165G 11G 146G 7% /mnt/new
/dev/md0 9.4G 4.7G 4.3G 52% /mnt/old
/dev/md1 46G 44G 587M 99% /mnt/old/home
/dev/hda1 99M 7.2M 87M 8% /mnt/old/boot

$ cat /proc/mdstat

$ cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sdb1[1] sda1[0]
200704 blocks [2/2] [UU]

md3 : active raid1 sdb2[1] sda2[0]
2208832 blocks [2/2] [UU]

md4 : active raid1 sdb5[1] sda5[0]
21687616 blocks [2/2] [UU]

md5 : active raid1 sdb6[1] sda6[0]
132190720 blocks [2/2] [UU]

md1 : active raid1 sdb9[1] hda6[0]
48949952 blocks [2/2] [UU]

md0 : active raid1 sdb8[1] hda5[0]
10000320 blocks [2/2] [UU]

fdisk

Disk /dev/hda: 61.4 GB, 61492838400 bytes
255 heads, 63 sectors/track, 7476 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes

デバイス Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 137 996030 82 Linux swap / Solaris
/dev/hda3 138 7476 58950517+ 5 拡張領域
/dev/hda5 138 1382 10000431 fd Linux raid 自動検出
/dev/hda6 1383 7476 48950023+ fd Linux raid 自動検出

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes

デバイス Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 fd Linux raid 自動検出
/dev/sda2 26 300 2208937+ fd Linux raid 自動検出
/dev/sda3 301 19457 153878602+ 5 拡張領域
/dev/sda5 301 3000 21687718+ fd Linux raid 自動検出
/dev/sda6 3001 19457 132190821 fd Linux raid 自動検出

Disk /dev/sdb: 400.0 GB, 400088457216 bytes
255 heads, 63 sectors/track, 48641 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes

デバイス Boot Start End Blocks Id System
/dev/sdb1 * 1 25 200781 fd Linux raid 自動検出
/dev/sdb2 26 300 2208937+ fd Linux raid 自動検出
/dev/sdb3 301 48641 388299082+ 5 拡張領域
/dev/sdb5 301 3000 21687718+ fd Linux raid 自動検出
/dev/sdb6 3001 19457 132190821 fd Linux raid 自動検出
/dev/sdb7 19458 19470 104391 83 Linux
/dev/sdb8 19471 20715 10000431 fd Linux raid 自動検出
/dev/sdb9 20716 26809 48950023+ fd Linux raid 自動検出
/dev/sdb10 26810 48641 175365508+ 83 Linux

Ubuntu

VineからUbuntu
Thank you Vine