2012-04-19

由古早味的英文字談起

在聲樂曲目裡,經常會碰到一些乍看之下令人望之生怯的陌生英文單字。其實仔細去品味的話,它們卻散發著一股古色古香的魅力。只要複習過一些簡單的規則,特別是動詞跟人稱代名詞,轉念間它們就都顯得親切得多。典型的例子是 King James 版聖經或莎士比亞的作品,它們經常被採用於像是神劇、經文歌等聲樂作品。以下就先簡潔羅列出部份最常見的中(middle)、古(old)英文單字與現代英文的對照規律,例子則多取自於神劇《以利亞》[a]

人稱代名詞
ye - you(第二人稱代名詞複數主格/受格)e.g. ye shall find me
thou - you(第二人稱代名詞單數主格)e.g. thou art my God
thy - your(第二人稱代名詞單數屬格)
thine - your(第二人稱代名詞單數屬格,用於母音或 h 之前)
thee - you(第二人稱代名詞單數受格跟語格) e.g. I will exalt thee
動詞
be'st - you are(be 動詞第二人稱單數現在簡單)(德:du bist)
art - you are(be 動詞第二人稱單數現在簡單) e.g. thou art angry
wast/wert - were(be 動詞第二人稱單數過去式)e.g. thou wast (德:du warst)
wilt - will(助動詞 will 的第二人稱單數現在簡單)e.g. wilt thou destroy us (德:du willst)
dost - you do(助動詞 do 的 第二人稱單數現在簡單)
doest - you do(一般動詞 do 的 第二人稱單數現在簡單)
doth - does(助動詞 do 的 第三人稱單數現在簡單)e.g. thou dost not ...
hast - have(助動詞 have 第二人稱單數現在簡單)e.g. thou hast tried me...
hath - has(助動詞 have 第三人稱單數現在簡單)e.g. the Lord hath made...
shalt - shall(助動詞 shall 第二人稱單數未來簡單)e.g. thou shalt (德:du wirst)
canst - (you) can(助動詞第二人稱單數現在簡單)e.g. thou canst not lie
shew - show

whence - from where(由哪裡,woher)e.g. whence camest thou? and whither wilt thou go?
wherefore - why(為何,warum)e.g. Wherefore art thou, Romeo?
whither - where hither(到哪裡,where to)(德:wohin)
thither - there hither(到那裡, there to)
unto - to, onto, upon
goest (you go)
runnest (you run)
makest (you make)
forgettest (you forget)
hearest (you hear)
seest (you see)
canst (you can)
mayest (you may)
couldst (you could)
shouldst (you should)
wouldst (you would)
maketh (he makes)
leadeth (he leads)
driveth (he drives)
mocketh (he mockes)
troubleth (he troubles)
liveth (he lives)
cometh (he comes)
cleaveth (it cleaves) (日耳曼字;與德語 kleben 同源)
spreadeth (he spreads)
rejoiceth (it rejoice)
draweth (he draws)
falleth (it falls)
breaketh (it breaks)
repenteth (he repents)
visiteth (he visits)
riseth (he rises)
talketh (he talks)
sleepeth (he sleeps)
derideth (he derides)
ariseth (it arises)
endureth (he endures)
quencheth (he quenches)
rusheth (he rushes)
comforteth (he comforts)
commandeth (he commands)
laveth (he laves/washes)(與法語 laver、義大利 lavare、英文 lavender 薰衣草同源)
由以上許多例子可以看得出來,字尾 -st/-est 為典型的第二人稱單數現在簡單,或過去式動詞語尾,而 -eth 則為第三人稱單數現在簡單的動詞語尾,相當於現在的 -s、-es。古早字尾變化之 -eth 或 -est ,都會使得該字多出一個音節。也就是,多出一個可以唱,或必須唱的音符。在古早的英文裡,有許多語尾變化跟德語很是接近(詳見 [5] 所整理出來的完整動詞及名詞變化表)。另一方面,我自己所較為熟悉的德語,當然也經歷過類似的演化。

在夏天,德國各地偶會舉辦中世紀市集(mittelalterischer Markt)。在市集裡,人們身著中世紀服飾,品嚐古早味食物,彈唱古早味音樂。在這種場合,一向重視學識、涵養的德國普羅大眾,當然也喜歡賣弄一下古早味的口音。我自己就碰到過,那應該是在春天吧,在 Paderborn 主教教堂(Dom)後面的廣場上。很慶幸自己的聽覺系統及語言中樞及時發生了反應,並未掃了人家的興。這個中世紀市集就位在以下照片教堂鐘樓附近及其後方的廣場上。


