Tag-Archive for » 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.

Mar sin féin, 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” nó “man fsck”, you have to inputfsck.ext4help” nó “man fsck.ext4”. 🙂

Comhroinn
Sunday, August 04th, 2013 | Author:

Stair

Bhí athrú i bhfad ó luaigh mé mo deireanach freastalaí pearsanta – tá sé tar éis fás ag Raidió Rí Rá (Tá sé anois ina 7TB md RAID6) agus bhí sé atógadh le déanaí le Ubuntu Freastalaí.

Arch Ní raibh botún. Arch Linux bhí múinte cheana féin dom an oiread sin faoi Linux (agus leanfaidh sé sin a dhéanamh ar mo dheasc eile). Ach Éilíonn Arch cinnte níos mó ama agus aird ná mar ba mhaith liom a chaitheamh ar fhreastalaí. Go hidéalach, ba mhaith liom is fearr a bheith in ann a dearmad a dhéanamh ar an bhfreastalaí ar feadh tamaill go dtí go deir r-phost meabhrúcháin “tamall de bhlianta anuas … níl nuashonruithe cúpla ba chóir duit féachaint ar, buddy.”

Níl spás saor in aisce – agus nách spás

Bhí an deis dul ar imirce chun Ubuntu an bhfíric go raibh rith mé amach as SATA calafoirt, na calafoirt is gá chun thiomáineann crua a nascadh leis an gcuid eile den ríomhaire – Úsáideann an sraith Raid 7TB a lán de na calafoirt! Bhí mé fiú a tugadh ar shiúl mo an- sean dhiosca crua 200GB mar a thóg sé suas ar cheann de na calafoirt. Rabhadh mé freisin an faighteoir go bhfuil an diosca ar SMART monatóireachta le fios go raibh sé neamhiontaofa. Mar workaround sealadach chun an easpa calafoirt SATA, Bhí mé aistríodh fiú OS an fhreastalaí le sraith de cheithre bataí USB i md RAID1. Crazy. Tá a fhios agam. Ní raibh mé ró-sásta mar gheall ar an luas. Bheartaigh mé dul amach agus a cheannach tiomáint crua iontaofa nua agus cárta leathnú SATA chun dul leis é.

Cuireadh laindéal bunscoile Arch an fhreastalaí a úsáideann thart ar 7GB de diosca. A smután mór de go raibh babhtála comhad, sonraí i dtaisce agus comhaid ilghnéitheacha eile nó nach bhfuil gá. Tríd is tríd an méid iarbhír an OS, lena n-áirítear an /baile fillteán, raibh ach thart ar 2GB. Spreag sé seo dom chun breathnú isteach i Super-tapa SSD tiomáint, ag smaoineamh b'fhéidir nach mbeadh ceann níos lú a bheith chomh costasach. Iompaigh sé amach go bhfuil an feachtas saoire neamh-SSD raibh mé in ann teacht ar iarbhír costas níos mó mó ná ceann amháin de na SSDs réasúnta beag. Yay for me. 🙂

Rogha? Woah?!

I roghnú an OS, Ba mhaith chinn mé cheana féin nach mbeadh sé Arch. Lasmuigh de na dáiltí eile tóir, Tá mé an chuid is mó eolas maidir leis Ubuntu agus CentOS. Fedora Bhí freisin an deis ann – ach ní raibh a mheas mé dáiríre fós é ar feadh freastalaí. Bhuaigh an babhta ubuntu.

An cinneadh eile a bhí mé a dhéanamh nach raibh a tharlaíonn go dom go dtí go Ubiquity (Draoi suiteála Ubuntu ar) D'iarr sé orm: Conas a chur ar bun ar an Deighiltí.

Bhí mé nua chun úsáid a bhaint as SSDs i Linux – Tá mé go maith an eolas faoi na pitfalls de nach n-úsáideann iad i gceart, den chuid is mó mar gheall ar a riosca fadsaoil bochta má mí-úsáid.

Ní raibh mé ag iarraidh úsáid a bhaint as dheighilt babhtála tiomnaithe. Plean mé ar uasghrádú an fhreastalaí motherboard / LAP / cuimhne nach bhfuil i bhfad ró-sa todhchaí. Bunaithe ar sin chinn mé go mbeidh mé babhtála i gcomhad babhtála ar an Raid md atá ann cheana féin. Ní bheidh an babhtála a bheith go háirithe go tapa ach beidh a chuspóir amháin a bheith le haghaidh an ócáid ​​annamh nuair atá rud éigin mícheart agus nach bhfuil an chuimhne atá ar fáil.

D'fhág mé ansin a thabhairt ar an cosán fhréamh an 60GB iomlán amach ar Intel 330 SSD. Mheas mé a scaradh / bhaile ach an chuma air ach beagán pointless, thabhairt ar conas is beag a úsáideadh san am atá thart. Leag mé an chéad suas an laindéal le LVM – rud éigin a bhí mé le déanaí ag déanamh aon uair a leag mé suas le bosca Linux (i ndáiríre, níl aon leithscéal gan úsáid a bhaint LVM). Nuair a fuair sé an chuid i gcás ina mbeadh liom a chumrú córas comhad, Chliceáil mé ar an anuas agus instinctively roghnaithe ext4. Ansin thug mé faoi deara btrfs ar an liosta céanna. Hang on!!

