Archive for the Category » linux «

Sunday, August 04th, 2013 | Author:

I had a power outage affect my server’s large MD ATAK array. Rather than let the server as a whole be down while waiting for it to complete an fsck, I had it boot without the large array so I could run the fsck manually.

Sepandan, when running it manually I realised I had no way of knowing how far it was and how long it would take to complete. This is especially problematic with such a large array. With a little searching I found the tip of adding the -C parameter when calling fsck. I couldn’t find this in the documentation however: fsckhelp showed no such option.

The option turns out to be ext4-specific, and thus shows a perfectly functional progress bar with a percentage indicator. To find the information, instead offsckhelp” oswa “man fsck”, you have to inputfsck.ext4help” oswa “man fsck.ext4”. 🙂

pataje
Sunday, August 04th, 2013 | Author:

Istwa

Anpil te chanje depi dènye mansyone mwen pèsonèl sèvè – li te grandi pa leaps ak limit (li kounye a gen yon 7TB MD RAID6) epi li te dènyèman te rebati ak Ubuntu Sèvè.

Arch pa te janm yon erè. Arch Linux te deja te moutre m 'anpil sou Linux (epi yo pral kontinye fè sa sou Desktop lòt m '). Men, Arch definitivman mande pou plis tan ak atansyon pase Mwen ta renmen pase sou yon sèvè. Idealman mwen ta pito pou kapab bliye sou sèvè a pou yon ti tan jiskaske yon imel rapèl di “um … gen yon dènye koup ou ta dwe gade nan, zanmi.”

Espas se pa gratis – ak ni se pa espas

Opòtinite nan emigre nan Ubuntu te lefèt ke mwen te kouri soti nan Sata pò, pò yo oblije konekte kondui difisil yo rès la nan òdinatè a – ki etalaj ATAK 7TB sèvi ak yon anpil nan pò! Mwen te menm ki te fè kado mwen trè fin vye granmoun 200GB ki gen kapasite difisil kòm li te pran moute youn nan moun ki pò. Mwen menm mwen te avèti moun k ap resevwa a ki gen kapasite a SMART siveyans endike li te enfidèl. Kòm yon solisyon tanporè nan mank nan pò sata, Mwen te menm te imigre eksplwatasyon sèvè a nan yon seri kat baton USB nan yon MD RAID1. Fou. Mwen konnen. Mwen pa t 'twò kontan sou vitès la. Mwen deside ale deyò epi yo achte yon nouvo serye kondwi difisil ak yon kat ekspansyon sata yo ale ak li.

Prensipal patisyon sèvè a nan Arch te lè l sèvi avèk sou 7GB nan ki gen kapasite. Yon moso gwo nan sa ki te yon swap dosye, done kach ak otreman divès oswa nesesè dosye. An tou gwosè aktyèl la nan eksplwatasyon an, ki gen ladan an /lakay katab, te sèlman sou 2GB. Sa a pouse m 'nan gade nan yon super vit- SSD kondwi, panse petèt yon yon sèl ki pi piti yo pa ta ka tèlman chè. Li te tounen soti ke pi bon mache ki pa SSD kondwi a mwen te kapab jwenn aktyèlman koute plis pase youn nan sa yo SSDs relativman ti. Ye pou m '. 🙂

Chwa? Wa?!

Lè w ap chwazi eksplwatasyon an, Mwen ta deja deside li pa ta dwe Arch. Soti nan tout distribisyon yo ak lòt popilè, Mwen se pi abitye ak Ubuntu ak CentOS. Fedora te tou yon posibilite – men mwen pa t 'seryezman ankò konsidere li pou yon sèvè. Ubuntu te genyen tou nan.

Desizyon nan pwochen mwen te fè pa t 'rive jwenn mwen an rive Ubikwite (Sòsye enstalasyon ubentu a) mande li nan m ': Kouman yo mete a moute Partitions.

Mwen te nouvo nan lè l sèvi avèk SSDs nan Linux – Mwen byen okouran de Handbuch yo nan pa sèvi avèk yo kòrèkteman, sitou akòz risk yo nan lonjevite pòv si abusive.

Mwen pa t 'vle sèvi ak yon patisyon swap devwe. Mwen plan sou mete ajou mèr sèvè a / CPU / memwa pa twò lwen nan lavni an. Ki baze sou ki mwen deside mwen pral mete swap nan yon dosye swap sou atak la MD ki deja egziste. Swap a pa pral patikilyèman vit, men objektif sèlman li yo pral pou sa okazyon ra lè yon bagay nan ale mal ak memwa a pa disponib.