但是古時候的口音並非那麼容易還原。這時,先不管它對或不對,常見的技巧,就是在動詞第三人稱單數,或是完成式語尾的 -t 之前多加一個音節,成為 -et,極為類似本文以上所列,把當代英美語字尾的 -s 變為 -eth。

市集裡人們賣弄的另一個常見技巧,是把 Sie(您)改為 Ihr(主格)或是 Euch(受格)。還是覺得無趣的話,就再夾帶幾個拉丁字或法語,使它更是趣味橫生。要是沒學過的話,沒有關係,也不管它是什麼格位,更無須管它對還不對,只要在名詞,特別是人名的字尾,給它加上一個 -us 的音節就是了。例如,把 August 講成 Augustus、Stefan 講成 Stefanus 等。這些改變都會蘊釀出一種「古早味」。這是一種在時間軸上的位移。要是想在空間上作一點位移,其實也不難。另一個字尾 -o,會帶我們往南越過阿爾卑斯山到義大利半島,Stefanus 就成為 Stefano!

在英語上,想玩這種遊戲的話,前面已大致介紹過了,只要把 you 的主格改為 thou、受格改為 thee,屬格則用 thy 或 thine,聽起來就古色古香了。講究一點的話,把 comes 講為 cometh,把 you have 講成 thou hast 就更是加分。把它當作語言遊戲來玩的話,神劇唱起來,或許更為盡興!

事實上,許多早年就流落他鄉的日耳曼裔家族(Aussiedler),由於在他鄉,例如俄羅斯,未能親歷母語的演進,代代相傳而保留下來一些很是古早味的語音跟語法。當子孫有遭一日重返現代聯邦德國的 Vaterland(祖國),當同儕品嘗到這些封裝已久、原汁原味的古早味罐頭語言,這便蔚為茶餘飯後的佳話。他們很是能夠享受這種樂趣!由 [6] 這篇德國人的文章,可以略窺端倪,他們既是希望、也懂得如何在這個範疇裡自得其樂。

值得注意的是,作為一個外國人(Ausländer),你在台灣學德語時,所使用的要是紙張已經變黃的德語教材,再帶到德國去實用的話,也會成為一種另類的 Aussiedler!其工作原理都是一樣的。例如,我習慣於很嚴謹地使用所有可能的虛擬式動詞(Konjunktiv),但是當代的德國人在口語上並不太會這麼做,甚至於在正式的書寫時也不例外。只不過,我的這種語言習慣所帶給當地人的印象,大抵上不會是負面的。他們既然在中古世紀市集上玩得起來,就也很能夠「享用」這種出自外國人口中的古早味語言。關於這種現象,我們也可以這麼想像,當聽到一個德國人,由他嘴裡用台語「唸」出「恁娘」或是「卵葩」時,其中詼諧的成份也多會主導其所觸發的整體語言心理現象。德國人嘴裡的「恁娘」、「恁祖媽」,我就親耳聽見過,真是可愛極了!

然而,在台灣,在公元 2012 年的今天,卻有一些古早味的台語詞彙慘遭「禁用」的命運。這到底是怎麼回事呢?請看我的另一篇短文〈大聲叫出卵葩的名〉

Related Articles

[a] 2012-03-15 神劇 Elias/Elijah/以利亞 德英對照
     http://kolmogolovi.blogspot.com/2012/03/elijahelias.html

[b] 2012-04-10 大聲叫出卵葩的名
     http://kolmogolovi.blogspot.com/2012/04/blog-post.html

External Links

[1] User:@pple/List of archaic English words and their modern equivalents -
     Wikipedia, the free encyclopedia
     http://en.wikipedia.org/wiki/User:@pple/List_of_archaic_English_words_
and_their_modern_equivalents

This is a list of archaic English words and their modern equivalents. These words and spellings are now considered archaic or obsolete within the current status of the English language. Given both the rapidity of change in modern English and the number of versions used by nations and cultures, it should be borne in mind that dates are approximate and that the information here may not apply to all versions of English.

The evolution of the English language is characterized by three phases. The first period dates from approximately 450 (the settlement of the Angles, Saxons and Jutes in England) to 1066 AD (the Norman Conquest). At this time the language made use of almost full inflexion, and is called Anglo-Saxon, or more exactly Old English. The second period dates from the Norman Conquest to probably c.1400 (though some books differ on when this period ends) and is called Middle English. During this time the majority of the inflections disappeared, and many Norman/Norseman and French words joined the language because of the profound influence of the Anglo-Norman ruling class. The third period dates from about 1400 to today (2007), and is known as Modern English, though until recently it was called New English. During the Modern English period, thousands of words have been derived by scholars from the Classical languages.

