Tag-Archive for » 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
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, April 22nd, 2009 | Author:

Upinde Linux’s installation process is documented on the Arch wiki. I recommend that persons new to Arch try the excellent Beginner’s Guide instead of the Official Arch Linux Install Guide. Though both wiki entries cover similar ground, the Beginner’s Guide gives a lot more relevant information for those new to the system. The Beginner’s Guide is aimed at desktop installation and, as I’m installing a server, I won’t be going through the installation of the graphical environment at all. Assuming that you’re following my installation, assume that I’ve followed the Beginner’s Guide right up to and including the installation of sudo. I installed the ssh daemon afterwards rather than during the initial setup however.

A few small recommendations and notes regarding installation:

  • If you can, consider using a USB memory stick for the installer and keep it handy for future installations.
  • I keep a copy of my localrepositoryof installed applications on my installer memory stick. Once installation is finished I save a bit of download and update time by copying this to the new server’s /var/cache/pacman/pkg/ folder. The repository on my desktop is typically 1.7GB
  • For the rc.conf, South African-appropriate regional settings are:
    LOCALE=en_ZA.utf8
    TIMEZONE=Africa/Johannesburg
  • I’ve set up the network very simply, according to the guide, and will be expanding on the network setup in a later post.
  • As it is for a server, my non-privileged user on the server is only part of 3 groups: wheel (for sudo), storage, and users. A desktop user will likely be in many more groups.

I prefer using an application called yaourt instead of Arch’s default package manager. Yaourt has the exact same usage syntax as pacman except that it supports a few extra options. It is actually a wrapper application in that it, in turn, uses pacman. Importantly, yaourt supports installation of applications from Arch’s AUR. The AUR is a repository of installation scripts built by Arch users for Arch users to easily install applications that are not officially supported by the main Arch repositories. Yaourt can download and install applications from AUR or the main repositories with the same command, treating the AUR asjust another repository”. Pacman unfortunately does not support this.

Again, the installation is covered in the wiki. I recommend the easy route mentioned in the wiki if you’re new at Arch. Its too much too soon to do it the hard way (also mentioned in the wiki entry).

When done, update your system by issuing the single command:

yaourt -Syu

OR

pacman -Syu

and follow the given recommendations.

Kushiriki
Saturday, March 28th, 2009 | Author:

Its amazing how much you can do by combining the small yet powerful commands Unix has available.

This little-used command, time, finally became useful today as a way to report the length of time that certain automated operations are running. In my example, I’m timing how long it takes to build the Linux kernel:

$ time rebuild-kernel26
...
couple-thousand-lines-of-scrolling-text
...
==> Finished making: kernel26 2.6.28.8-1 x86_64 (Sat Mar 28 17:19:52 SAST 2009)
real    62m21.994s
user    43m31.846s
sys     6m1.096s

Yup, that took a little over an hour to build. The values are:

  • realthe actual time elapsed while the command was running – 62 minutes
  • userthe amount of userland time the command used – 43 minutes
  • systhe amount of system time the command used – 6 minutes

(I was busy doing other things while this was happening which is why it took 62 minutes for the desktop to do (43+6=) 49 minutes-worth of work)

If you’re using the GNU version (most likely), it also gives you the option of displaying the results in a custom fashion. Mostly, this command could be useful in scripts where you need to report how long a task tookor maybe? just a geeky way to time something random. 😛

Kushiriki
Category: linux  | Tags: , , , , , , ,  | Leave a Comment