Archive for the Category » linux «

Sunday, August 04th, 2013 | Author:

I had a power outage affect my server’s large md RAID 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.

Madankollu, 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” jew “man fsck”, you have to inputfsck.ext4help” jew “man fsck.ext4”. 🙂

Aqsam
Sunday, August 04th, 2013 | Author:

Storja

Ħafna kienu nbidlu peress I aħħar imsemmi tiegħi server personali – din kibret leaps u limiti (issa għandha 7TB md RAID6) u kien reċentement ġie rrikostitwit ma Ubuntu Server.

Arch qatt kien żball. Arch Linux kienet diġà mgħallma me daqstant dwar Linux (u se tkompli tagħmel dan fuq id-desktop tiegħi oħra). Iżda Arch definittivament teħtieġ iktar ħin u attenzjoni milli nixtieq li jonfqu fuq server. Idealment I d jippreferu li jkunu kapaċi tinsa dwar il-server għal waqt sakemm email tfakkira jgħid “um … hemm koppja aġġornamenti għandek tfittex fil, buddy.”

Ispazju mhuwiex ħieles – u la huwa l-ispazju

L-opportunità li jemigraw lejn Ubuntu kien il-fatt li kelli jispiċċaw ta ' SATA portijiet, il-portijiet meħtieġa biex jgħaqqdu hard drives għall-bqija tal-kompjuter – li firxa RAID 7TB juża ħafna ta 'portijiet! I kienet saħansitra mogħtija bogħod tiegħi ħafna qodma hard disk 200GB kif hija ħadet up waħda minn dawk il-portijiet. I wkoll wissa lir-riċevitur li l-disk tal SMART monitoraġġ indika li kien inaffidabbli. Bħala workaround temporanja għan-nuqqas ta 'portijiet SATA, I kienet saħansitra emigraw OS-server li sett ta 'erba stikek USB fi md RAID1. Crazy. Naf. I ma kienx wisq kuntenti dwar il-veloċità. I iddeċieda li joħorġu u jixtru hard drive affidabbli ġodda u karta espansjoni SATA li jmorru magħha.

Partition l-server primarja Arch kien uża madwar 7GB ta 'disk. A blokki kbar ta 'dak kien tpartit fajl, data Cached u fajls inkella jew mixxellanji mhux meħtieġa. B'mod ġenerali d-daqs attwali tal-OS, inkluż il- /home folder, Kien biss madwar 2GB. Dan wassal għalija li tħares lejn super fast SSD issuq, ħsieb forsi wieħed iżgħar jista 'ma jkunx tant għali. Irriżulta li l-irħas drive mhux SSD I jista 'jsib ispiża attwalment aktar minn wieħed minn dawn SSDs relattivament żgħar. Yay għalija. 🙂

Għażla? Woah?!

Fl-għażla l-OS, I d diġà ddeċidiet li ma jkunx Arch. Mit-total ta 'l-distribuzzjonijiet oħra popolari, Jien aktar familjari ma Ubuntu u CentOS. Fedora kien ukoll il-possibbiltà – iżda I kien għadu ma kkunsidrata serjament dan għal server. Ubuntu rebaħ il-round.

Id-deċiżjoni li jmiss I kellha tagħmel ma seħħx lili sakemm Ubikwità (Wizard installazzjoni Ubuntu) talabha ta 'lili: Kif twaqqaf il- ħitan.

I kien ġdid għall-użu SSDs fl-Linux – Jien konxju tal-iżvantaġġi ta 'mhux jużawhom b'mod korrett, aktar minħabba r-riskju tagħhom ta 'lonġevità fqira jekk użati ħażin.

I ma riedx li jużaw partition tpartit dedikat. I pjan dwar it-titjib motherboard-server / CPU / memorja mhux wisq fil-futur. Ibbażat fuq dan I iddeċieda I se tpoġġi swap ġo fajl tpartit fuq il-RAID md eżistenti. It-tpartit ma se jkun partikolarment mgħaġġel iżda uniku skop tagħhom se jkun għal din l-okkażjoni rari meta xi ħaġa marret ħażin u l-memorja ma jkunx disponibbli.

Dan imbagħad telqu lili biex jagħtu l- passaġġ għerq l-60GB sħiħa barra minn Intel 330 SSD. I kkunsidrat jisseparaw / home iżda hija biss deher ftit inutli, mogħti kif ftit kien użat fil-passat. I l-ewwel stabbilit il-partition ma LVM – xi ħaġa li stajt reċentement qed tagħmel kulmeta I twaqqaf kaxxa Linux (verament, hemm l-ebda skuża biex ma jużawx LVM). Meta ltqajna għall-parti fejn nixtieq kkonfigurat l-filesystem, I għafast il-drop-down u istintivament magħżula ext4. Imbagħad I ndunat Btrfs fl-istess lista. Tistrieħ fuq!!

