Tag-Archive for » linux «

nedjelja, 4. avgust, 2013 | Author:

Imao sam nestanka struje uticati na moj server velikoj MD RAID mnoštvo. Radije nego da je server u cjelini biti dole dok se čeka da završe fsck, Imao sam ga pokrenuti bez velikog niza tako da sam mogao ručno pokrenuti fsck.

kako god, kada radi ručno Shvatio sam da sam mogao znati koliko je to bilo i koliko bi vremena bilo potrebno da završi. Ovo je posebno problematično sa tako veliki niz. Uz malo traženja našao sam vrh dodajući -C parametar prilikom pozivanja fsck. Nisam mogao pronaći ovo u dokumentaciji, međutim: fsck –pomoć nije pokazao takav opcija.

Opcija se ispostavi da je ext4 specifične, i na taj način pokazuje savršeno funkcionalni napredak bar s indikatorom postotak. Da biste pronašli informacije, umjesto “fsck –pomoći” ili “man fsck”, morate unos “fsck.ext4 –pomoći” ili “man fsck.ext4”. 🙂

udio
nedjelja, 4. avgust, 2013 | Author:

istorija

Mnogo se promenio od kada sam zadnji spomenuo moje lični server – ona je porasla za skokovi i granice (ona sada ima 7TB MD RAID6) i da je nedavno obnovljena s ubuntu server.

svod nikada nije bila greška. Arch Linux me je već naučio puno o Linuxu (i da će nastaviti da to učine na moje druge desktop). Ali Arch definitivno zahtijeva više vremena i pažnje nego što bih provesti na serveru. U idealnom slučaju Radije bih da mogu da zaborave na server za neko vrijeme dok se podsjetnik e-mail kaže “a … postoji nekoliko ažuriranja bi trebalo da pogledate, druže.”

Prostor nije besplatan – a nije ni prostor

Priliku da migriraju u Ubuntu bila je činjenica da sam ostao bez SATA portovi, portove potrebne za povezivanje hard diskova na ostatak računara – da 7TB RAID koristi mnogo luka! Ja sam čak i dao mi oduzeti vrlo stara 200GB hard disk, jer je jedan od tih portova. Takođe sam upozorio primaoca da je diska SMART praćenje ukazuje da je nepouzdan. Kao privremeno rešenje na nedostatak SATA portova, Ja sam čak migrirali OS servera na set od četiri USB štapića u MD RAID1. lud. Znam. Nisam bio previše zadovoljan o brzini. Odlučio sam da odem i kupim novi pouzdan hard disk i SATA proširenje karticu koja ide uz njega.

primarni Arch particije poslužitelja je koristio oko 7GB disk. A veliki komad koji je bio razmjena fajl, keširane podataka i inače razni ili nepotrebnih datoteka. Sve u svemu stvarnoj veličini OS, uključujući /Dom folder, bio je samo oko 2GB. To me je zatraženo da pogledam u super-brze SSD pogon, misleći možda jedan manji ne može biti tako skupo. Ispostavilo se da je najjeftiniji non-SSD sam mogao da nađem zapravo trošak više od jedne od tih relativno malih SSD-ove. Yay za mene. 🙂

izbor? woah?!

U odabiru OS, Već sam odlučio da ne bi bilo Arch. Od svih drugih popularnih distribucija, Ja sam najviše upoznat sa Ubuntu i CentOS. fedora je i mogućnost – ali nisam ozbiljno još smatra da je za server. Ubuntu je osvojio krug.

Narednih odluka koju sam morao napraviti nije mi palo na pamet dok sveprisutnost (čarobnjak za instalaciju Ubuntu) pitao je mene: Kako podesiti particija.

Bio sam novi u pomoću SSD-u Linux – Ja sam dobro svjestan zamke da ih pravilno koristi, uglavnom zbog opasnosti od siromašnih dugovječnosti ako zloupotrebljava.

Nisam želite koristiti namjenski swap particije. Planiram na unapređenju matične ploče / CPU / memorija servera ne previše daleko u budućnost. Na osnovu toga sam odlučio da ću staviti swap u swap datoteku na postojećim MD RAID. Swap neće biti posebno brzo, ali njegova jedina svrha će biti za to rijetke prilike kada nešto je krenulo naopako, a memorija nije dostupna.

