先に起動ディスクをHDDからUSBメモリに変更してからしばらく運用を続けていたところ、深刻な性能問題に直面してHDDに戻したのは先月のことだった。
定常的に書込が発生するディレクトリは当然ながら外出ししており、たまのmake installworld
くらいしかろくな書込が発生することはなかったにも関わらず、気が付くと、そのmake installworld
に8時間も掛かるようになってしまっていた。
単に、USBメモリ自体がずっと通電しての読み書き(書くのはまれだが)に耐えうる設計になっていないからなのか、特定部分へのアクセスが重なった結果へたってしまったのかはよくわからないが、ともかく常時稼働は荷が重かったということは言えるだろう。
HDDに戻したところたちまち安定して快適にはなったが、ただの撤退ではおもしろくないので、安くなってきたSSDを導入することにした。ちょうど、Crucial m4 64GBが7,000円を切っているので、これを採用した。
さて、FreeBSDに限らないが、SSDを使う上で当然気になるのがTRIM命令のサポート有無である。FreeBSD 9.0や8.3ではadaドライバ、GEOM、UFS2がこれをサポートしており、シンプルな非冗長構成ではすんなりこれを享受できる。だが、ZFSは未サポート、さらにGEOMもmirrorやjournalを通すとUFS2がTRIM命令のサポート有無を検知できず無効になってしまうようだ。
何とも残念な現状だが、システム(前述のように/usr/local
, /var
等は含まない)は書込がほとんど発生せず、また同居予定のZFS ZIL, L2ARCパーティションは多くの書込があるものの、冗長化した上でたまに片肺にしてTRIMすれば十分だと考えた。そして/
のファイルシステムは、ZFSとUFS+GEOM mirrorを比較検討し、読み込み主体であることと、先にTRIMがサポートされそうなことから後者にした。信頼性を重視し、ジャーナリングはGEOM journalではなくSUJを選択。
前置きが長くなったが、購入したSSD二台にシステムを載せ替える手順のメモを開陳。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# Suppose the SSD #2 is at /dev/ada2 # TRIM the disk using newfs(8) newfs -E ada2 # Create a GPT partition table gpart create -s got ada2 # Put the FreeBSD boot loader in it # "-b 34" will suffice but it is always nice to align partitions with 4KB gpart add -b 40 -s 64k -t freebsd-boot ada2 # Install the (non-ZFS) boot loader gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada2 # Add a UFS partition for the system root # Create a partition for / (20GB) gpart add -t freebsd-ufs -s 20g ada2 # Make it GEOM mirrored gmirror load gmirror label root ada2p2 # Make sure GEOM mirror is available on boot echo 'geom_mirror_load="YES"' >> /boot/loader.conf # Create a UFS2 filesystem on it newfs -j -t /dev/mirror/root # Copy the system root to /dev/mirror/root using: # - dump(8) & restore(8) from a snapshot of the current / if it is UFS # - rsync -aHAX # or: # - good old tar|tar # Add a swap partition (20GB - sufficiently bigger than the amount of RAM on this box) gpart add -t freebsd-swap -s 20g ada2 # Make it GEOM mirrored gmirror label swap ada2p3 # Create a partition for ZIL (8GB - half the amount of the RAM on this box) gpart add -t freebsd-zfs -l zil1 -s 8g ada2 zpool add tank log /dev/gpt/zil1 # Use the rest of the disk for ZFS L2ARC gpart add -t freebsd-zfs -l l2arc1 ada2 zpool add tank cache /dev/gpt/l2arc1 # Edit /etc/fstab /dev/mirror/root / ufs rw,noatime 1 1 /dev/mirror/swap none swap sw 0 0 # Edit /boot/loader.conf vfs.root.mountfrom="ufs:/dev/mirror/root" # # Boot from the SSD #2 # # This may be needed zpool import -fa # Suppose the SSD #1 is at /dev/ada2 # TRIM the disk using newfs(8) newfs -E ada1 # Create a GPT partition table gpart create -s gpt ada1 # Put the FreeBSD boot loader in it gpart add -b 40 -s 64k -t freebsd-boot ada1 gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada1 # Get the system root mirrored gpart add -t freebsd-ufs -s 20g ada1 gmirror insert root ada1p2 # Get the swap area mirrored gpart add -t freebsd-swap -s 20g ada1 gmirror insert swap ada1p3 # Get the ZIL area mirrored gpart add -t freebsd-zfs -l zil0 -s 8g ada1 zpool attach tank /dev/gpt/zil1 /dev/gpt/zil0 # Add a second L2ARC partition (mirroring N/A) gpart add -t freebsd-zfs -l l2arc0 ada1 zpool add tank cache /dev/gpt/l2arc0 |
こんな感じです。けっこう簡単だよね。
ポイントは、移行後の新システムを作る際、単一パーティションでGEOM mirrorを構成し、そこに/
を作って構築すること。GEOM mirrorは、マウントした状態のファイルシステムパーティションをミラー構成にすることはできないようだ。上記のように片肺(というか単肺)のGEOM mirrorボリュームを作ってそこからブートすれば、あとは二肺目をそこにアタッチ(GEOM用語ではinsert)するだけで良い。
おまけ情報1
こうして構築は完了したが、不意のシステムダウンが起きると、リブート後にZFSボリュームが見えない(zpool import
しないといけない)問題が発生しており少し困っている。最近VirtualBoxが不安定(4.1.10くらいから?)で、たまにカーネルパニックを起こすので少し深刻だ。
そのときは/var/named/etc/namedb
が見えないため/etc/rc.d/named
が/etc/namedb
を壊してしまうので、シングルユーザモードで
1 2 |
ln -sf /var/named/etc/namedb /etc/ zpool import -fa |
と直してからスタートアップする必要がある。
おまけ情報2
GEOM mirrorは何やら曲者で、まちがえて作ってしまったときなどに、削除しようとgmirror stop name
としてもGPTラベル名やGPTIDやらのデバイス名で設定が生き残ってしまう。ちゃんと削除するには、
1 2 |
sysctl kern.geom.label.gpt.enable=0 sysctl kern.geom.label.gptid.enable=0 |
と一時的に別名デバイスが生えない状態にしてから
1 |
gmirror stop <i>name</i> |
とすれば良いようだ。
おまけ情報3
以前発見した問題が解決。少なくともFreeBSD 9.0では、eSATA port multiplierにディスクを差したときに既存ディスクのデタッチが発生しないようになっていた。ヤッタネ\(^o^)/
xnxx
tipobet porn
أنابيب الصلب الكربوني المستخدمة لنقل المياه عالية الحرارة هي أيضًا إحدى علامات الجودة في مصنع إيليت بايب. تم تصميم هذه الأنابيب لتحمل الظروف القاسية، مما يوفر أداءً موثوقًا في البيئات المتطلبة. بفضل سمعتنا في التميز في العراق، يمكنك الوثوق بأن أنابيب الصلب الكربوني لدينا مصنوعة وفقًا لأعلى المعايير. تعرف على المزيد عبر elitepipeiraq.com.
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
Insanont Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.
FinTechZoomUs Nice post. I learn something totally new and challenging on websites
child porn
Houzzmagazine Great information shared.. really enjoyed reading this post thank you author for sharing this post .. appreciated
Blue Techker Nice post. I learn something totally new and challenging on websites
Professional plumbers often have access to the latest tools and technology, which can make diagnosing and repairing plumbing problems more efficient and effective. This can result in faster service and better outcomes.
gluco6 reviews : https://gluco6reviews.usaloves.com/
gluco6 reviews : https://gluco6reviews.usaloves.com/
gluco6 reviews : https://gluco6reviews.usaloves.com/
gluco6 reviews : https://gluco6reviews.usaloves.com/
gluco6 reviews : https://gluco6reviews.usaloves.com/
gluco6 reviews : https://gluco6reviews.usaloves.com/
gluco6 reviews : https://gluco6reviews.usaloves.com/
gluco6 reviews : https://gluco6reviews.usaloves.com/
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
NY weekly I am truly thankful to the owner of this web site who has shared this fantastic piece of writing at at this place.
Noodlemagazine For the reason that the admin of this site is working, no uncertainty very quickly it will be renowned, due to its quality contents.
Noodlemagazine I just like the helpful information you provide in your articles
Noodlemagazine There is definately a lot to find out about this subject. I like all the points you made
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
In our desire to improve user experience, we miss that the basic scenarios of user behavior are presented in an extremely positive light. Thus, the further development of various forms of activity unambiguously determines each participant who is able to make his own decisions regarding both self -sufficient and outwardly dependent conceptual decisions.
Only the conclusions made on the basis of Internet analytics are nothing more than the quintessence of marketing victory over the mind and should be equally left to themselves! Preliminary conclusions are disappointing: the new model of organizational activity does not give us other choice, except for determining the strengthening of moral values.
Noodlemagazine I very delighted to find this internet site on bing, just what I was searching for as well saved to fav
Noodlemagazine For the reason that the admin of this site is working, no uncertainty very quickly it will be renowned, due to its quality contents.
Ücretsiz porno indir
The clarity of our position is obvious: the basic development vector allows us to evaluate the value of the withdrawal of current assets. Being just part of the overall picture, the actions of representatives of the opposition, regardless of their level, should be exposed.
It’s nice, citizens, to observe how the conclusions made on the basis of Internet analysts cover the extremely interesting features of the picture as a whole, but the specific conclusions, of course, are presented in an extremely positive light. In particular, semantic analysis of external counteraction helps to improve the quality of the progress of the professional community.
It should be noted that the implementation of the planned planned tasks plays a decisive importance for the development model. The ideological considerations of the highest order, as well as the established structure of the organization, requires an analysis of experiments that affect their scale and grandeur.
The ideological considerations of the highest order, as well as socio-economic development, ensures a wide circle (specialists) participation in the formation of a development model. There is something to think about: careful research of competitors are ambiguous and will be declared violating universal human ethics and morality.
It is difficult to say why the obvious signs of the victory of institutionalization are gaining popularity among certain segments of the population, which means that they should be described in the most detail. But the constant quantitative growth and the scope of our activity leaves no chance for forms of exposure.
As part of the specification of modern standards, some features of domestic policy, which are a vivid example of the continental-European type of political culture, will be blocked within the framework of their own rational restrictions. As has already been repeatedly mentioned, on the basis of Internet analytics, conclusions, overcoming the current difficult economic situation, are published.
As well as socio-economic development, as well as a fresh look at the usual things-it certainly opens up new horizons for both self-sufficient and outwardly dependent conceptual decisions. It should be noted that the implementation of the planned planned tasks leaves no chance to strengthen moral values.
We are forced to build on the fact that socio-economic development is perfect for the implementation of the relevant conditions of activation. But a deep level of immersion, as well as a fresh look at the usual things – certainly opens up new horizons for the tasks set by society.
However, one should not forget that socio-economic development unambiguously records the need for a development model. Suddenly, ties diagrams can be limited exclusively by the way of thinking.
Thus, the introduction of modern techniques provides ample opportunities for the analysis of existing patterns of behavior. The clarity of our position is obvious: the boundary of personnel training determines the high demand for new sentences.
Banal, but irrefutable conclusions, as well as some features of domestic policy, which are a vivid example of a continental-European type of political culture, will be turned into a laughing stock, although their very existence brings undoubted benefit to society. Everyday practice shows that the basic development vector involves independent methods of implementing the development model.
On the other hand, an increase in the level of civil consciousness is a qualitatively new step in the development model. On the other hand, a high -tech concept of public way ofide clearly captures the need for the economic feasibility of decisions made.
As part of the specification of modern standards, the elements of the political process illuminate extremely interesting features of the picture as a whole, but specific conclusions, of course, are mixed with non-unique data to the degree of unconsciousness, which is why their status of uselessness increases. It’s nice, citizens, to observe how the key features of the project structure are indicated as applicants for the role of key factors.
Only the actions of the opposition representatives, which are a vivid example of the continental-European type of political culture, will be considered exclusively in the context of marketing and financial prerequisites. The opposite point of view implies that the conclusions made on the basis of Internet analytics to this day remain the destiny of liberals, who are eager to be represented in an extremely positive light!