擁抱自由,使用 linux !

在Linux底下真是太幸福了,有好多東西可以玩。想從windows解脫就是現在!

May-13-10

把 Clonezilla-Live 裝在 M$ WindowsXP

posted by Thomas

這邊有一個說明是關於把Clonezilla-live安裝到Linux環境的硬碟裡,並調整grub增加一個開機選項。之前的post也有,但是太舊了。

最近因為課程需要,研究了在Windows下使用Grub4Dos去booting clonezilla-live 的作法。也就是所有的過程都是在M$完成,也許大家會有興趣…

作法概述:
1. 安裝 grub4dos,先下載grub4dos-0.4.4.zip,解壓縮之後把grldr放到C:\。

2. 用 grubutil 安裝 grub到MBR(如果想用windows的bootloader,這邊也有教學),下載 grubinst-1.1-bin-w32-2008-01-01.zip,解壓縮之後執行 grubinst_gui.exe。(我的選項:OnDisk hd0, Don’t search floppy)

3. 下載 Clonezillla-live UbuntuBased 版本,(我裝testing 1.2.5-15-i686.zip),解壓縮到C:\,把zip檔的內容統統放到裡面,跟之後的menu.lst要互相配合。

4. 設定menu.lst,在C:\ 增加一個檔案 menu.lst,內容如下


color black/cyan yellow/cyan
default 7

title clonezilla
root (hd0,0)
kernel /live/vmlinuz boot=live union=aufs noswap nolocales edd=on noprompt ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" vga=791 toram=filesystem.squashfs ip=frommedia nosplash
initrd /live/initrd.img
boot

title Windows XP Traditional Chinese
hide (hd0,1)
unhide (hd0,0)
rootnoverify (hd0,0)
makeactive
chainloader +1

title Reboot
reboot

title Halt
halt

完成:

此外,grub4dos 也支援boot iso file, like:

title clonezilla.iso
find --set-root /clonezilla.iso
map --heads=255 --sectors-per-track=63 /clonezilla.iso (hd32)
map --hook
root (hd32)
chainloader (hd32)
boot

我測試到可以看到syslinux選單(memtest可以跑),但是clonezilla-live開機有問題,原因還不確定。

reference for ‘grub4dos install’ :
http://semson.blogspot.com/2007/12/boot-manager-grub4dos.html
http://cha.homeip.net/blog/archives/2006/06/_grub4dos_linux.html

Oct-29-09

usplash theme clonezilla

posted by Thomas

最近簡單製作了 usplash for clonezilla,因為用vmware錄的不好…


usplash

基本作法可以參考 usplash 中的 example, 或是 ubuntu (usplash-theme-ubuntu) or debian (usplash-theme-debian)

大致上就是準備255色以內非透明的png檔,配合修改 theme.c 的檔案就可以完成!

完成後發現 9.10 又改用 xsplash…機機車車 不是很好搞XD 暫時先這樣 不弄了!

Oct-14-09

FreeBSD Backup

posted by Thomas

環境介紹:kFreeBSD(與FreeBSD幾乎一樣)
Hardisk:建立兩個slice, 各自再兩個label
da0
da0s1
da0s1a / ufs2
da0s1b swap
da0s2
da0s2d /home
da0s2e /usr

mapping 到 linux kernel
da0 –> sda
da0s1 –> sda1 <bsd: sda5 sda6> // 暫時想像成延伸分割區吧
da0s1a / ufs2 –> sda5
da0s1b swap –> sda6
da0s2 –> sda2 <bsd: sda7 sda8>
da0s2d /home –> sda7
da0s2e /usr –> sda8

先用 Clonezilla 開機,進入shell模式,手動下指令:
raw backup:
dd if=/dev/sda of=mbr.dd bs=512 count=1
dd if=/dev/sda1 of=slice1-table.dd bs=512 count=16
dd if=/dev/sda2 of=slice2-table.dd bs=512 count=16
partclone.ufs -d -c -s /dev/sda5 -o sda5.ptl.img
partclone.ufs -d -c -s /dev/sda7 -o sda7.ptl.img
partclone.ufs -d -c -s /dev/sda8 -o sda8.ptl.img

restore:
dd if=mbr.dd of=/dev/sda
dd if=slice1-table.dd of=/dev/sda1
dd if=slice2-table.dd of=/dev/sda2
partclone.ufs -d -r -s sda5.ptl.img  -o /dev/sda5
partclone.ufs -d -r -s sda7.ptl.img  -o /dev/sda7
partclone.ufs -d -r -s sda8.ptl.img  -o /dev/sda8

直接pipe資料到新的硬碟:
dd if=/dev/sda of=/dev/sdb bs=512 count=1
partprobe /dev/sdb
dd if=/dev/sda1 of=/dev/sdb1 bs=512 count=16
dd if=/dev/sda2 of=/dev/sdb2 bs=512 count=16
reboot
partclone.ufs -d -b -s /dev/sda5 -o /dev/sdb5
partclone.ufs -d -b -s /dev/sda7 -o /dev/sdb7
partclone.ufs -d -b -s /dev/sda8 -o /dev/sdb8
remove sda, update sdb to first hard disk
boot…

