Unix/Linux basics 0110 - Partitioning, FS, LVM, RAID Operating systems lab Gergely Windisch room 4.12

Slides:



Advertisements
Hasonló előadás
Winnie the pooh & friends
Advertisements

Module 10: Supporting Remote Users távoli felhasználó támogatása.
Mintacím szerkesztése •Mintaszöveg szerkesztése •Második szint •Harmadik szint •Negyedik szint •Ötödik szint D modelling in the terrestrial.
Module 4: Lemezek kezelése. Áttekintés  Munka a lemezkezelővel  Munka alapvető lemezekkel  Munka dinamikus lemezekkel  Lemezek előkészítése Windows.
Készítette: Pető László
„Songlish” How not to be a „Bicky Chewnigh”. Lehet zöld az ég…
Számold meg a fekete pontokat!
LINUX/UNIX PARANCSOK.
A Windows 7 automatizált telepítése Windows AIK használatával
Pásztor György Szegedi Egyetemi Könyvtár OpenVZ vs. VServer.
Lemezkezelés, RAID, partícionálás, formázás, defragmentálás
Az AIX operációs rendszer
Ellenőrző kérdések a)Auto-indexing enabled b)Auto-indexing disabled c)Nem eldönthető 1.
Kliensoldali Programozás
Virtualizáció Számítógép architektúrák I. Gyakorlat Radó János.
Virtualizáció Számítógép architektúrák I. Gyakorlat Radó János.
Filerendszerek Mi a filerendszer? Fat és NTFS alapvető jellemzői
Module 5: Configuring and Managing File Systems Fájl rendszer alakítása és kezelése.
Module 6: Troubleshooting the Boot Process and Other System Issues Hibaelhárítás a rendszerbetöltő folyamatban és más rendszer kiadásban.
Állománykezelők és optikai elven működő háttértárak.
Felhasználók és jogosultságok
Linux nemcsak a 13.ht-számára.
ORACLE ORDBMS adminisztrációs feladatok 3. rész dr. Kovács László 2004.
Adatbázis-kezelés Tarcsi Ádám január. 15. MySQL és PHP.
Microsoft Windows Win2000 telepítési folyamata.
A varázslat világába lépsz be... Enter the world of magic …
Telepítés és eltávolítás Miért nem elég felmásolni? –Felhasználó akaratától függő komponensek (nem kell feltétlenül minden, esetleg választási alternatívák)
4/1/2015 Cloud computing Dr. Bakonyi Péter.. 4/1/2015Cloud computing 2 Cloud definició A cloud vagy felhő egy platform vagy infrastruktúra Az alkalmazások.
From eco-efficiency to sustainable production Maria Csutora Pietro Bertazzi The workshop is based on research done in the HU-0056 “Sustainable consumption,
Winnie the pooh & friends
WLAN Biztonság Rádiusz hitelesítés Radius autentikáció
„Tisztább kép” – együttműködési program Az új szintetikus drogok feltérképezéséért 2 nd European Workshop – ’Breaking the Drug Cycle’ project Budapest,
2009.IV.30.Argumentation techniques 1 Non-mirrorable argumentation techniques in English Analysis of theological texts aiming persuasion effects László.
Kiss Tibor System Administrator (MCP) ISA Server 2006.
 Presentation for our collegues regarding meeting in Greece  Journalist from HVG (Weekly World Economy) visited our school  Visit at the Budapest Zoo.