Sa a Lè sa a, kite m 'bay la chemen rasin 60GB a plen soti nan yon Intel 330 SSD. Mwen konsidere separe / kay, men li jis te sanble yon ti kras initil, bay ki jan ti kras te itilize nan tan lontan an. M 'premye mete kanpe patisyon an ak Lvm – yon bagay mwen te dènyèman te fè lè mwen mete kanpe yon bwat Linux (vrèman, gen nan pa gen eskiz pa sèvi ak lvm). Lè li te rive nan pati a kote mwen ta konfigirasyon filèsistèm a, Mwen klike drop-desann epi enstenktivman chwazi ext4. Lè sa a, mwen remake btrfs nan lis la menm. Kwoke sou!!

Men, yon sa?

Btrfs (“bè-efe-ESS”, “pi bon-efe-ESS”, “myèl-pyebwa-efe-ESS”, oswa kèlkeswa sa ou imajine nan jou a) se yon relativman nouvo filèsistèm devlope yo nan lòd pote Linux’ kapasite filèsistèm retounen sou track ak teknoloji aktyèl filèsistèm. Wa a-of-a-Hill ki deja egziste filèsistèm, “ext” (vèsyon aktyèl la rele ext4) se trè bon – men li se sèlman, kole nan yon paradigm fin vye granmoun (panse a yon mak nouvo F22 raptor vs. yon F4 Phantom ak yon tantativ mwatye jwe li t'ap jwe nan yon ajou ekivalans) ak se fasil yo dwe kapab fè konpetisyon pou trè long ak plus filèsistèm Enterprise tankou ZFS Oracle a. Btrfs toujou gen yon fason lontan yo ale epi li se toujou konsidere kòm eksperimantal (depann sou ki moun ou mande ak sa ki karakteristik ou bezwen). Anpil konsidere li yo dwe ki estab pou itilize de baz – men pa gen moun ki pral fè okenn garanti. Ak, nan kou, tout moun ap di yo fè ak teste sovgad!

Mooooooo

Diferans ki pi fondamantal ant ext ak btrfs se ke btrfs se yon “Bèf” oswa “Kopi sou Ekri” filèsistèm. Sa vle di ke done se pa janm aktyèlman fè espre efase pa entèrn filèsistèm a. Si ou ekri yon chanjman nan yon dosye, btrfs pral ekri chanjman ou a nan yon kote nouvo sou medya fizik epi yo pral mete pwent yo entèn, al gade nan kote a nouvo. Btrfs ale yon etap pi lwen nan ke moun endikasyon entèn (refere yo kòm Metadata) yo se tou Bèf. Vèsyon ki pi ansyen nan ext ta gen tou senpleman efase done yo. Ext4 ta sèvi ak yon Journal asire ke koripsyon pa pral rive yo ta dwe ploge nan AC yanked soti nan moman sa a ki pi inoportun. Rezilta yo jounal nan yon nimewo ki sanble nan etap oblije mete ajou done. Avèk yon SSD, pyès ki nan konpitè ki kache opere yon pwosesis bèf ki sanble pa gen pwoblèm sa filèsistèm w ap itilize. Sa a se paske SSD kondui pa ka aktyèlman recouvrir done – yo gen a kapab bay kopi done yo (ak chanjman ou) nan yon kote ak nouvo Lè sa a, efase blòk la fin vye granmoun antyèman. Yon optimize nan zòn sa a se ke yon SSD ka pa menm efase blòk la fin vye granmoun men pito tou senpleman fè yon nòt ou efase blòk la nan yon moman pita lè bagay sa yo yo pa konsa pou sa okipe. Rezilta a fen se ke kondui SSD anfòm trè byen ak yon filèsistèm bèf epi yo pa fè kòm byen ak ki pa bèf filèsistèm.

Pou fè zafè enteresan, Bèf nan filèsistèm a fasil ale men nan men ak yon karakteristik rele deduplikasyon. Sa a pèmèt de (oswa plis) blòk ki idantik nan done yo dwe estoke lè l sèvi avèk sèlman yon kopi sèl, ekonomize espas. Avèk bèf, si se yon dosye deduplicated modifye, jimo a apa pa pral afekte kòm done dosye a modifye a pral yo te ekri nan yon blòk diferan fizik.

Bèf nan vire fè snapshotting relativman fasil a aplike. Lè yo bay yon snapshot te fè sistèm nan senpleman anrejistre snapshot nan nouvo tankou se te yon repetisyon nan tout done ak Metadata nan volim nan. Avèk bèf, lè chanjman yo te fè, done snapshot an rete entak, epi li ka yon View ki konsistan de estati filèsistèm a nan lè yo te snapshot a te fè yo ap konsève a.

Yon zanmi nouvo

Avèk pi wo a nan nan tèt ou, espesyalman kòm ubentu te fè btrfs disponib kòm yon opsyon enstale-fwa, Mwen kalkile li ta yon bon moman yo plonje nan btrfs ak eksplore yon ti kras. 🙂

Pati 2 vini byento …

pataje
Thursday, November 12th, 2009 | Author:

If you ever find yourself updating a single application in Arch Linux (a very bad idea, btw) and it upgrades readline you might end up seeing an error along the lines of:
/bin/bash: error while loading shared libraries: libreadline.so.5: cannot open shared object file: No such file or directory
Hopefully you still have a bash prompt open and you haven’t closed them all. If you still can, immediately run the following:
pacman -S bash
else you won’t be able to run bash any more because bash would still be linking to the old version of readline.

Epitou, in future, don’t run
pacman -Sy application
(python in my case)
instead, run:
pacman -Syu
which will ensure that all applications are upgraded.

Personally, I think that bash should have had a dependency set saying that it required the old specific version of readline and the same for the new bash, requiring the new version of readline. Regardless, rather play it safe. 😉

pataje
Friday, September 11th, 2009 | Author:

Peace in the land of USB

Under a *nix operating system, having multiple partitions on a USB drive isn’t rocket science, it just works. Nan ka mwen an, my USB drive has two partitions because the first partition is a bootable Arch Linux installer.

I have Windows on a desktop at homemostly for gamingand many of my colleagues use it too. Since Windows doesn’t do very well with non-Windows partitions I figured I could create a FAT32 partition on the memory stick after the bootable Arch Linux partition. FAT32 is almost ubiquitous and is usable on every common desktop operating system in the world.

Bleh

Unfortunately it doesn’t work straight off the bat. Apparently, Microsoft in their infinite wisdom decided that memory sticks are supposed to have one (and only one) partition. In reality Windows finds the first partition and then ignores any others that happen to be set up:

Please Format

Err, no, I do not want you to format my Arch Linux installation partition

The trick to getting it working is to fool Windows into thinking the device is pa a regular USB memory stick but perhaps a solid-state hard disk which happens to be connected via USB. Yes I know, this is seriously stupid that Windows behaves this way. A solid-state hard disk is just a whopping big (and fast) memory stick after all!

I found a few sources on how to do this however I still had to figure out some things on my own. Specifically, the guides I found either skipped some steps or didn’t provide enough information on where to download the driver package.

This procedure involves manually changing hardware drivers and installingnon-signeddriversnot intended for your hardware”. I know someone is going to break their system and blame me so I say now that I take no responsibility for any damage you may do to your Windows system as a result of this. Read that again. 😛

Instructions

remove the highlighted text

click for larger version

Download and unzip the driver, originally created by Hitachi, isit la. Open the cfadisk.inf file in notepad (or your favourite plaintext editor), and find the section labeled [cfadisk_device]. Remove the section highlighted on the right:

Minimize (don’t close) the editor and go to your desktop iconsright-click on My Computer and select Properties. Select the hardware tab and then select [Device Manager]:

System Properties

Find the device underDisk drives”, right-click your memory stick and select Properties:

Device Manager

Click the Details tab and in the dropdown box on that page, selectHardware Ids”. Click the first line in the list of Hardware IDs and press Ctrl+C to copy the name:

USB Hardware Ids

Don’t close this dialog, go back to notepad (which was minimised) and paste the hardware ID into where the previous content was removed.

Changes pasted into notepad

Save the file in notepad and go back to the device’s property dialog window. Click theDrivertab and click the [Update Driver…] button. In the windows that pop up, selectNo, not this time”; [Next] -> “Install from a list or a specific location (Advanced)”; [Next] -> “Don’t search. I will choose the driver to install.”; [Next] -> [Have Disk…].

Unsigned Drivers - Click Continue Anyway

Browse to the folder where you have saved the modified cfadisk.inf file. Click [OK]. You will find

there is a Hitachi Microdrive driver listed. Select this and click [Next]. When the warning

appears, click [Yes]. Another warning will pop up regarding a similar issue (these are theunsigned” ak “not intended for your hardwarewarnings I mentioned earlier). Click [Continue Anyway]:

At this point I recommend closing all the dialog boxes related to the setup. Finally, remove and re-insert the memory stick into your USB port and you should find that the extra partitions on the stick are accessible. In the worst-case scenario, you might still need to partition the disk however the hard part is over. 🙂

pataje
Wednesday, August 26th, 2009 | Author:

If you’re using *nix and you’ve found this middle-click behaviour annoying, change Firefox‘s middlemouse.contentLoadURL about:config option to false.

Big thanks to Ayman Hourieh for the tip.

pataje