The impact of dictionaries in the definition of obsolescent or archaic forms has caused the standardization of spelling, hence many variant forms have fallen into disuse.

It should be noted that often poets and writers of prose with a very strong feel for the language may on occasion deliberately choose to use archaisms to emphasize a certain point or to create a mood.
[2] Thou - Wikipedia, the free encyclopedia
     http://en.wikipedia.org/wiki/Thou

[3] Introducing Archaic English - UniLang Wiki
     http://www.unilang.org/wiki/index.php/Introducing_Archaic_English

[4] Roger K. Terry, Having Problems with Prayer Langhuage?
2326-2391-1-PB.txt.pdf
     https://ojs.lib.byu.edu/spc/index.php/RelEd/article/download/2326/2163

[5] Old English grammar - Wikipedia, the free encyclopedia (含完整動詞變化表)
     http://en.wikipedia.org/wiki/Old_English_grammar

[6] Mittelalterliche Ausdrucksweise (Crashkurs), Delbrücker-Tross e.V.
     http://www.mittelalter-tross.de/mittelalter-sprache.html

2012-04-10

大聲叫出卵葩的名

生殖器官是孕育任何人類文明的先決條件,所以在任何語言當中,必然形成指涉生殖器官各部分的概念,也自然會由此衍生出一些愛恨情仇、或嬉笑、或怒罵之相關詞彙。所有的外來獨裁政權都會嘗試從語言下手。我們卻無法想像任何一個成熟的民主社會,會去禁用指涉生殖器官的詞彙,也無法想像一個成熟的民主社會的公民,會在這個語詞的使用上自我設限,但是現在的台灣居然是一個活生生的例子。這會是一種什麼樣的社會呢?

台灣的 NCC 真的敢對台語「卵葩」一詞的使用開罰嗎?我看未必(見 [5][6][7][8])。大眾傳播媒體上對這一詞的消音或類似作法,我們只好把它視為是一種自我設限的行為。所以這最終也只能歸咎於,台語使用者的自我設限。

在 2012 年的台灣,在台語裏邊,使用「卵葩」一詞來指涉男性的生殖器,卻成為一個「政治不正確」的行為,在一種詭異的氣氛之下,他們普遍使用「LP」來替代。為什麼使用拉丁字母「LP」?顯然在通用的台語裡缺乏其他的替代語彙。換句話說,在現行的台語裡,我們無法正常地在言語上運用這些概念。這到底是一種什麼社會學現象?又是一種什麼樣的語言學現象?這具有什麼樣的政治意含?這些問題都是當代社會所亟須探討的。

有必要講得更清楚一點嗎?在台語裏,「陰莖」怎麼講?「陰囊」、「睪丸」又是怎麼講?無論是 penisscrotumtesticles,更不用說是 vaginaclitoris…,台語難道連一個不被視為「髒話」的對應解剖學名詞都不能擁有嗎?不必懷疑這些名詞在語言裡的嚴肅性。我還清楚地記得一個場景,那就是在德國時,一名女性主義者嚴肅地跟我談起,她對非洲一些割除女性陰蒂習俗的態度。在台灣,在這個顯性地矮化特定語言的實例上,那些堅持本土文化價值的在野黨又曾做過些什麼?

但就在這同時,卻「好棒」、「好屌」猖獗。你可以意識到嗎?如果我把「好棒」寫成拉丁學名,那應該就是 "penis erectus",換句話說,就是「海綿體充血狀態下的 penis」。其他的我就不去窮舉,有能力考證的專家多得是。李敖也常常在電視上使用「卵葩」一詞,只不過是以普通話發音,也未見消音。大師啊,您不是常以正義自許嗎?就為這個 de facto 弱勢的多數族群講幾句話吧。網路上隨便一翻,也都可以知道「卵葩」並不必然是「髒話」,但卻是解剖學用途的適當選擇,也是我小時候在喜慶場合,所親耳聽到出自我三姑口中祝賀用語裡的名詞。這些還甚至於是很值得玩味的古早味台語辭彙(見 〈由古早味的英文字談起〉 [e])。「髒話」這個概念的確定,非常依賴 pragmatics 層面的探討,不可能單由符號本身來認定。關於這些用語的資料太多了,輪不到我來考證,也不是這篇文章的重點。

重點卻是,這件事情的嚴重性遠高於我們所能想像。重點也是,這些詞彙居然可以在台語裡缺席,造就了一個另類的「台灣之光」,因為地球上居然會有一個語言沒有「髒話」,多麼「尊貴」的語言哪!重點是,大家還是講不出口!