Iżda dak?

Btrfs (“butir eff-ESS”, “aħjar eff-ESS”, “bee-siġra-eff-ESS”, jew kwalunkwe inti fancy fil-jum) huwa filesystem relattivament ġdida żviluppata sabiex iġibu Linux’ kapaċitajiet filesystem lura fuq il-binarji ma 'kurrent filesystem teknoloġija. Ir-Re-of-the-Hill eżistenti filesystem, “ext” (il-verżjoni attwali msejjaħ ext4) hija pjuttost tajba – iżda hi limitata, staġnati paradigma qodma (think ta 'marka ġdida F22 Raptor vs. ta F4 Phantom ma 'tentattiv nofs jested fi upgrade ekwivalenza) u mhuwiex probabbli li jkunu jistgħu jikkompetu għal żmien twil ma 'filesystems Intrapriża ġodda bħall- ZFS Oracle. Btrfs għad baqgħalha triq twila quddiemha u għadu meqjus sperimentali (jiddependi fuq li inti titlob u liema karatteristiċi li għandek bżonn). Ħafna jaħsbu li hu stabbli għall-użu bażiku – imma ħadd ma jkun se jagħmel xi garanziji. U, tal-kors, kulħadd huwa qal li tagħmel u test backups!

Mooooooo

L-aktar differenza fundamentali bejn ext u Btrfs hija li Btrfs huwa “Cow” jew “Kopja fuq Write” filesystem. Dan ifisser li d-data hija qatt ma attwalment deliberatament jinkiteb fuqhom mill-intern tal-filesystem tal. Jekk inti tikteb bidla għall-fajl, Btrfs se jikteb bidliet tiegħek għal post ġdid fuq midja fiżika u se taġġorna l-pointers interni li jirreferi għall-post ġdid. Btrfs tmur pass ieħor f'dik dawk pointers interni (imsejħa metadata) huma ukoll Cow. Verżjonijiet anzjani ta 'ext ikollu sempliċement fuq ohra l-informazzjoni. Ext4 ser jużaw Ġurnal sabiex jiżguraw li l-korruzzjoni mhux se jseħħ jekk il-plagg AC jiġu yanked fil-mument l-aktar inadatt. Ir-riżultati ġurnal f'numru simili ta 'passi meħtieġa li jaġġornaw id-dejta. Bil SSD, l-hardware sottostanti topera proċess baqra simili x'ikun filesystem inti qed tuża. Dan huwa minħabba drives SSD ma tistax attwalment jissostitwixxu data – huma għandhom kopja tad-data (mal-bidliet tiegħek) għal post ġdid u mbagħad iħassar il-blokk qodma kompletament. Ottimizzazzjoni f'dan il-qasam hija li SSD ma jista 'anke tħassar l-blokk qodma iżda sempliċiment tagħmel nota litħassar l-blokk fi żmien aktar tard meta l-affarijiet mhumiex daqshekk busy. Ir-riżultat aħħari huwa li drives SSD jaqblu tajjeb ħafna ma 'filesystem baqra u ma jwettqu kif ukoll ma filesystems mhux baqra.

Biex l-affarijiet interessanti, Cow fil-filesystem faċilment tmur id f'id ma 'karatteristika imsejjaħ deduplication. Dan jippermetti 2 (jew aktar) blokki identiċi ta 'data li għandha tiġi maħżuna bl-użu biss kopja waħda, iffrankar l-ispazju. Bil Cow, jekk fajl deduplicated hija modifikata, l twin separata mhux se jiġu affettwati bħala data tal-fajl modifikata se jkunu nkitbu għal blokk fiżika differenti.

Cow mbagħad jagħmel snapshotting relattivament faċli biex jiġi implimentat. Meta notament s-sistema hija biss l-istampa l-ġdida bħala duplikazzjoni tad-dejta kollha u metadata fil-volum. Bil Cow, meta bidliet ikunu saru, data tal-snapshot ta soġġorni intatti, u viżjoni konsistenti tad-istatus tal-filesystem fil-ħin l-istampa saret tista 'tinżamm.

A ħabib ġdid

Bl-hawn fuq fil-moħħ, speċjalment fir-Ubuntu għamlet Btrfs disponibbli bħala għażla jinstallaw-time, I dehret se jkun żmien tajjeb biex adsa fis Btrfs u tesplora ftit. 🙂

Parti 2 coming soon …

Aqsam
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.

wkoll, 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. 😉

Aqsam
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. Fil-każ tiegħi, 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 mhux 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, hawn. 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” u “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. 🙂

Aqsam
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.

Aqsam