Archive for the Category » linux «

Sunday, August 04th, 2013 | Author:

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

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

Kushiriki
Sunday, August 04th, 2013 | Author:

Historia

Mengi alikuwa iliyopita tangu mimi mwisho zilizotajwa yangu binafsi server – ni imeongezeka kwa kiwango kikubwa na mipaka (sasa ina 7TB md RAID6) na alikuwa karibuni imekuwa upya kwa Ubuntu Server.

Upinde alikuwa kamwe kosa. Arch Linux alikuwa tayari alinifundisha sana kuhusu Linux (na itaendelea kufanya hivyo kwenye desktop yangu nyingine). Lakini Arch dhahiri inahitaji muda zaidi na makini kuliko napenda kutumia katika server. Walau ningependa wanapendelea kuwa na uwezo wa kusahau kuhusu server kwa muda mpaka email kukumbusha anasema “um … kuna updates wanandoa unapaswa kuangalia, buddy.”

Nafasi si bure – na wala nafasi ya

nafasi ya kuhamia Ubuntu alikuwa na ukweli kwamba nilikuwa kukimbia nje ya SATA bandari, bandari required kuunganisha anatoa ngumu kwa mapumziko ya kompyuta – kwamba 7TB uvamizi safu matumizi mengi ya bandari! Mimi nilikuwa na hata kupewa mbali wangu sana zamani 200GB ngumu kuendesha kama Ni Akachukua moja ya bandari Wale. Mimi pia alionya kwamba mpokeaji disk ya SMART ufuatiliaji unahitajika ilikuwa ni uhakika. Kama workaround muda na ukosefu wa bandari SATA, Mimi nilikuwa na hata wamehamia OS seva na seti ya nne USB vijiti katika md RAID1. Crazy. Mimi najua. Mimi si furaha sana kuhusu kasi. Niliamua kwenda nje na kununua mpya kuaminika ngumu kuendesha na kadi SATA upanuzi kwenda nayo.

server cha msingi Arch kizigeu ilikuwa kutumia kuhusu 7GB ya disk. chunk kubwa ya kwamba ilikuwa wabadilishane faili, cached data na vinginevyo miscellaneous au unnecessary files. Kwa ujumla ukubwa halisi wa OS, ikiwa ni pamoja na /nyumbani folder, ilikuwa tu kuhusu 2GB. Hii ilisababisha yangu kuangalia ndani ya super-haraka SSD kuendesha gari, kufikiri labda moja ndogo wanaweza kuwa hivyo gharama kubwa. Aligeuka kuwa gharama nafuu mashirika yasiyo ya SSD gari mimi naweza kupata kwa kweli gharama zaidi ya moja ya haya SSDs ndogo. Yay kwa ajili yangu. 🙂

Uchaguzi? Woah?!

Katika kuchagua OS, Ningependa tayari aliamua isingekuwa Arch. Kati ya mengine yote mgawanyo maarufu, Mimi nina zaidi ukoo na Ubuntu na CentOS. Fedora alikuwa pia uwezekano – lakini sikuwa umakini bado ni kuchukuliwa kwa seva. Ubuntu alishinda duru ya.

uamuzi ijayo mimi alikuwa na kufanya hawakuwa kutokea kwangu mpaka Kuenenea (Ufungaji wa Ubuntu mchawi) aliuliza ni wa kwangu: Jinsi ya kuanzisha partitions.

Nilikuwa mpya ya kutumia SSDs katika Linux – Mimi nina pamoja na ufahamu wa hasara za si kutumia yao kwa usahihi, zaidi kutokana na hatari ya longevity maskini kama vibaya.

Sikutaka kutumia ari byta kizigeu. Mimi mpango juu ya kuwaendeleza Motherboard seva / CPU / kumbukumbu si mbali sana katika siku zijazo. Kulingana na kwamba mimi niliamua kuweka byta katika faili byta juu ya uvamizi zilizopo MD. wabadilishane hautakuwa hasa kufunga lakini madhumuni yake itakuwa tu kwa ajili ya tukio nadra kwamba wakati kitu wamekwenda vibaya na kumbukumbu si inapatikana.

Hii basi kushoto kwangu kutoa mizizi njia 60GB kamili nje ya Intel 330 SSD. Nikaziangalia kutenganisha / nyumbani lakini alionekana tu kidogo pointless, aliyopewa jinsi kidogo ilitumika katika siku za nyuma. Mimi kwanza kuanzisha kizigeu na LVM – kitu Nimekuwa hivi karibuni wamekuwa wakifanya wakati mimi kuanzisha sanduku Linux (kweli, hakuna udhuru si kwa matumizi LVM). Wakati got sehemu ambapo napenda configure mfumo wa faili, Mimi clicked drop-down na instinctively kuchaguliwa ext4. Kisha mimi niliona btrfs katika orodha hiyo. Hutegemea!!