To me onda ostavio da daju root path punu 60GB iz neke Intel 330 SSD. Smatrao sam razdvajanja / kuće, ali činilo mi se malo besmislena, s obzirom koliko malo je korišten u prošlosti. Prvi put sam postaviti particije s LVM – nešto što sam nedavno radila kad god sam postaviti Linux box (stvarno, nema izgovora da ne koristi LVM). Kada je došao do dijela gdje bih konfigurirati filesystem, kliknuo sam padajući i instinktivno odabrana ext4. Onda sam primijetio btrfs na istoj listi. Drži se!!

Ali ono što?

Btrfs (“maslac-ef-ess”, “bolje eff-ess”, “bee-tree-eff-ess”, ili kako god se sviđa na dan) je relativno novi datotečni sustav razvijen kako bi se donijeti Linux’ filesystem mogućnosti vratiti na pravi put sa sadašnjim fajl sistem tech. Postojeći King-of-the-Hill datotečni sustav, “lokal” (trenutnu verziju pod nazivom ext4) je prilično dobar – ali je ograničen, zaglavi u staroj paradigmi (mislim na potpuno novi F22 Raptor vs. an F4 Phantom sa pokušaj pola Ještěd na nadogradnju ekvivalencije) i teško da će biti u mogućnosti da se natječu za dugo novijim datotečnih sustava Enterprise, kao što su Oracle ZFS. Btrfs još uvijek ima dug put i još uvijek smatra eksperimentalnim (u zavisnosti od toga koga pitate i šta ima ti treba). Mnogi smatraju da je to stabilna za osnovnu upotrebu – ali niko neće da bilo kakve garancije. i, naravno, svi govore da bi i test backup!

Mooooooo

Najosnovnijih razlika između lokal i btrfs je da btrfs je “CoW” ili “Kopiju na Write” sistem podataka. To znači da se podaci nikad nije namjerno prepisuju unutarnji datotečnog sustava je. Ako napišete promjene u datoteku, btrfs će pisati promjene na novu lokaciju na fizičkim medijima i da će ažurirati interne pokazivači da se odnosi na novu lokaciju. Btrfs ide korak dalje u tom te interne pokazivači (nazivaju metapodataka) su takođe CoW. Starije verzije lokal bi jednostavno prepisani podaci. Ext4 će koristiti Journal kako bi se osiguralo da se korupcija neće doći ukoliko AC utikač se izvuče najviše nezgodan trenutak. Časopis rezultira sličan broj koraka potrebnih za ažuriranje podataka. Sa SSD, hardver osnovi vodi sličan proces CoW bez obzira na datotečni sustav koji koristite. To je zato što SSD diskova ne može zapravo prepisati podatke – oni imaju za kopiranje podataka (sa svojim promjenama) na novu lokaciju, a zatim izbrisati stare blok u potpunosti. Optimizacije u ovoj oblasti je da je SSD možda i nije izbrisati stare blok nego samo da napomenem za brisanje bloka kasnije kada stvari nisu toliko zauzeti. Krajnji rezultat je da SSD uklapaju vrlo dobro sa kravu datotečni sustav i ne obavljaju, kao i sa ne-CoW sisteme datoteka.

Da bi stvar bila zanimljiva, CoW u filesystem lako ide ruku pod ruku sa funkciju koja se zove deduplikacijom. Ovo omogućava dva (ili više) identične blokove podataka koji se čuvaju koristeći samo jedan primjerak, uštedu prostora. kravljeg, ako je deduplikaciju datoteka izmijenjena, odvojeni blizanac neće uticati i podaci o modifikovana datoteka će su napisane u različitim fizičkim blok.

CoW zauzvrat marke snapshotting relativno lako sprovesti. Kada se snimak sistem samo snima novi snimak kao dupliranje svih podataka i metapodataka u obimu. kravljeg, kada su napravljene promjene, podataka snapshot-a ostaje netaknuta, i konzistentan obzirom na status fajlsistema je u vrijeme kada je napravio snimak može održavati.

Novi prijatelj

Uz gore na umu, pogotovo što Ubuntu je napravio btrfs dostupan kao install-put opcija, Mislio sam da bi bilo dobro vrijeme da zaroni u btrfs i istražiti malo. 🙂

Dio 2 uskoro dolazi …

udio
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. U mom slučaju, 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 ne 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, ovdje. 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”; [Nlokal] -> “Install from a list or a specific location (Advanced)”; [Nlokal] -> “Don’t search. I will choose the driver to install.”; [Nlokal] -> [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 [Nlokal]. When the warning

appears, click [Yes]. Another warning will pop up regarding a similar issue (these are theunsigned” i “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. 🙂

udio
Wednesday, April 22nd, 2009 | Author:

svod 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 jogurt 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.

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

udio
kategorija: linux  | Oznake: , , , , , , ,  | Ostavite komentar