Unix/Linux. Dariusz Żbik



Similar documents
Setup software RAID1 array on running CentOS 6.3 using mdadm. (Multiple Device Administrator) 1. Gather information about current system.

Logical Volume Management for Linux on System z

Managing Data Protection

Mastering Linux. 6 Devices 7 The /proc File System 8 Linux System Calls 9 Inline Assembly Code 10 Security 11 A Sample GNU/Linux Application

The Logical Volume Manager (LVM)

Root-on-LVM-on-RAID HOWTO

Recovering Data from Windows Systems by Using Linux

Linux Template Creation Guide. How to build your own Linux VM templates for deployment in Cloudturk.

Abstract. Microsoft Corporation Published: August 2009

Storage benchmarking cookbook

Integrity Virtual Machines Technical Overview

USB 2.0 Flash Drive User Manual

How To Manage Your Volume On Linux (Evms) On A Windows Box (Amd64) On A Raspberry Powerbook (Amd32) On An Ubuntu Box (Aes) On Linux

Unix/Linux Forensics 1

VIA Fedora Linux Core 8 (x86&x86_64) VT8237R/VT8237A/VT8237S/VT8251/CX700/VX800 V-RAID V3.10 Driver Installation Guide

SecureDoc Linux , February 2010 Copyright by WinMagic Inc.

How you configure Iscsi target using starwind free Nas software & configure Iscsi initiator on Oracle Linux 6.4

Shared Storage Setup with System Automation

TELE 301 Lecture 7: Linux/Unix file

LVM2 data recovery. Milan Brož LinuxAlt 2009, Brno

Converting Linux and Windows Physical and Virtual Machines to Oracle VM Virtual Machines. An Oracle Technical White Paper December 2008

Backtrack 4 Bootable USB Thumb Drive with Full Disk Encryption

Private Server and Physical Server Backup and Restoration:

README.TXT

Linux System Administration. Paul Cobbaut

A Bootable Embedded-Linux USB Flash Drive HOWTO By: Wiwat Tara, March 22, 2005

Enterprise Storage Management with Red Hat Enterprise Linux for Reduced TCO. Dave Wysochanski

Creating a Cray System Management Workstation (SMW) Bootable Backup Drive

Ubuntu bit + 64 bit Server Software RAID Recovery and Troubleshooting.

LBNC and IBM Corporation Document: LBNC-Install.doc Date: Path: D:\Doc\EPFL\LNBC\LBNC-Install.doc Version: V1.0

1. Dynamic management of DASD devices in Linux running on zseries. 3. Linux on IBM zseries: Configuring gcc as a cross-compiler

iscsi Performance Factors

Storage Fusion Architecture. Multipath (v1.8) User Guide

Linux Software Raid. Aug Mark A. Davis

Adaptec ASR-7805/ASR-7805Q/ASR-71605/ASR-71605Q/ASR-71605E/ASR-71685/ASR SAS/SATA RAID Controllers AFM-700 Flash Backup Unit

Support for Storage Volumes Greater than 2TB Using Standard Operating System Functionality

These application notes are intended to be a guide to implement features or extend the features of the Elastix IP PBX system.

How to Install Windows on Xen TM 3.0

Chip Coldwell Senior Software Engineer, Red Hat

Configuring Linux to Enable Multipath I/O

When Good Disks Go Bad: Dealing with Disk Failures Under LVM

What is involved in input/output? How does the operating system manage I/O?

Linux Questions and Answers

Recovering Data from Windows Systems by Using Linux

NAStorage. Administrator Guide. Security Policy Of NAStorage Under UNIX/LINUX Environment

Allion Ingrasys Europe. NAStorage. Security policy under a UNIX/LINUX environment. Version 2.01

Installing IBM Websphere Application Server 7 and 8 on OS4 Enterprise Linux

USTM16 Linux System Administration

Installing Debian with SATA based RAID

Installing a USB external hard drive backup (Linux)

Typing some stupidities in text files, databases or whatever, where does it fit? why does it fit there, and how do you access there?

Linux System Administration

Analysis One Code Desc. Transaction Amount. Fiscal Period

Install Solaris on Oracle Virtual Box:

Hacking Linux-Powered Devices. Stefan Arentz

Creating a Disk Drive For Linux

Linux System Administration. Paul Cobbaut

