難以預先安裝 Linux 在套裝電腦上嗎?

電腦舖賣機時,卻因顧客不買 Windows 而不提供操作系統(OS),令顧客買一台「不能用」的電腦回家,我認為這是一件笑話。既然客戶不買 Windows 使用執照,為何不預先安裝免費的 Linux 系統呢?真的難以預先安裝 Linux 在套裝電腦上嗎?

Linux 提供更多應用軟件

現時大多數顧客買的 Windows 電腦,都是幾百港元的廉價 Windows OEM 使用執照。根據 Buying OEM versions of Windows Vista: the facts 一文,OEM 版本只提供免費網上更新,並沒有其他 Windows 售後服務,還要另購 Office 辦公室軟件。

免費的 Linux 操作系統同樣提供免費網上更新,亦不提供售後服務(商業 Linux 公司透過提供服務來牟利),但顧客不需另購辦公室軟件,因為 Linux 系統也提供免費辦公室軟件。

沒有免費午餐

除了硬件價值外,顧客亦須明白軟件價值,付出金錢購買 Windows/Linux 軟件售後服務,或學習基本 Linux 操作。

早前一群用戶在戴爾電腦網站回應,要求戴爾電腦預先安裝 Linux 系統,現在美國戴爾電腦發放一個網上調查,查詢用戶所希望預先安裝 Linux 的分發版本、戴爾電腦系列、應用軟件種類等。

除了戴爾電腦主動支持 Linux 外,各 Linux 廠商也要主動測試不同電腦產品,提供多種需付費的售後服務,那麼 Linux 才可再進一步擴大桌面系統市場。

Recover my lost partition table

My friend told me last morning that, a Trixbox CD ISO, which I helped to add a HTML with some graphics files, couldn’t be identified itself as a Centos CD by its installer.

I tested the CD booting again after I added a missing file. But unfortunally it is failure to load my GRUB on reboot after the testing. I felt it was possible that my partition table was lost. Oh my god!

I booted it with Ubuntu LiveCD to try to recover my partition table. I found a useful software called gpart from mini-HOWTO with a help of google, and downloaded it from Ubuntu universe responsity.

Edit /etc/apt/sources.list file and add the 「universe」 at the following line.
deb http://tw.archive.ubuntu.com/ubuntu/ edgy main restricted universe

Then, I get the gpart package with apt-get after updating of package index file from sources, and next, I execute gpart to check my hda.

$ apt-get update
$ apt-get install gpart
$ gpart /dev/hda
Begin scan…
Possible partition(DOS FAT), size(19994mb), offset(0mb)
Possible partition(DOS FAT), size(19994mb), offset(19994mb)
Possible partition(Linux ext2), size(9993mb), offset(59984mb)
Possible partition(Linux swap), size(486mb), offset(69978mb)
Possible partition(Linux ext2), size(8063mb), offset(70464mb)

* Warning: short read near sector(160836291), 64512 bytes instead of 66048. Skipping…
End scan.

Checking partitions…

* Warning: more than 4 primary partitions: 5.
Partition(DOS or Windows 95 with 32 bit FAT): primary
Partition(DOS or Windows 95 with 32 bit FAT): primary
Partition(Linux ext2 filesystem): primary
Partition(Linux swap or Solaris/x86): primary
Partition(Linux ext2 filesystem): invalid primary
Ok.

Guessed primary partition table:
Primary partition(1)
type: 011(0x0B)(DOS or Windows 95 with 32 bit FAT)
size: 19994mb #s(40949622) s(63-40949684)
chs: (0/1/1)-(1023/15/63)d (0/1/1)-(40624/10/63)r

Primary partition(2)
type: 011(0x0B)(DOS or Windows 95 with 32 bit FAT)
size: 19994mb #s(40949622) s(40949748-81899369)
chs: (1023/15/63)-(1023/15/63)d (40624/12/1)-(81249/5/63)r

Primary partition(3)
type: 131(0x83)(Linux ext2 filesystem)
size: 9993mb #s(20466744) s(122849118-143315861)
chs: (1023/15/63)-(1023/15/63)d (121874/2/1)-(142178/6/60)r

Primary partition(4)
type: 130(0x82)(Linux swap or Solaris/x86)
size: 486mb #s(995960) s(143315928-144311887)
chs: (1023/15/63)-(1023/15/63)d (142178/8/1)-(143166/8/56)r

gpart searched the hard disk and guess the possible range of each partitions as the above. In my memories, I got few logical partitions created in a extended partition, and partitions were not identified in correct order.

From the above gpart result, I still could not find out my /home partition, damn. I started to guess and calculate the possible range in sector no. of my /home.

My calculator and paper working

I found that a gap occurs between each partitions. My 1st Windows partition is ended at CHS 40624/10/63, but my 2nd Windows partition is started from 40624/12/1. Therefore I guessed the possible range of my /home is from 81249/7/1 to 121873/16/63, which should be from sector 81899433 to 122849053 according to my calculation.

To start a risky re-creation of my partition table with fdisk, I found I can create partition in term of sector range after I pressed 『u』 to change the display/entry units to sectors. And I mounted these partitions successfully after the re-creation.

$ fdisk /dev/hda -l -u
Disk /dev/hda: 82.3 GB, 82348277760 bytes
16 heads, 63 sectors/track, 159560 cylinders, total 160836480 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 63 40949684 20474811 b W95 FAT32
/dev/hda2 40949748 81899369 20474811 b W95 FAT32
/dev/hda3 81899433 122849053 20474810+ 83 Linux
/dev/hda4 122849054 160836479 18993713 5 Extended
/dev/hda5 122849118 143315861 10233372 83 Linux
/dev/hda6 143315928 144311887 497980 82 Linux swap / Solaris

But my GRUB still couldn’t be loaded because related files couldn’t be found. I tried to mount the / partition after boot-up of Ubuntu LiveCD, and then I re-create the full partition table again according to /etc/fstab, to use the original partition id.

Oh… GRUB is successfully be loaded. No re-installation of OS was required, and my files are found.

I heard that partition table of my friend’s PC is also deleted by original trixbox CD. I told him that we didn’t read a warning at the boot prompt screen of Trixbox. So careless we are. And we think that a warning message should be printed on the CD I produced.
Thanks to open sources!