Ach cad?

Btrfs (“im-eff-CSE”, “níos fearr eff-CSE”, “bee-crann-eff-CSE”, nó is cuma cad mhaisiúil tú ar an lá) tá córas comhaid sách nua a fhorbairt chun go mbeidh Linux’ cumais córas comhad ar ais ar an rian le córas comhad reatha ardteicneolaíochta. An Rí-ar-an-Hill atá ann cheana féin córas comhad, “ext” (an leagan reatha a dtugtar ext4) Is maith go leor – ach tá teorainn léi, bhfostú i paraidím d'aois (smaoineamh ar branda nua F22 Raptor vs. le F4 Phantom le iarracht leath-jested ag uasghrádú a ghlacadh) agus is dócha a bheith in ann dul san iomaíocht le haghaidh an-fhada le córais comhaid le Fiontraíocht níos nuaí mar ZFS Oracle. Btrfs Tá fós bealach fada chun dul agus meastar é fós turgnamhach (ag brath ar cé tú ceisteanna a chur agus cad iad na gnéithe is gá duit). Go leor a mheas sé a bheith cobhsaí lena n-úsáid bhunúsach – ach tá aon duine ag dul a dhéanamh ar aon ráthaíochtaí. Agus, ar ndóigh, gach duine ag rá a dhéanamh agus a thástáil cúltacaí!

Mooooooo

Is é an difríocht is bunúsaí idir fo-líne agus btrfs go bhfuil btrfs a “Bó” nó “Cóip ar Scríobh” córas comhad. Ciallaíonn sé seo go riamh go bhfuil na sonraí iarbhír overwritten d'aon ghnó ag an córas comhad ar internals. Má scríobhann tú athrú ar comhad, Beidh btrfs scríobh do chuid athruithe go dtí suíomh nua ar mheáin fhisiciúla agus beidh cothrom le dáta an leideanna inmheánacha a tharchur chuig an suíomh nua. Btrfs a théann céim eile sa mhéid is go na leideanna inmheánacha (dá dtagraítear mar meiteashonraí) Tá freisin Bó. Bheadh ​​leaganacha níos sine de fo-líne a bheith ach overwritten na sonraí. Bheadh ​​Ext4 úsáid Iris chun a chinntiú nach mbeidh éilliú tarlú ba chóir an breiseán AC a yanked amach i láthair na huaire is inopportune. Na torthaí iris i líon céanna de céimeanna a theastaíonn chun sonraí a thabhairt cothrom le dáta. Le SSD, Feidhmíonn an crua-earraí bunúsacha próiseas bó den chineál céanna is cuma cén córas comhaid tá tú ag baint úsáide as. Tá sé seo toisc nach féidir thiomáineann SSD forscríobh iarbhír sonraí – tá siad a chóipeáil na sonraí (le do chuid athruithe) go dtí suíomh nua agus ansin scriosadh an bloc sean go hiomlán. Tá leas iomlán a bhaint sa réimse seo ná nach bhféadfadh SSD scriosadh fiú an bloc d'aois ach go simplí a dhéanamh nóta a scriosadh an bloc ag tráth níos déanaí nuair nach bhfuil rudaí chomh gnóthach. Is é an toradh deiridh go cuí thiomáineann SSD go han-mhaith le córas comhaid bó agus nach bhfuil a dhéanamh chomh maith le córais comhaid le neamh-bó.

Chun a dhéanamh cúrsaí suimiúla, Bó sa chóras comhad a théann go héasca lámh ar láimh le gné ar a dtugtar deduplication. Ligeann sé seo dhá (nó níos mó) bloic comhionann le sonraí a stóráil ag baint úsáide as ach cóip amháin, spás a shábháil. Le bó, má tá an comhad mionathraithe deduplicated, Ní bheidh na focail ar leith tionchar a bheith mar beidh an comhad a mhodhnú ar shonraí a bheith scríofa bloc éagsúla fisiciúil.

Déanann bó i ndiaidh a snapshotting réasúnta éasca a chur i bhfeidhm. Nuair a pictiúr a dhéanamh taifead ar an gcóras ach an pictiúr nua a bheith ina dúbailt na sonraí agus na meiteashonraí laistigh den toirt. Le bó, nuair a dhéantar athruithe, tréimhsí an pictiúr shonraí slán, agus is féidir d'fhonn teacht ar an córas comhaid stádas ag an am a rinneadh an pictiúr a choinneáil.

A chara nua

Leis an méid sin thuas i gcuimhne, go háirithe mar tá Ubuntu ar btrfs ar fáil mar rogha shuiteáil-am, Figured mé go mbeadh sé ina am trátha chun tumadóireacht a dheanamh i btrfs agus beagán iniúchadh. 🙂

Cuid 2 ag teacht go luath …

Comhroinn
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. I mo chás, 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 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, anseo. 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” agus “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. 🙂

Comhroinn
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. An 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.

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

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