Tag-Arhiiv » ubuntu «

Pühapäev, August 04th, 2013 | Autor:

Ajalugu

Palju on muutunud, sest ma viimati mainitud minu isiklik server – see on kasvanud hüppeliselt (see on nüüd 7TB md RAID6) ja ta oli hiljuti ümberehitatud Ubuntu Server.

Kaar ei ole kunagi olnud viga. Arch Linux juba õpetas mulle nii palju Linux (ja jätkab seda teha ka minu teisi töölaual). Aga Arch kindlasti nõuab rohkem aega ja tähelepanu kui tahaksin kulutada server. Ideaalis ma eelistan, et oleks võimalik unustada server, samas kuni meeldetuletus e-posti ütleb “um … seal on paar uuendusi, mida peaks vaatama, semu.”

Ruum ei ole vaba – ja ei ole ruumi

Võimaluse rännata Ubuntu oli asjaolu, et olin otsa SATA sadamad, sadamaid vaja ühendada kõvakettad ülejäänud arvuti – et 7TB RAID massiivi kasutab palju sadamaid! Olin isegi ära antud minu väga vana 200GB kõvaketas, sest see asus üks neist sadamatest. Ma hoiatas ka vastuvõtja, et ketas SMART järelevalve märgitud oli ebausaldusväärne. Ajutine lahendus puudumise SATA porti, Mul oli isegi rännanud serveri OS komplekt neli USB pulgad md RAID1. Hull. Ma tean. Ma ei olnud liiga rahul kiirus. Ma otsustasin minna välja ja osta uus usaldusväärne kõvaketas ja SATA laiendamise kaart minna sellega.

Server esmane Arch partitsiooni kasutas umbes 7GB ketta. Suure tüki, mis oli vahetama fail, puhverdatud andmed ja muidu mitmesugused või mittevajalikud failid. Üldiselt tegelikku suurust OS, kaasa arvatud /kodu kausta, Alles umbes 2GB. See ajendas mind uurima ülikiire SSD sõitma, mõtlesin ehk väiksemat ei pruugi olla nii kallis. Selgus, et kõige odavama mitte-SSD draivi ma võiksin leida tegelikult maksma rohkem kui üks neist suhteliselt väike SSDs. Jee minu jaoks. 🙂

Valik? Woah?!

Valides OS, Ma juba otsustasin, et see ei oleks Arch. Pole kõik teised populaarsed distributsioonid, Ma olen kõige rohkem kokku puutunud Ubuntu ja CentOS. Fedora Samuti oli võimalus – aga ma ei olnud tõsiselt veel lugeda seda server. Ubuntu võitis vooru.

Järgmine otsus, mida ma pidin tegema ei juhtunud minuga, kuni Kõikjal olek (Ubuntu installiviisardi) küsis ta minult: Kuidas luua vaheseinad.

Olin uus kasutades SSDs Linux – Ma olen täiesti teadlik lõkse ei kasuta neid õigesti, peamiselt seetõttu, et nende risk halva pikaealisuse kui valesti.

Ma ei tahtnud kasutada spetsiaalne saalepartitsiooni. Kavatsen ümberehitamise serveri emaplaadi / CPU / mälu mitte liiga kauges tulevikus. Tuginedes sellele otsustasin ma panen swap sisse swap fail olemasolevate MD RAID. Swap pole eriti kiire, kuid selle ainuke eesmärk on selle harv kord, kui midagi on läinud valesti ja mälu ei ole saadaval.

See siis jättis mulle anda root path täis 60GB välja Intel 330 SSD. Pidasin eraldades / home aga see lihtsalt tundus veidi mõttetu, arvestades seda, kui vähe oli kasutatud ka varem. Ma kõigepealt luua partitsiooni LVM – midagi, mida ma olen viimasel ajal teinud, kui ma loodud Linux box (tegelikult, ei mingit vabandust mitte kasutada LVM). Kui ta sai selle osa, kus ma seadistada failisüsteemi, Napsautin rippmenüüst ja instinktiivselt valitud ext4. Siis märkasin btrfs samas nimekirjas. Kinni hoidma!!

Aga see, mida?

Btrfs (“või-eff-ess”, “parem-eff-ess”, “mesilane-tree-eff-ess”, või mis iganes teile meeldib päeval) on suhteliselt uus failisüsteem arenenud, et viia Linux’ failisüsteemi võimeid tagasi teele praegune failisüsteem tech. Olemasolevate King-of-the-Hill failisüsteemi, “ext” (praeguse versiooni nimega ext4) on päris hea – kuid see on piiratud, ummikus vana paradigma (mõtle uhiuue F22 Raptor vs. an F4 Phantom pooleleheküljelise Jested katse samaväärsuse upgrade) ja on ebatõenäoline, et oleks võimalik konkureerida väga kaua uuemate Enterprise failisüsteeme nagu Oracle'i ZFS. Btrfs on veel pikk tee käia, samuti on veel eksperimentaalne (olenevalt sellest, kes te küsite ja milliseid funktsioone sa vajad). Paljud peavad seda stabiilsena põhikasutusotstarve – kuid keegi ei kavatse teha mingeid garantiisid. Ja, muidugi, kõik on selge, et muuta ja katsetada varukoopiaid!