JAX-RS: JAVA API FOR RESTFUL WEB SERVICES. REST ARCHITEKTÚRÁJÚ WEBSZOLGÁLTATÁSOK LÉTREHOZÁSÁRA HASZNÁLJUK. AZ 1.1-ES VERZIÓTÓL KEZDVE A JAX-RS HIVATALOS.
Maven és Ant Build eszközök bemutatása
Farkas Bálint | Technical Evangelist | Microsoft
„Animal Integration in the Educational Programme „ZORO”
“Tudásmegosztás és szervezeti problémamegoldás a mesterséges intelligencia korában” Levente Szabados Technológiai Igazgató.
ResearcherID bemutatása
Test Automation Kurzus Intro
"Shoes on the Danube Bank”
XDSL hálózatok tervezése 9. Előadás
Kutatási célú szakmai ösztöndíj beszámoló
Miklós Kóbor Department of Geophysics & Space Sciences,
FAZEKAS ANDRÁS ISTVÁN PhD c. egyetemi docens
Blockchain…de mi hajtja?
FELSŐNYÉK, MAGYARORSZÁG
„Animal Integration in the Educational Programme „ZORO”
Lívia Vasas, PhD 2018 Disszertációk Lívia Vasas, PhD 2018.
Vasas Lívia, PhD 2017 DART-Europe E-theses Portal European Portal for the discovery.
Túlfeszültség védelem a hálózaton
Egy lekérdezés végrehajtása
„Agilis-e vagy?” – egy váltókezelő naplója
HWSW Meetup – Felhő és ami mögötte van
Microsoft SQL licenselés a gyakorlatban
Csurgalékvíz tisztítás
egyetemi docens, tanszékvezető, KJE
Egy lekérdezés végrehajtása
Egy lekérdezés végrehajtása
„Networking and participation – for the more effective representation of the interest of people experiencing poverty Getting funding from the European.
Lívia Vasas, PhD 2019 Disszertációk Lívia Vasas, PhD 2019.
Számold meg a fekete pontokat!
Lívia Vasas, PhD 2018 Disszertációk Lívia Vasas, PhD 2018.
Public relation at our school
A sas törénete… A bemutatót készítette: Mike
What’s new in Java 2019 Tömösvári Imre
This table is avarage! Read instructions below!
Vasas Lívia Dart Europe European Portal for the discovery of Electronic Theses and Dissertations (ETDs), and they participate in advocacy.
Előadás másolata:

Unix/Linux basics Partitioning, FS, LVM, RAID Operating systems lab Gergely Windisch room

Hacking lost root password exercise We have a linux machine that has some problems. It won't boot. The system installed on it is very important, it needs to be recovered. All the passwords are forgotten Exercise: – Start the system – Mend GRUB so that it can start automatically – Change the GRUB admin password to rootpw. – Change the root user's password to rootpw Hints – There's a floppy disk in the drive – To make changes, the / partition needs to be remounted as rw – /etc/fstab holds the name of the root partition – name of the kernel: linux24 Good luck!

Exercise hints hintek Állítsuk be a BIOSban, hogy bootoljon floppyról. grub prompton: Keressük meg a root devicét Keressük meg a kernelt! (Fájnévkiegészítés megy (TAB)) Keressük ki, hogy mi a root fájlrendszer neve linuxban - /etc/fstab fájl A fájlrendszer most még read-only, újra kell mountolni rwnek: mount -o remount,rw / Szerkeszteni kell a /boot/grub/menu.lst -t: passwd root passwd dsluser (talán ez a neve)

Exercise solution "Elfelejtett" jelszavak (ezek nem kellenek a megoldáshoz) – root: elfelejt – dsluser: dslaaa – grub jelszó: elfelejt Visszaállítás lépései – Állítsuk be a BIOSban, hogy bootoljon floppyról. bootgrubimg.img nevű image betöltődik, egy üres grubot tartalmaz – grub prompton: find /sbin/init - root devicét megkeressük – root (hd0,1) - vagy amit az előző parancs adott – Keressük meg a kernelt! asd /boot (TAB), nálunk linux24 – Keressük ki, hogy mi a root fájlrendszer neve linuxban cat /etc/fstab - és itt nézzük meg, hogy mi van a / mellett. (/dev/hda2) – Grub parancs: kernel /boot/linux24 root=/dev/hda2 init=/bin/bash a single nem megy, mivel az is jelszavazott. init=/bin/bash szükséges – A fájlrendszer most még read-only, újra kell mountolni rwnek: mount -o remount,rw / – Szerkeszteni kell a /boot/grub/menu.lst -t: vim /boot/grub/menu.lst - módosítsunk Írjuk át a DSL bejegyzést a jó kernelfájlra és a jó meghajtónévre Írjuk át a jelszót, ehhez md5sum segítségével generálhatunk jelszót (vagy jelszó nélkül is mehet) – passwd root – passwd dsluser (talán ez a neve)