Support Notes for SUSE LINUX Enterprise Server 9 Service Pack 3 for the Intel Itanium 2 Processor Family

Total Backup Recovery Server for Linux. User s Guide

How To Align A File System In Virtual Environments

Abstract. Microsoft Corporation Published: December 2009

Linux Boot Loaders Compared

Linux System Recovery Guide. Version 7.1

Intel Rapid Storage Technology enterprise (Intel RSTe) for Linux OS

System administration basics

Cloning Complex Linux Servers

EXPLORING LINUX KERNEL: THE EASY WAY!

Abstract. Microsoft Corporation Published: November 2011

10 Red Hat Linux Tips and Tricks

Chapter 5. Backing Up and Restoring TiVo Data

Proceedings of the Linux Symposium

Linux Recovery Utility for HP Integrity Servers

V2P2 and DigiBESS: case studies of open IT infrastructures for Islandora devel and production

======================================================= Tools to wipe out unwanted data: =======================================================

Chapter 8: Installing Linux The Complete Guide To Linux System Administration Modified by M. L. Malone, 11/05

Building a diskless Linux Cluster for high performance computations from a standard Linux distribution

The Linux System Administrator's Guide

Raidtec CS3102 Release Notes

On Disk Encryption with Red Hat Enterprise Linux

Add Disk Space to a VM when a Partition is Full

System Administration

Quick Setup Guide RAID Array 8000/ESA12000 Fibre Channel Storage Subsystem for Hewlett Packard HP-UX

Matrix 510/520 User Guide

File System & Device Drive. Overview of Mass Storage Structure. Moving head Disk Mechanism. HDD Pictures 11/13/2014. CS341: Operating System

BackTrack Hard Drive Installation

GNU/LINUX Forensic Case Study (ubuntu 10.04)

Data Migration Service for isr6200

Redundant Array of Inexpensive/Independent Disks. RAID 0 Disk striping (best I/O performance, no redundancy!)

Capturing a Forensic Image. By Justin C. Klein Keane <jukeane@sas.upenn.edu> 12 February, 2013

Partitioning. Files on the Hard Drive. Administration of Operating Systems DO2003. Partition = Binder with index. Write file = Insert document

Configuration Maximums VMware Infrastructure 3