讓我再重彈一次老調,不要怪馬英九、不要怪國民黨,也不要怪其他不使用台語的族群,因為在一個自由經濟裡,每一個族群傾向於各自維護、鞏固其既得利益及其所堅持的「法統」,自屬天經地義。更何況這個講台語「卵葩」的族群,在人數上,根本是個多數族群,尤其是在 2012 的今天,這個多數族群只要願意正常地使用他們的語言裡唯一指涉生殖器的名詞,任何類似「不雅」、「髒話」…等「指教」,根本就找不到立足點。

這也讓我不得不再一次提出對在野黨的譴責。這麼多年來,你們都是在想些什麼、在幹些什麼?有沒有個一貫堅持的價值與理想?想不想為台灣本土社會「札根」?可是話說回來,這麼講又有一點點違背我自己的理念,因為在野黨的行逕也在在受到其選民的制約。有什麼選民,就有什麼在野黨,有什麼選民,就有什麼執政黨 [a][b][c][d],這可是我自己說的。然而,尤其是政治轉型期間的在野黨,不是也身負思想上及文化上提醒、整合、領導選民的責任嗎?

想到族群歧視問題,不由得急著找出以前在捷運車廂裡錄到的一段廣播詞:
2006-11-27 17:07 TPE MRT/台北捷運廣播 mrt20061127_MZ-B100.mp3

(國語)為了維護服務品質,請勿在捷運系統內吸菸、
            飲食、嚼食口香糖或檳榔。
            謝謝您的支持與配合。
(台語)為著維護服務品質,禁止在捷運系統喫菸、
            吃東西、喝東西、哺樹奶糖、哺檳榔。
            感謝你的支持佮配合。
(客語)(請讀者幫忙聽寫。)
(英語)Please do not smoke, eat, or chew gum in the system.
各位注意過這件事嗎?現在台語版本已經改為「請」了。想當年,每次跟我媽一起搭乘捷運,一碰到這一段廣播詞,我都會假裝我媽重聽,用旁邊的乘客也聽得到的音量,跟我媽媽提醒、討論這種「種族歧視」的現象。我也會以同樣的音量,與她討論捷運系統裡「疑似禁止喝水」的不人道規定 [d]。其實我在某篇文章裡([d]),也已稍微提起過這件事情。水,無臭無味,跟空氣、陽光同樣重要,是一種維持生理機能的必需品,因為無臭無味,所以不會干擾到其他乘客,因為是維持生命的必需品,所以不可以禁止。偶爾看到外國乘客拿起水瓶來喝水,我也不忍提醒,就等著讓他們見識一下台灣這個「文明」(civilisation/civilization)。我想,到現在應該也已經對台灣社會有充分的了解,足以做出這個預言:要等到有乘客在這個可以長達一個多小時的捷運車程裡,因為喝水及相關問題而送醫,甚至於不治,這個喝水的議題才會被全國炒熱,甚至於過度反應,一如往常。

相對於喝水,反倒是「音樂」才會干擾到乘客或遊客。在台灣的一些露天觀光景點,我倒是常常被迫聽到高音量的「音樂」。台灣的民眾對於垃圾車所發出「音樂」的感受及其反應,也是台灣社會文明進程的一個重要指標。順便就讓我們也來看看澳門這個被葡萄牙人治理過的地方,對聲音的態度。以下這張圖片是澳門市區中一個很小的馬路公園:


再寫下去就離題太遠了,也會「歸卵葩火」。就唱首歌消消氣吧!
LP 的名叫卵葩(改自王文德/蔡振南的〈母親的名叫台灣〉)

LP 是生 LP 是死 LP 是命 LP 的名叫卵葩
LP 是擔當 LP 是勇氣 LP 是你咱的春天
二千萬粒的蕃薯子 甭敢叫出LP的名
卵葩敢是彼難聽 想到心寒起畏寒

LP 是生 LP 是死 LP 是命 LP 的名叫卵葩
LP 是擔當 LP 是勇氣 LP 是你咱的春天
二千萬粒的蕃薯子 未凍叫出 LP 的名
親像啞狗仔壓死子 讓人心凝捶心肝

二千萬粒的蕃薯仔子 甭通惦惦不出聲
勇敢叫出 LP 的名 卵葩啊
卵葩啊 你是 LP 的名
以下的簡譜,在旋律上,除了「LP」、「卵葩」,因受語韻制約必須稍做調整之外,都盡可能忠於蔡振南唱的原版〈母親ㄟ名叫台灣〉[9],亦參見 [10][11]


File Downloads

[i] mrt20061127_MZ-B100.mp3, 2006-11-27 17:07 TPE MRT/台北捷運廣播 (1680 KB, 69 seconds)

[ii] 〈LP 的名叫卵葩〉簡譜 (g7a44042.jpg.homo.resize.jpg, 1024x1824, 318KB)