Hard disks (reminder) Az ábrák nagy szeretettel lopva innen:

Tracks,sectors,cylinders

Partitions Filesystems are created on partitions (at least one) In the beginning: 4 partition / disk 15 partition/disk using extended partitions

MBR First sector of HDD Contains – Bootloader – Partition table

Limits of MBR Legacy system - always updated (=hacked) – 4 primary partitions – can have 15 with extended partitions – addresses: 24 bits (CHS), later 32 bits (LBA) – CHS: 8 GB limit - sometimes even today (boot) – LBA: 32 bit address --> maximum disk capacity: 2 Terabyte Seagate 2000GB-s lemez 59e Ft áfával – MBR stored in only one sector - prone to dataloss

GUID Partition Table (GPT) Intel: Extended Firmware Interface (EFI) – To get rid of the BIOS GTP properties – only LBA addressing – 64 bit pointers zettabyte (9.4*10^21) – 128 partitions (all primary) – GTP data structure is stored at multiple locations - more secure – important parts are CRCd – partitions can have names

GPT layout

GPT support Not everyone supports it yet, so don't depend on it – Hibrid MBR -

Disk management in linux hard disk – IDE disks: hd /dev/hda /dev/hdb … – SCSI disks: sd (sata as well) /dev/sda /dev/sdb

Partitions hdaX, where X: (128) sdaX

Partitioning scheme Desktop computer

Partitioning scheme (2) Server computer – boot – root – swap – home – var – usr – tmp /home, /usr can also be a network drive – available from every machine

Drive management Get free disk space: df Space occupied by directory: du Hard disk info: fdisk Mount drives: mount Unmount drives: umount

df: disk free $ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/md % / $ df -h -T Filesystem Type Size Used Avail Use% Mounted on /dev/md2 xfs 4.7G 775M 3.9G 17% / df -hT Filesystem Type Size Used Avail Use% Mounted on /dev/md2 xfs 4.7G 786M 3.9G 17% / /dev/md0 ext2 145M 7.2M 130M 6% /boot atlas:/mnt/BIG nfs 465G 306G 160G 66% /.automount/atlas/root/mnt/BIG //surtr/Files smbfs 254G 140G 115G 55% /mnt/Files

du: disk utilization $ du svn/ports svn/ports/vnstat/.svn 48 svn/ports/vnstat 6248 svn/ports $ du -sh svn/ports 6.2M svn/ports Switches: s: summarize h: human readable --max-depth=1