How To Configure Linux On A Microsoft Ipa (Amd64) (Amd86) (Ahemper) (For Amd64) And Ipa (Amd66) (Oramd64 (Ortho)

WES 9.2 DRIVE CONFIGURATION WORKSHEET

Revision 5 - (Released April 2008) Added further definitions of RFID tag contents and testing requirements for RFID tag read range.

RECOVERING DIGITAL EVIDENCE FROM LINUX SYSTEMS

ipac-5010 User Guide + -

Booting Linux from a USB Flash Device on MPC5200 Systems David Wolfe, Infotainment, Multimedia and Telematics Division

LAE Enterprise Server Installation Guide

Transcription:

Unix/Linux Dariusz Żbik

Plan Reprezentacja urządzeń taśmy dyski, partycje Urządzenia SCSI LVM

Wszystko jest plikiem rodzaj pliku c znakowe (character) b blokowe uprawnienia właściciel grupa numer major numer minor nazwa crw rw rw 1 root root 1, 3 Feb 23 2004 /dev/null crw rw rw 1 root root 1, 5 Feb 23 2004 /dev/zero crw 1 zbik root 14, 4 Feb 23 2004 /dev/audio crw w 1 zbik tty 136, 0 Oct 18 21:19 /dev/pts/0 brw rw 1 root disk 3, 1 Feb 23 2004 /dev/hda1 brw rw 1 root disk 1, 1 Feb 23 2004 /dev/ram1 crw w w 1 root tty 0 0x000000 Oct 2 11:31 /dev/console crw rw rw 1 bin mail 3 0x000002 Oct 19 07:27 /dev/null crw rw rw 1 bin bin 159 0x000001 Mar 26 2002 /dev/ps2mouse crw w 1 darin tty 157 0x000000 Oct 18 18:15 /dev/pts/0 crw w 1 zbik tty 157 0x000001 Oct 19 07:27 /dev/pts/1 brw r 1 bin sys 31 0x014000 Mar 26 2002 /dev/dsk/c1t4d0 brw r 1 bin sys 31 0x015000 Mar 26 2002 /dev/dsk/c1t5d0 brw r 1 bin sys 31 0x022000 Mar 26 2002 /dev/dsk/c2t2d0

Jak plik się czyta i jak plik się zapisuje wersja prymitywna cat /dev/audio gzip c 4 > /dev/hda9 # zapisanie wykladu bezp. na dysk cat /dev/audio gzip c 4 > /dev/null # mniej ciekawy wykład cat /dev/hda9 gunzip c > /dev/audio # odsluchanie wykladu cat /dev/urandom > /dev/audio # wspaniala kompozycja cat /dev/hda > /dev/ttys1 # odczyt z dysku i zapis do port szeregowego cat /dev/ttys1 > /dev/hda # j.w. w druga strone cat /dev/fb > /tmp/obrazek # ekran do pliku cat /tmp/obrazek > /dev/fb # plik na ekran wersja bardziej wyrafinowana dd if=/dev/hda of=/dev/hdb bs=64m # kopia systemu 1:1 dd if=/dev/hda1 skip=10 of=/dev/hdc1 ibs=1m obs=16m # z pominieciem poczatku dd if=/dev/hda ibs=16m of=/dev/nst0 obs=32k # kopia systemu na tasme dd if=/dev/zero of=/tmp/duzyplik bs=1m count=16 # utworzenie duzego pliku zer

Inne operacje - ioctl() request MTIOCTOP argp struct mtop* /* Structure for MTIOCTOP mag tape op command: */ struct mtop { short mt_op; /* operations defined below */ int mt_count; /* how many of them */ }; mt_op: MTBSF MTBSFM int ioctl(int fd, int request, void *argp); Backward space over mt_count filemarks. Backward space over mt_count filemarks. Repositionthe tape to the EOT side of the last filemark. MTBSR Backward space over mt_count records (tape blocks). MTBSS Backward space over mt_count setmarks. MTCOMPRESSION Enable compression of tape data within the drive if mt_count is non zero and disable compression if mt_count is zero. int fd; long disksize; fd=open( /dev/hda2, O_RDONLY); ioctl(fd, BLKGETSIZE, &disksize);

Tworzenie plików urządzeń ręcznie polecenie mknod [root@ewok root]# mknod /dev/nst0 c 9 128 [root@ewok root]# chown root:disk /dev/nst0 [root@ewok root]# chmod 660 /dev/nst0 półautomatycznie polecenie MAKEDEV [root@ewok root]# cd /dev;./makedev n st0 create st0 c 9 0 root:disk 660 create st0l c 9 32 root:disk 660 create st0m c 9 64 root:disk 660 create st0a c 9 96 root:disk 660 automatycznie system plików devfs

Urządzenia znakowe crw rw rw 1 root root 1, 3 Feb 23 2004 /dev/null crw rw rw 1 root root 1, 5 Feb 23 2004 /dev/zero crw 1 zbik root 14, 4 Feb 23 2004 /dev/audio crw 1 zbik root 14, 3 Jun 7 21:56 /dev/dsp crw rw 1 root uucp 4, 64 Feb 23 2004 /dev/ttys0 crw rw 1 root uucp 4, 65 Feb 23 2004 /dev/ttys1 crw rw 1 root disk 9, 128 Feb 23 2004 /dev/nst0 crw rw 1 root disk 9, 129 Feb 23 2004 /dev/nst1 crw rw 1 root disk 9, 0 Feb 23 2004 /dev/st0 crw rw 1 root disk 9, 1 Feb 23 2004 /dev/st1 crw w 1 zbik tty 136, 0 Oct 18 21:19 /dev/pts/0 crw w 1 zbik tty 136, 1 Oct 18 16:40 /dev/pts/1 Linux HP-UX crw rw rw 1 bin mail 3 0x000002 Oct 19 07:36 /dev/null crw rw rw 2 bin bin 205 0x020000 Mar 26 2002 /dev/rmt/0m crw rw rw 2 bin bin 205 0x020080 Mar 26 2002 /dev/rmt/0mb crw rw rw 2 bin bin 205 0x020040 Mar 26 2002 /dev/rmt/0mn crw rw rw 2 bin bin 205 0x0200c0 Mar 26 2002 /dev/rmt/0mnb crw w 1 darin tty 157 0x000000 Oct 18 18:15 /dev/pts/0 crw w 1 zbik tty 157 0x000001 Oct 19 07:41 /dev/pts/1 crw rw rw 1 root root 157 0x000002 Oct 18 19:32 /dev/pts/2 crw w 1 darin tty 157 0x000003 Oct 19 07:40 /dev/pts/3 crw rw rw 1 root root 157 0x000004 Oct 18 19:00 /dev/pts/4

Urządzenia blokowe brw rw 1 root disk 3, 0 Feb 23 2004 /dev/hda brw rw 1 root disk 3, 1 Feb 23 2004 /dev/hda1 brw 31 0x014000 /dev/dsk/c1t4d0 brw rw 1 root disk 3, 2 Feb 23 2004 /dev/hda2 brw 31 0x015000 /dev/dsk/c1t5d0 brw rw 1 root disk 3, 5 Feb 23 2004 /dev/hda5 brw 31 0x016000 /dev/dsk/c1t6d0 brw rw 1 root disk 3, 6 Feb 23 2004 /dev/hda6 brw 31 0x022000 /dev/dsk/c2t2d0 brw rw 1 root disk 3, 64 Feb 23 2004 /dev/hdb crw 188 0x014000 /dev/rdsk/c1t4d0 brw rw 1 root disk 3, 65 Feb 23 2004 /dev/hdb1 crw 188 0x015000 /dev/rdsk/c1t5d0 brw rw 1 root disk 8, 0 Feb 23 2004 /dev/sda crw 188 0x016000 /dev/rdsk/c1t6d0 brw rw 1 root disk 8, 1 Feb 23 2004 /dev/sda1 crw 188 0x022000 /dev/rdsk/c2t2d0 brw rw 1 root disk 8, 2 Feb 23 2004 /dev/sda2 brw rw 1 root disk 8, 16 Feb 23 2004 /dev/sdb brw rw 1 root disk 8, 17 Feb 23 2004 /dev/sdb1 brw rw 1 root disk 43, 0 Feb 23 2004 /dev/nb0 brw rw 1 root disk 43, 1 Feb 23 2004 /dev/nb1 brw rw 1 root disk 9, 0 Feb 23 2004 /dev/md0 brw rw 1 root disk 9, 1 Feb 23 2004 /dev/md1 brw rw 1 root disk 80, 0 Feb 23 2004 /dev/i2o/hda brw rw 1 root disk 80, 1 Feb 23 2004 /dev/i2o/hda1 brw rw 1 root disk 80, 2 Feb 23 2004 /dev/i2o/hda2 brw rw 1 root disk 80, 16 Feb 23 2004 /dev/i2o/hdb brw rw 1 root disk 80, 17 Feb 23 2004 /dev/i2o/hdb1 brw rw 1 root disk 72, 0 Feb 23 2004 /dev/ida/c0d0 brw rw 1 root disk 72, 1 Feb 23 2004 /dev/ida/c0d0p1 brw rw 1 root disk 72, 2 Feb 23 2004 /dev/ida/c0d0p2

Lista urządzeń [user@host ]$ cat /proc/devices Character devices: 1 mem 4 /dev/vc/0 4 tty 4 ttys 5 /dev/tty 5 /dev/console 6 lp 7 vcs 9 st 10 misc 21 sg 29 fb 136 pts Block devices: 1 ramdisk 3 ide0 7 loop 8 sd 9 md 11 sr 253 device mapper [user@host ]$ cat /proc/misc 184 microcode 63 device mapper 1 psaux 144 nvram 135 rtc 134 apm_bios

Lista dysków/partycji [user@host ]$ cat /proc/partitions major minor #blocks name 7 0 32768 loop0 3 0 29302560 hda 3 1 16033 hda1 3 2 265072 hda2 3 3 506047 hda3 3 4 28515375 hda4 253 0 6815744 dm 0 253 1 1048576 dm 1 253 2 262144 dm 2 253 3 528384 dm 3 253 4 5242880 dm 4 253 5 4030464 dm 5 253 6 4161536 dm 6 253 7 2129920 dm 7 253 8 3735552 dm 8 253 9 258048 dm 9 8 0 127360 sda 8 1 126340 sda1

Urządzenia SCSI [user@host ]$ cat /proc/scsi/scsi Attached devices: Host: scsi0 Channel: 00 Id: 01 Lun: 00 Vendor: SEAGATE Model: ST318404LW Rev: 0006 Type: Direct Access ANSI SCSI revision: 03 Host: scsi0 Channel: 00 Id: 03 Lun: 00 Vendor: COMPAQ Model: BD036745A4 Rev: B008 Type: Direct Access ANSI SCSI revision: 02 Host: scsi1 Channel: 00 Id: 03 Lun: 00 Vendor: TANDBERG Model: MLR3 Rev: 0404 Type: Sequential Access ANSI SCSI revision: 02 Host: scsi2 Channel: 00 Id: 04 Lun: 00 Vendor: ADAPTEC Model: RAID 5 Rev: 370F Type: Direct Access ANSI SCSI revision: 02 Host: scsi4 Channel: 00 Id: 00 Lun: 00 Vendor: LG Model: CD ROM CRD 8521B Rev: 1.02 Type: CD ROM ANSI SCSI revision: 02 Host: scsi8 Channel: 00 Id: 00 Lun: 00 Vendor: SWISSBIT Model: Victorinox Rev: 1.89 Type: Direct Access ANSI SCSI revision: 02

Modyfikacja listy urządzeń SCSI [user@host ]$ echo "scsi remove single device 8 0 0 0" > /proc/scsi/scsi [user@host ]$ echo "scsi remove single device 2 0 1 0" > /proc/scsi/scsi [user@host ]$ echo "scsi add single device 2 0 1 0" > /proc/scsi/scsi

LVM - lvdisplay [root@host root]# lvdisplay m /dev/vg00/tmp Logical volume LV Name /dev/vg00/tmp VG Name vg00 LV UUID 1VasLj g0wa oav0 XAQ5 s9ne ew73 n1lor8 LV Write Access read/write LV Status available # open 1 LV Size 516.00 MB Current LE 129 Segments 2 Allocation next free (default) Read ahead sectors 0 Block device 253:3 Segments Logical extent 0 to 127: Type linear Physical volume /dev/hda4 Physical extents 1984 to 2111 Logical extent 128 to 128: Type linear Physical volume /dev/hda4 Physical extents 6887 to 6887

podkatalog /dev/vgxx [root@host root]# ls l /dev/vg00/ total 0 lrwxrwxrwx 1 root root 21 Oct 6 17:41 home > /dev/mapper/vg00 home lrwxrwxrwx 1 root root 20 Oct 6 17:41 opt > /dev/mapper/vg00 opt lrwxrwxrwx 1 root root 21 Oct 18 23:23 swap > /dev/mapper/vg00 swap lrwxrwxrwx 1 root root 20 Oct 18 23:24 tmp > /dev/mapper/vg00 tmp lrwxrwxrwx 1 root root 20 Oct 6 17:41 usr > /dev/mapper/vg00 usr lrwxrwxrwx 1 root root 20 Oct 6 17:41 var > /dev/mapper/vg00 var [root@host root]# ls l /dev/mapper/ total 0 crw 1 root root 10, 63 Oct 6 17:41 control brw 1 root root 253, 4 May 20 23:51 vg00 home brw 1 root root 253, 2 May 20 23:51 vg00 opt brw 1 root root 253, 9 May 20 23:51 vg00 swap brw 1 root root 253, 3 May 20 23:51 vg00 tmp brw 1 root root 253, 0 May 20 23:51 vg00 usr brw 1 root root 253, 1 May 20 23:51 vg00 var

Device mapper - tablice [root@host root]# dmsetup table vg00 home: 0 10485760 linear 3:4 17301888 vg00 tmp: 0 1048576 linear 3:4 16253312 vg00 tmp: 1048576 8192 linear 3:4 56418688 vg00 usr: 0 13631488 linear 3:4 384 vg00 swap: 0 516096 linear 3:4 55902592 vg00 var: 0 2097152 linear 3:4 13631872 vg00 opt: 0 524288 linear 3:4 15729024 Segments Logical extent 0 to 127: Type linear Physical volume /dev/hda4 Physical extents 1984 to 2111 Logical extent 128 to 128: Type linear Physical volume /dev/hda4 Physical extents 6887 to 6887

loopback HP character HP wszystko jest plikiem HP block Artemis scsi/scsi