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

Arch 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. Nan 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.

pataje
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. 😛

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