other notes:
* 可以考慮備份硬碟前 0-62 這區段的sector, 雖然不確定是做什麼的?
* BSD建立partition 一律在尾端保留約 2678 個 sector,是否要備份?

* 為什麼slice 是 sda1的前16個sector
http://fuse4bsd.creo.hu/localcgi/man-cgi.cgi?bsdlabel+8
The offset of the start of the partition from the beginning of
the drive in sectors, or * to have bsdlabel calculate the correct
offset to use (the end of the previous partition plus one, ignor-
ing partition `c’).  For partition `c’, * will be interpreted as
an offset of 0.  The first partition should start at offset 16,
because the first 16 sectors are reserved for metadata.

* mount ufs2
mount -r -t ufs -o ufstype=ufs2 /dev/sda5 /mnt

* 判斷UFS partition

debian:~# dmesg | grep hda
[    3.440093] hda: VMware Virtual IDE Hard Drive, ATA DISK drive
[    4.112099] hda: host max PIO4 wanted PIO255(auto-tune) selected PIO4
[    4.112207] hda: UDMA/33 mode selected
[    5.208450] hda: max request size: 128KiB
[    5.208654] hda: 16777216 sectors (8589 MB) w/32KiB Cache, CHS=17753/15/63
[    5.208858]  hda: hda1
[    5.229445]  hda1: <bsd: hda5 hda6 >

————— check hda —————

debian:~# disktype /dev/hda

— /dev/hda
Block device, size 8 GiB (8589934592 bytes)
DOS/MBR partition map
Partition 1: 8.000 GiB (8589579264 bytes, 16776522 sectors from 63, bootable)
Type 0xA5 (FreeBSD)
FreeBSD boot loader (i386 boot1 at sector 0)
BSD disklabel (at sector 1), 8 partitions
Partition a: 7.500 GiB (8052708352 bytes, 15727946 sectors from 1048639)
Type 7 (4.2BSD fast file system)
UFS2 file system, 64 KiB offset, little-endian
Last mounted at “/”
Partition b: 512 MiB (536870912 bytes, 1048576 sectors from 63)
Type 1 (swap)
Includes the disklabel and boot code
UFS2 file system, 64 KiB offset, little-endian
Last mounted at “/”
Partition c: 8.000 GiB (8589579264 bytes, 16776522 sectors from 63)
Type 0 (Unused)

————— check hda5 —————

debian:~# disktype /dev/hda5

— /dev/hda5
Block device, size 7.500 GiB (8052708352 bytes)
UFS2 file system, 64 KiB offset, little-endian
Last mounted at “/”

Aug-25-09

8月參加 OpenSourceWorld09

posted by Thomas

因為 Clonezilla 上了 .org zone,也就是會議單位提供場地給我們,根據往年經驗就是與一般參展廠商的基本booth差不多,因此我們的想像是一張桌子、兩張椅子、一個背面的面版、大約1.5坪的場地;當我們今年實際再造訪時有點傻眼,基本上有很大的變化,如 .org zone 變成圓桌+椅子,整個場地縮水1/3;此外好處是不用錢、有啤酒喝、可以參加會議,所以,其實還是相當不錯的。

這次集合3個主題:OpenSource、NGDC、CloudWorld等,各有些會議可以聽,我跑去聽了一些OpenSource的會議,例如AoE的、資料庫的,真的不多,因為我都想睡覺,不知道為啥精神不好。

在展覽區,因為同事對DMTF頗感興趣,有過去閒聊拿了些資料,SunCloud一直也有不少人潮,Ubuntu、FreeBSD也不少人過去聊天,另外有拿到一張叫我辦信用卡的,Linux or FreeBSD 的信用卡,還挺有趣的。

整個過程其實還不錯,但是沒有LSM來的有料,但是LSM比較可惜的是太多會議室用法文;而這邊用英文卻沒有什麼料…

Aug-25-09

7月參加 LSM2009

posted by Thomas

LSM (Libre Software Meeting 法國自由軟體年會)為一在歐洲具有相當重要性的國際型自由軟體會議。每年在法國境內舉辦,其與會人員或參與組織以來自歐洲居多,也不乏許多來自美洲與亞洲人士。其會議涵蓋議題許多軟體開發、教育應用…等。
此行中心同仁將參與 OFSET 攤位展示中心自由軟體相關開發並於 『Education』演講一主題、與一場討論會,並於會後參加相關會議。主要行程如下:
1.與會並聽取會議相關簡報
2.DRBL/Clonezilla 攤位展示
3.Boss 演講:The diskless GNU/Linux and MS Windows solution
4.Boss Workshop: DRBL
….

在那邊比較特別的是跟使用者互動的過程中認識了許多新的朋友,大家都滿開心的!雖然語言沒有很通,但是大家一點都不介意,努力的表達自己的想法,非英語陰雨世界的國家也是很好玩的!

有關 Partclone,與用者提到:
讓 Clonezilla 支援 FreeBSD,Partclone 需要支援 UFS2 檔案系統(回過一個月已經完成一半,只差測試!)
Partclone 支援 BTRFS、ZFS 檔案系統(老掉牙但就是弄不出來)

LSM 是個自由且有趣的會議,獲得許多豐富的成果!