Related Articles

[a] 2011-06-05 義美食品不含三聚氰胺,不含瘦肉精,不含塑化劑
     http://kolmogolovi.blogspot.com/2011/06/blog-post.html

[b] 2011-07-18 中國國民黨的苗栗縣長劉政鴻!
     http://kolmogolovi.blogspot.com/2011/07/blog-post.html

[c] 2012-02-15 正義?
     http://kolmogolovi.blogspot.com/2012/02/blog-post_15.html

[d] 2012-03-29 「文林苑都更案」強制拆遷有感
     http://kolmogolovi.blogspot.com/2012/03/blog-post_29.html

[e] 2012-04-19 由古早味的英文字談起
     http://kolmogolovi.blogspot.com/2012/04/blog-post_19.html

External Links

[1] 台灣的語言文字_綠翠園www.xmart.tw/formosa/_文化分區
      http://www.xmart.tw/FORMOSA/reply.php?TopicID=2558&p=1

[2] 卵脬 - 基百科,自由的百科全書
       http://zh.wikipedia.org/wiki/%E5%8D%B5%E8%84%AC

[3] 排灣族傳統 關心就摸阿力力, 中央社記者盧太城台東縣 2012-02-13
     http://www2.cna.com.tw/News/FirstNews/201202130046.aspx

[4] Neuro-linguistic programming-Wikipedia
     http://en.wikipedia.org/wiki/Neuro-linguistic_programming
Neuro-linguistic programming (NLP) is an approach to communication, personal development, and psychotherapy created in the 1970s. The title refers to a stated connection between the neurological processes ("neuro"), language ("linguistic") and behavioral patterns that have been learned through experience ("programming") and can be organized to achieve specific goals in life. According to certain neuroscientists, psychologists and linguists, NLP is unsupported by current scientific evidence, and uses incorrect and misleading terms and concepts.
[5] 生命之歌首演介紹, 鄭智仁, uploaded 2008-08-18
     http://www.youtube.com/watch?v=RgGLXeN4wnk


[6] 卵葩LP禮讚 - 生命之歌 Taiwanese Testicles (Lan Pha) Praise Song, uploaded 2008-11-25
     http://www.youtube.com/watch?v=GUUm_9_3avc

[7] Lan Pha 福氣之所在,鄭智仁 2008 最新發表曲!, uploaded 2009-01-30
     http://www.youtube.com/watch?v=rHovELcvvhk

[8] 生命之歌 詞曲:鄭智仁 醫師, uploaded 2009-12-02
     http://www.youtube.com/watch?v=Qn2MCEmFZeQ

[9] 母親ㄟ名叫台灣 / 蔡振南, uploaded 2007-08-11
http://www.youtube.com/watch?v=7jmN6oqEro0

[10] 蘇稚蘋, 陳明章與蔡振南台語歌曲創作中之台灣意識手法比較(Comparison of the songwriting styles of Chen Ming-Chang and Tsai Chen-Nan: Influences of Taiwanese Grass-Root Movements), p. 413, 遠東學報第 27 卷第 4 期, 2010-12
     http://www.feu.edu.tw/adms/aao/aao95/jfeu/27/2704/270418.pdf
(附帶建議一下此文作者,引文除了註腳,不妨也將之縮排、加上引號或改變字體,以利讀者辨識。)

[11] 呂國禎,《論台語歌曲反殖民的精神》, p.61-62, 私立靜宜大學中國學系碩士論文, 2005-07
     http://ethesys.lib.pu.edu.tw/ETD-db/ETD-search-c/view_etd?URN=etd-0726105-101203
「…在 1997 年,由綠色和平電台的聽眾王文德,在蔡振南所主持的節目現場中,所 call in 唱出的〈母親的名叫台灣〉經由蔡振南改編後收錄在蔡振南〈生命的太陽〉專輯中,由飛碟唱片公司發行,這首歌應是商業市場完全接納台語社會運動歌曲的代表作,台語歌曲終於回歸到最原始反應社會的功能上,而且完全擺脫政治的禁錮,能暢所欲言。而聽眾也逐漸能在政治活動以外的場合接受這種歌詠台灣之聲,加強台灣意識的歌曲題材。…」

2012-04-02

在 Linux 讀取 GPT 與 hfsplus 檔案系統

你的 Linux Kernel 不認識新規的 partition table(EFI GPT)?

有一些 USB 外接硬碟或隨身碟接到 Linux 上,會出現不尋常的訊息。以 fdisk(8) 檢視,則有類似以下的輸出:
# fdisk -l /dev/sda