Lakini nini?

Btrfs (“siagi-EFF-ess”, “bora-EFF-ess”, “nyuki-mti-EFF-ess”, au chochote wewe dhana juu ya siku) ni mfumo wa faili jipya maendeleo ili kuleta Linux’ mfumo wa faili uwezo nyuma kufuatilia kwa sasa mfumo wa faili tech. Mfalme-ya-the-Hill zilizopo mfumo wa faili, “ext” (toleo la sasa kuitwa ext4) ni nzuri – lakini ni mdogo, kukwama katika dhana ya zamani (kufikiri ya bidhaa mpya F22 Raptor vs. an F4 Phantom na jaribio nusu-jested katika kuboresha equivalency) na kuna uwezekano wa kuwa na uwezo wa kushindana kwa muda mrefu sana na filesystems karibu zaidi Enterprise kama vile Oracle ZFS. Btrfs bado ina njia ndefu ya kwenda na bado ni kuchukuliwa majaribio (kutegemea ambaye kuuliza na kile unahitaji makala). Wengi wanaiona kuwa imara kwa ajili ya matumizi ya msingi – lakini hakuna ni kwenda kufanya dhamana yoyote. Na, bila shaka, kila mtu ni kusema ya kufanya mtihani na backups!

Mooooooo

tofauti ya msingi kati ya ext na btrfs ni kwamba btrfs ni “Ng'ombe” au “Nakala Andika” mfumo wa faili. Hii ina maana kwamba data ni kweli kamwe makusudi overwritten na internals mfumo wa faili ya. Kama wewe kuandika mabadiliko kwenye faili, btrfs kuandika mabadiliko yako na eneo mpya ya vyombo vya habari kimwili na update kuyatumia ndani kwa kutaja eneo mpya. Btrfs huenda hatua zaidi kwa kuwa wale kuyatumia ndani (inajulikana kama metadata) ni pia Ng'ombe. Wazee matoleo ya ext ingekuwa tu overwritten data. Ext4 atatumia Journal kuhakikisha kwamba rushwa si kutokea lazima kuziba AC kuwa yanked nje wakati wengi inopportune. Matokeo ya journal katika idadi sawa ya hatua zinazohitajika kwa update data. Na SSD, vifaa inavyotumia kazi sawa ng'ombe mchakato bila kujali filesystem unatumia. Hii ni kwa sababu SSD anatoa hawawezi kweli overwrite data – wana kunakili data (pamoja na mabadiliko yako) na eneo mpya na kisha kufuta block zamani kabisa. optimization katika eneo hili ni kwamba SSD wanaweza hata kufuta block zamani lakini badala tu kufanya kumbuka kufuta kuzuia kwa wakati mmoja baadaye wakati mambo si hivyo busy. Matokeo ya mwisho ni kwamba SSD anatoa fit vizuri sana na filesystem ng'ombe na si kufanya kama vizuri na filesystems mashirika yasiyo ya ng'ombe.

Ili kufanya mambo ya kuvutia, Ng'ombe katika mfumo wa faili urahisi huenda mkono kwa mkono na kipengele aitwaye deduplication. Hii inaruhusu mbili (au zaidi) vitalu kufanana ya data kuhifadhiwa kwa kutumia tu nakala moja, kuokoa nafasi. Pamoja na ng'ombe, kama faili deduplicated ni iliyopita, pacha tofauti hazitaathirika kama data faili iliyopita mapenzi vimeandikwa kwa kuzuia tofauti kimwili.

Ng'ombe kwa upande hufanya snapshotting rahisi kutekeleza. Wakati snapshot ni alifanya mfumo tu rekodi snapshot mpya kama kuwa kurudia ya data na metadata ndani ya kiasi. Pamoja na ng'ombe, mabadiliko yanapofanyika, data snapshot wa anakaa intact, na mtazamo thabiti wa hali ya mfumo wa faili kwa wakati snapshot lilifanywa vinaweza kuendelezwa.

rafiki mpya

Pamoja na hapo juu katika akili, hasa kama Ubuntu imefanya btrfs inapatikana kama chaguo-kufunga wakati, I figured itakuwa wakati mzuri wa kupiga mbizi katika btrfs na kuchunguza kidogo. 🙂

Sehemu 2 kuja hivi karibuni …

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

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

Kushiriki
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. Katika kesi yangu, 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 si 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, hapa. 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” na “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. 🙂

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

Kushiriki