Mooooooo

Kõige põhilisem vahe ext ja btrfs on see, et btrfs on “Lehm” või “Kopeeri kirjutamine” failisüsteemi. See tähendab, et andmed ei ole kunagi tegelikult teadlikult kirjutatakse failisüsteemi sisemust. Kui kirjutad muutus fail, Btrfs kirjutage muutused uude infokandjale ja uuendab sisemine osuti suunata uude asukohta. Btrfs läheb sammu võrra kaugemale, et need sisemised viiteid (edaspidi metaandmed) on ka Lehm. Vanemad versioonid ext oleks lihtsalt ülekirjutatud andmete. Ext4 kasutaks Teataja tagada, et korruptsiooni ei esine peaks toitejuhe tuleb yanked välja kõige ebasobival hetkel. Ajakirja tulemused sarnased astmete arvu uuendada andmeid. Mis SSD, aluseks riistvara toimib sarnane lehma protsessi ükskõik mis failisüsteemi sa kasutad. Seda seetõttu, et SSD kõvakettad ei saa tegelikult kirjutatakse andmed – neil on andmete kopeerimiseks (oma muudatusi) uude asukohta ja seejärel kustutage vana plokk täielikult. Optimeerimise selles valdkonnas on, et SSD ei pruugi isegi kustutab vana plokk vaid lihtsalt teha märkmeid kustutada ploki hiljem kui asjad ei ole nii hõivatud. Lõpptulemus on, et SSD kettad sobivad väga hästi lehm failisüsteemi ja ei täida ka mitte-lehm failisüsteemid.

Asja teeb huvitavaks, Lehm failisüsteemi kergesti käib käsikäes koos funktsioon nimega varunduslahenduse. See võimaldab kahte (või rohkem) identsed plokid andmete salvestamise kasutades ainult ühte koopiat, säästa ruumi. Mis lehm, kui deduplicated fail muudetakse, eraldi paaris ei mõjuta, kui muudetud faili andmeid on kirjutatud, et erinevad füüsilised plokk.

Lehm omakorda muudab snapshotting suhteliselt lihtne rakendada. Kui pildi tegemise süsteem lihtsalt salvestab uue hetkeseisu nagu oleks dubleerimist kõik andmed ja metaandmed maht. Mis lehm, kui tehakse muudatusi, hetkeseisu andmed jääb puutumata, ja järjepidev ülevaade failisüsteemi seisu snapshot tehti võimalik säilitada.

Uus sõber

Mis eespool meeles, eriti kui Ubuntu on teinud btrfs saadaval install-aja valik, Ma arvasin, et oleks hea aeg sukelduda btrfs ja uurida vähe. 🙂

Osa 2 varsti …

osa
Thursday, January 01st, 2009 | Autor:

Apparently, what operating system you use can say a lot about you. If you’re using some form of *nix, mis distro you’re using can say a lot as well. Redundancy aside, I believe that a Linux distribution depends absolutely on its package management and distribution system.

I liked apt-get (1, 2) but there was some technical problem at some point and it caused me to use aptitude instead. Using aptitude is slightly easierit has more features automated into single, logical, commands where apt-get requires separate commands. Aptitude also has a curses-based GUI. If you’re not using the GUI then, other than brevity in terms of number of commands to learn, there is apparently no technical reason to prefer one over the other. Aptitude and apt-get serve K/X/Ubuntu ja Debian hästi. From this point, I use the names Kubuntu and Ubuntu in a loosely interchangeable fashion.

In my use of CentOS (based on Red Hat), I’ve found I like yum. It seems to work in much the same as aptitudeone command to rule them all. It has some rather annoying default behaviour I’m not going to get into here as its most likely because I’m just not used to it. At least from a technical perspective, it is very good. I believe that Fedora also makes use of yum though my experience with Fedora is very limited.

the theory

Fedora and Ubuntu are in a class of distributions that have a fairly rigorous release cycle. Ubuntu 8.10 (the version is named so for the year and month of its release) will not, except for major bugs and minor changes, have another major update until the next version, Jaunty Jackalope. Ubuntu users have the latest versions of most software on their desktops right now. In the months preceding the next release, however, they’re not going to be so lucky unless they like using “beeta” releases. As I’m not very familiar with Fedora, I’m not going to bother going into its release cycle.