Disk /dev/sda: 40.0 GB, 40007761408 bytes
255 heads, 63 sectors/track, 4863 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks       Id  System
/dev/sda1               1        4864    39070079+   ee  EFI GPT
這表示,在這個 disk 上的,是一種新型的 partiton table,它叫做 GPT(Globally unique identifier Partition Table),也是 EFI(Extensible Firmware Interface)的一部份。這也是在告訴我們,
fdisk(8) 已經不適用於這種儲存媒體,它所印出的 partition 編號及數量,也是錯的。
fdisk(8) 之所以尚可印出這一行,是因為這個新的標準制定時,考慮到了代溝的問題,而留下了「一絲相容性」,讓大家辨認得出來,這是個新規的 partition table。同樣地,cfdisk(8)、sfdisk(8)、...等也都不適用,因為這些都只認得大家現在(2012)還很常用的舊型 MBR partition table。

Linux kernels 基本上支援這種新型的 partition table。為了確定這個 feature 是否有 compiled 進去你所正在使用的 kernel,可以執行:
$ grep CONFIG_EFI_PARTITION /boot/config-`uname -r`
如果結果是:
CONFIG_EFI_PARTITION=y
就表示這個 kernel 認得這種新型的 partition table。

看不到 partitions 怎麼 mount?這裡有個 fdisk -l 的臨時替代程式

但是接下來該怎麼辦?要是不知道這個 disk 裡面到底有幾個,以及那一種檔案系統的 partitions 就不能夠 mount 它們啊…(除非你正在使用很完善的桌面跟很新的 automounter)。而我自己既不使用這類桌面,且所使用的系統又是個老舊的 Debian/Etch!上面找不到甚麼可以隨裝即用的程式,例如 gdisk,而 parted(8) 用起來又問題重重。這時,Udev 系統所附帶的小程式
/lib/udev/vol_id
就可以派上用場!這是所有 2.6 起的 Linux kernels 都有的 feature。以下這個小小的 shell-script 就利用 vol_id 來 probe 所有它認得的 partitions。注意,這個 script 會一直試下去,直到碰到了一個它所不認識的,才會停止。把以下的程式碼存成一個檔案叫做 ptprobe(或自己隨便取個名字),放在路徑(PATH)上,再做 chmod 755 ptprobe 就可以用了。
#!/bin/sh
VOL_ID=/lib/udev/vol_id
DEV=$1
if [ -z "$DEV" ]
then
        echo "usage: $0 "
        exit 1
fi

I=1
while true
do
        if ID=`sudo $VOL_ID -t $DEV$I 2> /dev/null`
        then
                echo "$DEV$I: $ID"
                I=`expr $I + 1`
        else
              break
        fi
done
exit 0
我檢查 /dev/sda,執行的結果如下:
$ ptprobe /dev/sda
/dev/sda1: vfat
/dev/sda2: hfsplus
如何 mount 一個 hfsplus 檔案系統?

所以,mount 第一個 partition 不是問題。但是第二個呢?這個硬碟可能來自一個 Mac OS X 的使用者(HFS Plus 檔案系統也使用於 iPod)。所以,先試試看:
# mkdir /mnt/sda2_hfsplus/
# mount -t hfsplus /dev/sda2 /mnt/sda2_hfsplus/
這時,你的系統會尋找所需的模組(kernel module)並自動載入。它典型的名稱為 hfsplus。你也可以用以下指令找找看它到底是放在哪裡:
$ modprobe -l | grep hfsplus
/lib/modules/2.6.27.62/kernel/fs/hfsplus/hfsplus.ko
萬一 Udev 系統出了差錯,並未自動載入這個 module 的話,不妨試試看手動載入:
# modprobe hfsplus
要是你的系統毫無反應,或是給了錯誤訊息:
FATAL: Module hfsplus not found.
那麼很可能你所正在使用的 kernel 並未把 hfsplus 這個檔案系統 compiled 進去。可以再次用以下指令確定一下:
$ grep CONFIG_HFSPLUS_FS /boot/config-`uname -r`
如果其輸出真的是:
# CONFIG_HFSPLUS_FS is not set
那麼,就必須 menuconfig 一下這個 kernel,把這個 feature 設為 M 或是乾脆 Y 之後,再重新編譯。如果 module 已經載入或是 compile 在 Kernel 裡(lsmod 看不到),那麼
$ cat /proc/filesystems
應該可以看到 "hfsplus"。/proc/filesystems 所列出的是系統此刻所支援的所有檔案系統類型。