Partition types under linux ext2 - exists since – ext3 - journaling version of ext2 – file operations go into the journal. – in case of a system failure, the system knows where to look for inconsistencies. – (Which is good because there is no need for a full system check - the computer can boot faster. Part of the kernel since

File systems(2) ext4 - Extended version of ext3. – More files in directories – more secure journaling (crc) – nanoseconds in time stamps ReiserFS – V3 Journaling Optimized for small files (store database natively) – V4: Upgrade to ReiserFS. – Development is uncertain.

File systems (3) BTRFS – New generation file system for linux – Similar to Sun ZFS – pools, snapshots, crc, resizability, etc. – online filesystem check – available in the testing branch since promised to be ready by the end of 2008 – It is said to be the future - ext4 is just a temporary solution

Filesystem creation fdisk -l : check which disks are available partitioning tools – fdisk – cfdisk – parted – gparted – gui tools

Gparted

Exercise Create a bunch of disks on SuSE (4 of them) Make it ready for use using the tools sdb: keep it in one part, reiserfs sdc: split it to three parts, create two filesystems for the first two, leave the third untouched – use a different tool to create a filesystem on the third sdd: create an ntfs partition (used by windows) – resize it with gparted (if available), split it, create filesystems on it

mount, umount The file systems need to be attached to be used (hdds, CDs, floppys) They need to be removed after use attach disk: mount – Attached fs goes into the / file system Layout of physical disks is hidden mount -o remount,rw / - RW mód

mount usage What are the currently mounted disks? – mount Mount a disk – mount -t ext3 /dev/sdb1 /mnt/backuphd umount /mnt/backuphd Attached fs hides previous content mount -t ext3 /dev/sdb1 /mnt/backuphd mount -t ext3 /dev/sdc1 /mnt/backuphd

Remount read-only filesystem as rw: – mount -t / -o remount -o rw Mount CD image – mount -t auto Britney.iso /home/hallgato/Britni -o loop

Automatic mounting Currently mounted volumes – /etc/mtab Volumes to be mounted – /etc/fstab He who is not present in fstab needs to be mounted manually He who is, doesn't – or can be mounted easier

fstab layout #device mount point file system options dump check /dev/hda1 / reiserfs defaults 0 1 /dev/hdb1 /home ext2 auto,notail 1 1 /dev/hdc /mnt/cdrom iso9660 defaults 0 0 /dev/hdd /mnt/dvdrw iso9660 ro,users,noauto 0 0 /dev/sda1 /usr reiserfs ro, owner 0 1 /dev/fd0 /mnt/floppy auto user 0 0 /dev/hda5 swap swap defaults 0 0 host:/var /root/var nfs uid=0,gid=0 1 0 proc /proc proc proc defaults 0 0

Fstab options Opciók: auto: bootláskor automatikus csatlakoztatás noauto: nem csatlakozik magától (de nem kell mindenét megadni) owner: csak root és a tulajdonos mountolhatja user: bármelyik felhasználó mountolhat, csak root és a tulaj umountolhat users: umount is mehet bárkinek ro: csak olvasás defaults: alapértelmezett opciók uid=x: x felhasználó lesz a csatolt fájlok tulajdonosa gid=x: x csoport lesz a csatolt fájlok tulajdonosa noexec: a fájlrendszer fájljai nem futtathatóak

Fstab options auto: automount at boot noauto: won't boot automatically (de nem kell mindenét megadni) owner: only root and the owner can mount it user: every user can mount, only root can unmount users: every user can mount and unmount ro: read only defaults: default options uid=x: set the owner of the files on the volume gid=x: set the group owner of the files on the volume noexec: the files cannot be executed

Exercise Put your newly created filesystems in fstab All but the last should be mounted automatically One should only be readable The last one should be rw, but should not be mounted automatically. Every user needs to be able to mount it. Create a symbolic link in the users home directories that point to the new drives Extra exercise: create a script that creates symbolic links to all the drives in each and every user's home directory. – The program should take a look at the available users and their home directories

Exercise (optional) Move the /home directory to another disk Resize the / partition Use the newly freed space to create a swap partition

LVM Logical Volume Management – Virtual space on disks PE: Physical extent

Properties of LVM Pros – More flexible – can be resized easier – somewhat independent of hdd structure Filesystems can span across multiple disks Cons – Disaster recovery is hard – online resizing is not possible

Creating LVM Try under SUSE. Try resizing it

RAID Redundant Array of Inexpensive Disks Use multiple disks – Performance: RAID0 – Data security: RAID1 – Security + disk space: RAID5

RAID 0 - Striping Data is split between the disks Combined disk space equals the sum of the parts Quite fast Quite dangerous (one disk fails - no data) Data: – 1st disk: 1101 – 2nd disk: 1000

RAID 1 - mirror All the data is present on all the disks Combined disk space = size of smallest disk Slow write Quick read Safe

RAID5 At least three disks data on 2, checksum (XOR) on the third for example: – Disk A 1st byte: data 1 – Disk B 1st byte: data 2 – Disk C 1st byte: checksum Either one fails - no problem

Further RAID variants RAID6: 2 checksum disks - can survive 2 bad hdd RAID0+1: 4 hdd-s: striped and mirrored

OpenSolaris file management Disk names – /dev/dsk - filesystem level access – /dev/rdsk - raw data access