These 2 distributions are also within a class of distributions known asbinary” või “binary-baseddistributions. This means that when you download an update, the files that are downloaded are precompiled and should run on anysupportedhardware. This isn’t specifically optimised for your desktop’s hardware, näiteks, your processor. Perhaps you have an AMD processor which has extra instruction support which Intel CPUs do not have. The reverse could also be true. For this reason, a binary-release distribution cannot optimise for one particular brand of hardware. Regardless of thisnon-optimisation”, it should run at a decent pace.

the practice!

Umbes 2 years ago I started using Kubuntu. After a few months of working with it, I started to learn more about its specifics. I’m not much of a fan of using GUI tools to update the system when, ultimately, its all happening on the command-line anyway. The GUI tools just hide the complexity I don’t mind seeing.

I ended up making a vops script, update, which would run all the steps required to get aptitude to just go ahead and upgrade already, kthx?©, perhaps stopping along the way to back up my configuration, remount the NFS network share where we keep an on-site repository, back up the local cache of aptitude’s installed packages, do some folder-link shuffling to use a local copy if the network share couldn’t remount, sync between the local copy and the network share if the previous update had a network share issue, and update lists of packages in the repository. In general, it wouldn’t go ahead if there were any errors though, as you can tell, this script became a messy beast that went above and beyond the original requirements. It worked well for me.

Until the day came to update between Kubuntu 6.10 kuni 7.04. I did this manually though, not with the script.

I ended up reinstalling from scratch as a result of the mess that ensued. At least, as a backup administrator should do well to demonstrate, it was easy to recover everything I really needed. 🙂

What else is out there?

Even before I had to reinstall Kubuntu, I was introduced to another distribution called Gentoo. There are 2 very distinct differences between Gentoo and Ubuntu’s update system. The first is that Gentoo is a source-based distribution. This means that when you update a package, the package manager downloads the source and compiles everything, hopefully optimising it for your system. This, I think, is very cool. The downside to this is that compiling everything takes a very long time.

Here are my (very unscientific) estimates for the length of time it takes to install a basic GUI OS to a desktop from installation media, excluding extraneous drivers (näiteks, the latest 3D graphics drivers):

OS: minmax (median)

Windows Vista: 15 – 30 (20) minutes

Ubuntu: 15 – 40 (20) minutes

Gentoo: 3 – 40 (6) hours

Gentoo also requires much tinkering with the config files in order to get things workingthis is another reason for the extremely long delay between inserting the CD and booting your awesome* new desktop. Popular applications have binary packages available for downloadthough this isn’t a default option.

They see me rollin

There is one more very important distinction Gentoo has from most other distributions. It is arolling-releasedistribution. This means that there isn’t any rigorous version orreleasethat the distribution adheres to. If you install Gentoo todayif you finish installing Gentoo today, you’re probably going to have the latest version of all the applications you installed. If some obscure application gets a major update tomorrow, within a few days, if you update your system, you’re going to have that latest version on your desktop.

The difference between this rolling release and theotherdistributions is rather staggering. Näiteks: If KDE 4.2 were to be released tomorrow, you’d probably have to wait less than 2 weeks for it to be available on Gentoo. Ubuntu users might have to wait till 9.04 – that’s a 4-month wait.

Something more suitable?

Personally, I’m not willing to put in the 40 hours of effort to get my system working the way I want it to. My colleague had to reinstall recently for some obscure reason and it turns out he wasn’t willing to put in the 6 hours (he’s more experienced with Gentoo) of effort to get his system back to how it was running either. Instead, Arch Linux caught his eye. Arch Linux is a rolling-release (like Gentoo), binary-based (like Ubuntu) distribution. Its packages (hästi, the vast majority of them) don’t need much tinkering with their config files to get things working nicely either. Its the best of both worlds!

You still need to know what you’re doing* but if you’ve come to this juncture, it shouldn’t be such a giant leap of faith. Arch Linux’s package manager, called pacmees, has built-in dependency and conflict handling. I use another package manager, jogurt (French for yoghurt), which has very quickly become popular with Arch users. Yaourt enhances the functionality of pacman by allowing you to download and install applications directly from the AUR, või Arch User Repository. This repository contains scripts that allow you to automatically download and install many applications that would otherwise be completely unsupported by Arch’s own core developers. It downloads and compiles the package into a chroot’d environment. It then packages the chroot’d environment into a pacman-compatible package tarball and uses pacman to deploy it into your system.

ka, the AUR supports a voting system whereby popular packages get placed into the more official [community] repository. Yaourt also supports an automated voting mechanism whereby, after installing a package via AUR, it asks if you want to vote for its inclusion in [community].

I estimate that the time taken for my Arch installation was about 90 minutes. I don’t recommend Archlinux for newbies though I do recommend it for any Linux user who’s gotten bored with other distrosand wants to get into the nitty gritty without having to install Linux From Scratch. Arch Linux has been getting pretty popular these days. Its currently at number 14 kohta Distrowatch.

* IF you know what you’re doing. AND YOU BETTER BLOODY KNOW WHAT YOU’RE DOING!
osa