要是一切都很順利的話,你可能會希望可以寫入這個硬碟,因為預設值為 read only。這時,可用 "force,rw" 這個選項:
# mount -t hfsplus -o force,rw /dev/sda2 ....
要是硬碟裡有 Big5 的漢字,你可能會需要加入 "nls=cp950" 這個選項(使用 "charset=cp950",它會抱怨語法錯誤 )。也就是:
# mount -t hfsplus -o force,rw,nls=cp950 /dev/sda2 ......
如果發現硬碟裡有一些檔案是因沒有權限,而不能讀取的,它們的 uid 很可能是 501, 502, ... 這時,也可以試試:
# mount -t hfsplus -o force,rw,nls=cp950,uid=501,gid=100 /dev/sda2 .....
要是想要放進 /etc/fstab 裡一勞永逸,可以考慮採用以下範例:
/dev/sda2 /sda2_hfsplus hfsplus force,rw,nls=cp950,users,uid=501,gid=100 0 0
請注意:我自己還不清楚強制讀寫模式 (force,rw) 會導致那些不良後果。所以,請小心並自行負責。也請注意,hfsplus 這種檔案系統 mount 到 Linux 上之後,symbolic links 是可以用的。另外必須注意的是,目前必須避免在 Linux 上使用 hfsplus 的 jounaling [4]

我自己有一個自動的 mounting system,掛勾在 udev 系統上,不但可以自行 mount 一個 hfsplus 檔案系統,還可以讓它發出自己喜歡的響聲(參見〈Linux 的 udev 是個有趣又有用的玩具 (5en) : Smallest Working Bourne-Shell Automounter〉[e])。如何撰寫這種程式,請參考我的相關系列文章〈Linux 的 udev 是個有趣又有用的玩具〉 [a] [b] [c] [d] [e]

如何檢查或初始化新的 hfsplus 檔案系統?fsck.hfsplus 跟 mkfs.hfsplus

要是忘了 umount,就拔掉硬碟,下一次插入這個硬碟時,會出現下列訊息:
hfs: Filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. mounting read-only.
可是,fsck.hfsplus(8) 哪裡來?如果用的是 Debian Lenny 或更新的系統版本,那麼
# aptitude install hfsprogs
就會裝上 fsck.hfsplus(8) 跟 mkfs.hfsplus(8)。如果是 Debian Etch 或更舊的系統版本,則必須下載原始碼,自行 complie。我是這麼做的:(亦見 [1]
$ mkdir /usr/local/src/hfsplus/
$ cd /usr/local/src/hfsplus/
$ wget -U opera ftp://ftp.fi.debian.org/pub/gentoo/distfiles/diskdev_cmds-332.14.tar.gz
$ wget ftp://ftp.fi.debian.org/pub/gentoo/distfiles/diskdev_cmds-332.14.patch.bz2
$ gzip -dc diskdev_cmds-332.14.tar.gz | tar xvf -
$ bzip2 -dc diskdev_cmds-332.14.patch.bz2 | patch -p0
$ cd diskdev_cmds-332.14/
$ make -f Makefile.lnx
$ cp -p newfs_hfs.tproj/newfs_hfs /usr/local/sbin/mkfs.hfsplus
$ cp -p fsck_hfs.tproj/fsck_hfs /usr/local/sbin/fsck.hfsplus
$ ln -s /usr/local/sbin/mkfs.hfsplus /usr/local/sbin/mkfs.hfs
$ ln -s /usr/local/sbin/fsck.hfsplus /usr/local/sbin/fsck.hfs
接下來就可以試試剛裝好的 fsck.hfsplus,例如:
$ sudo fsck.hfsplus /dev/sda2
會出現以下訊息:
** /dev/sdg2
** Checking HFS Plus volume.
fsck_hfs: Volume is journaled.  No checking performed.
fsck_hfs: Use the -f option to force checking.
再做一次 force checking:
$ sudo fsck.hfsplus -f /dev/sda2
則會看到:
** /dev/sdg2
** Checking HFS Plus volume.
** Detected a case-sensitive catalog.
** Checking Extents Overflow file.
** Checking Catalog file.
** Checking Catalog hierarchy.
** Checking Extended Attributes file.
     Reserved fields in the catalog record have incorrect data (8, 3)
     Reserved fields in the catalog record have incorrect data (8, 3)
** Checking volume bitmap.
** Checking volume information.
** Repairing volume.
Segmentation fault
哇!"Segmentation fault"!這些程式碼還沒有很乾淨地 port 到 Linux 來。雖然發生了 "Segmentation fault",但後來 "Filesystem was not cleanly unmounted" 這個 message 就沒有再出現,這很可能是因為這個程式 reset 了一個 flag,而我的硬碟拔掉前,沒有什麼寫入的動作,所以「還算」乾淨。如果你有一個 Mac OSX,也可以參考 [3]。如果你有 iPod,[2] 也有很詳細的說明。

如何在 Linux 停止 hfsplus 的 journaling?

但無論如何,請注意要「停掉」hfsplus 檔案系統的 journaling 之後,才適合在 Linux 上對 hfsplus 做安全的寫入動作。由 ubuntu forums [5],我們轉載網友 blink 修改過的 C 程式碼如下:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <byteswap.h>
int main(int argc, char *argv[])
{
        int fd = open(argv[1], O_RDWR);
        if(fd < 0) {
                perror("open");
                return -1;
        }
        unsigned char *buffer = (unsigned char *)mmap(NULL, 2048, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
        if(buffer == (unsigned char*)0xffffffff) {
                perror("mmap");
                return -1;
        }
        if((buffer[1024] != 'H') && (buffer[1025] != '+')) {
                fprintf(stderr, "%s: HFS+ signature not found -- aborting.\n", argv[0]);
                return -1;
        }
        unsigned long attributes = *(unsigned long *)(&buffer[1028]);
        attributes = bswap_32(attributes);
        printf("attributes = 0x%8.8lx\n", attributes);
        if(!(attributes & 0x00002000)) {
                printf("kHFSVolumeJournaledBit not currently set in the volume attributes field.\n");
        }
        attributes &= 0xffffdfff;
        attributes = bswap_32(attributes);
        *(unsigned long *)(&buffer[1028]) = attributes;
        buffer[1032] = '1';
        buffer[1033] = '0';
        buffer[1034] = '.';
        buffer[1035] = '0';
        buffer[1036] = 0;
        buffer[1037] = 0;
        buffer[1038] = 0;
        buffer[1039] = 0;
        printf("journal has been disabled.\n");
        return 0;
}
把這些碼存成,例如 hfsplus_disable_joural.c,
$ gcc hfsplus_disable_joural.c
$ sudo ./a.out /dev/sda2
看到訊息:
attributes = 0x80002100
journal has been disabled.
如果這個檔案系統本來就沒有 journal,那麼這個程式會輸出:
attributes = 0x80000100
kHFSVolumeJournaledBit not currently set in the volume attributes field.
journal has been disabled.
把 journaling disable 掉之後,再試試看 fsck.hfsplus(8),這次就不需要用 -f 來強迫它去檢查 journaling 的檔案系統。雖然 "Segmentation fault" 依然發生,就看 Debian 更新的版本是不是會把這個 bug 除掉。

Related Articles

[a] 2011-11-04, Linux 的 udev 是個有趣又有用的玩具(1)
     http://kolmogolovi.blogspot.com/2011/11/linux-udev-1.html

[b] 2011-11-11, Linux 的 udev 是個有趣又有用的玩具(2)
     http://kolmogolovi.blogspot.com/2011/11/linux-udev-2.html

[c] 2011-11-11, Linux 的 udev 是個有趣又有用的玩具(3)
     http://kolmogolovi.blogspot.com/2011/11/linux-udev-3.html

[d] 2011-11-21, Linux 的 udev 是個有趣又有用的玩具(4)
     http://kolmogolovi.blogspot.com/2011/11/linux-udev-4.html

[e] 2012-06-13 Linux 的 udev 是個有趣又有用的玩具 (5en) : Smallest Working Bourne-Shell Automounter
     http://kolmogolovi.blogspot.tw/2012/06/linux-udev-5-smallest-working-bourne.html

External Links

[1] Check/Fix HFS+ From Linux # fsck.hfsplus - InsanelyMac Forum
     http://www.insanelymac.com/forum/index.php?showtopic=33982

[2] Mac iPod on Linux
     http://kpweb.homelinux.org/recipes/mac_ipod_on_linux.html

[3] Repair HFS+ Volume on OSX - Blog pro de Jean-Baptiste HEREN
     http://blog.jbheren.com/post/2011/02/09/repair-hfs-volume-on-osx

[4] Hfsplus - Gentoo Linux Wiki
     http://en.gentoo-wiki.com/wiki/HOWTO_hfsplus

[5] Disable HFS+ journaling from within Ubuntu, ubuntu forums
     http://ubuntuforums.org/showthread.php?t=1420673
Bladehawke: It *can* be done. And there's code already written to do it. Please see http://dmunsie.wordpress.com/code/hacks/ and http://loquerasparalinux.blogspot.co...aling-sin.html for the particulars. In short, dmunsie wrote a brief C program for OSX that can change the necessary bits in the partition header and the second link points to a very simple patch to make it compile under linux along with instructions for use.

blink: I tweaked the code to compile cleanly on ubuntu. The two line difference is highlighted in yellow on the pastebin link. http://pastebin.com/W8pfgHRe