User Tools

Site Tools


sles_12_update_schulung

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sles_12_update_schulung [2016/07/15 07:11] michaelsles_12_update_schulung [2021/04/24 07:40] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Übgungsaufgabe 1 (Startskripte): ======+====== Startskripte ======
  
  
Line 24: Line 24:
      
      
-====== Übung 2: chkconfig ======+====== chkconfig ======
  
  
Line 64: Line 64:
  
  
-====== Übung 3 Eigener Runlevel ======+====== Eigener Runlevel ======
  
    96  2016-07-14 11:41:38 cp -P ../rc3.d/* .    96  2016-07-14 11:41:38 cp -P ../rc3.d/* .
Line 333: Line 333:
 ext2/3/4: ext2/3/4:
   resize2fs device   resize2fs device
 +
 +  SLES12:~ # resize2fs /dev/vg02/lv201
 +  resize2fs 1.42.11 (09-Jul-2014)
 +  Filesystem at /dev/vg02/lv201 is mounted on /mnt; on-line resizing required
 +  old_desc_blocks = 1, new_desc_blocks = 2
 +  The filesystem on /dev/vg02/lv201 is now 360448 blocks long.
 +
  
 xfs: xfs:
Line 338: Line 345:
      
      
-====== LVM Übgung ======+====== LVM  ======
  
 Create Physical Volume Create Physical Volume
Line 345: Line 352:
  
  
-Create Volume Group+== Create Volume Group == 
 SLES12:~ # vgcreate vg01 /dev/sdb1 SLES12:~ # vgcreate vg01 /dev/sdb1
   Volume group "vg01" successfully created   Volume group "vg01" successfully created
 SLES12:~ # SLES12:~ #
  
-Create logical Volumes+== Create logical Volumes == 
 SLES12:~ # lvcreate -n lv101 -L 400M vg01 SLES12:~ # lvcreate -n lv101 -L 400M vg01
   Logical volume "lv101" created.   Logical volume "lv101" created.
Line 358: Line 367:
  
  
-Create additional Swap+== Create additional Swap == 
 SLES12:~ # SLES12:~ #
 SLES12:~ # mkswap /dev/vg01/lv102 SLES12:~ # mkswap /dev/vg01/lv102
Line 365: Line 375:
 SLES12:~ # SLES12:~ #
  
-Aktivate Swap+== Aktivate Swap == 
 SLES12:~ # swapon /dev/vg01/lv102 SLES12:~ # swapon /dev/vg01/lv102
 SLES12:~ # SLES12:~ #
Line 371: Line 382:
  
  
-Check if swap is aktivated+== Check if swap is aktivated == 
 SLES12:~ # swapon -s SLES12:~ # swapon -s
 Filename                                Type            Size    Used    Priority Filename                                Type            Size    Used    Priority
Line 378: Line 390:
 SLES12:~ # SLES12:~ #
  
-Erstellen eines ext3 Filesystems+== Erstellen eines ext3 Filesystems == 
 SLES12:~ # mke2fs -j /dev/vg01/lv101 SLES12:~ # mke2fs -j /dev/vg01/lv101
 mke2fs 1.42.11 (09-Jul-2014) mke2fs 1.42.11 (09-Jul-2014)
Line 391: Line 404:
 Writing superblocks and filesystem accounting information: done Writing superblocks and filesystem accounting information: done
  
-Mount formatted Filesystem, copy /usr/bin/ and "overmount" /usr/bin"+== Mount formatted Filesystem, copy /usr/bin/ and "overmount" /usr/bin" == 
 SLES12:~ # SLES12:~ #
 SLES12:~ # mount /dev/vg01/lv101 /mnt/ SLES12:~ # mount /dev/vg01/lv101 /mnt/
Line 403: Line 417:
  
  
-List the VG+== List the VG and look for free PE == 
 SLES12:~ # vgdisplay -v SLES12:~ # vgdisplay -v
     Using volume group(s) on command line.     Using volume group(s) on command line.
Line 468: Line 483:
  
 SLES12:~ # SLES12:~ #
 +
 +== Fragmentierung einer Datei ==
 +
 +SLES12:/mnt # filefrag -v services
 +Filesystem type is: ef53
 +Filesystem cylinder groups approximately 16
 +File size of services is 1263621 (309 blocks of 4096 bytes)
 + ext:     logical_offset:        physical_offset: length:   expected: flags:
 +   0:        0..      15:       1024..      1039:     16:             merged
 +   1:       16..      63:        688..       735:     48:       1040: merged
 +   2:       64..     127:        768..       831:     64:        736: merged
 +   3:      128..     255:        896..      1023:    128:        832: merged
 +   4:      256..     308:       1664..      1716:     53:       1024: last,merged,eof
 +services: 5 extents found
 +
 +====== BTRFS ======
 +
 +SLES12:/ #  mkfs.btrfs -f /dev/sdc1 /dev/sdc8
 +btrfs-progs v4.1.2+20151002
 +See http://btrfs.wiki.kernel.org for more information.
 +
 +Label:              (null)
 +UUID:               **ac33d521-eec2-4ab5-b3c9-59d661d5e2e8**
 +Node size:          16384
 +Sector size:        4096
 +Filesystem size:    3.00GiB
 +Block group profiles:
 +  Data:             RAID0           315.12MiB
 +  Metadata:         RAID1           161.56MiB
 +  System:           RAID1            12.00MiB
 +SSD detected:       no
 +Incompat features:  extref, skinny-metadata
 +Number of devices:  2
 +Devices:
 +   ID        SIZE  PATH
 +    1     2.00GiB  /dev/sdc1
 +    2     1.00GiB  /dev/sdc8
 +
 +
 +== Mounten des Filesystems via uuid ==
 +
 +
 +SLES12:/mnt # mount /dev/disk/by-uuid/da8e5d24-9f2a-431e-a3e5-b3288ba7d0dc /mnt/NEU/
 +SLES12:/mnt #
 +SLES12:/mnt/NEU # btrfs filesystem show /mnt/NEU/
 +Label: 'btfilesys'  uuid: da8e5d24-9f2a-431e-a3e5-b3288ba7d0dc
 +        Total devices 2 FS bytes used 256.00KiB
 +        devid    1 size 2.00GiB used 327.12MiB path /dev/sdc1
 +        devid    2 size 1.00GiB used 315.12MiB path /dev/sdc8
 +
 +btrfs-progs v4.1.2+20151002
 +
 +
 +SLES12:/mnt/NEU # btrfs device add -f /dev/sdc2 /mnt/NEU
 +SLES12:/mnt/NEU #
 +SLES12:/mnt/NEU #
 +SLES12:/mnt/NEU # btrfs filesystem show /mnt/NEU/
 +Label: 'btfilesys'  uuid: da8e5d24-9f2a-431e-a3e5-b3288ba7d0dc
 +        Total devices 3 FS bytes used 256.00KiB
 +        devid    1 size 2.00GiB used 327.12MiB path /dev/sdc1
 +        devid    2 size 1.00GiB used 315.12MiB path /dev/sdc8
 +        devid    3 size 2.00GiB used 0.00B path /dev/sdc2
 +
 +
 +
 +SLES12:/mnt/NEU # btrfs filesystem show /mnt/NEU
 +Label: 'btfilesys'  uuid: da8e5d24-9f2a-431e-a3e5-b3288ba7d0dc
 +        Total devices 3 FS bytes used 256.00KiB
 +        devid    1 size 2.00GiB used 327.12MiB path /dev/sdc1
 +        devid    2 size 1.00GiB used 315.12MiB path /dev/sdc8
 +        devid    3 size 2.00GiB used 0.00B path /dev/sdc2
 +
 +btrfs-progs v4.1.2+20151002
 +
 +== Testdaten auf das Filesystem kopieren ==
 +
 +SLES12:/mnt/NEU # cp -R /usr/lib/* .
 +SLES12:/mnt/NEU #
 +SLES12:/mnt/NEU #
 +SLES12:/mnt/NEU # btrfs filesystem show /mnt/NEU
 +Label: 'btfilesys'  uuid: da8e5d24-9f2a-431e-a3e5-b3288ba7d0dc
 +        Total devices 3 FS bytes used 86.88MiB
 +        devid    1 size 2.00GiB used 503.12MiB path /dev/sdc1
 +        devid    2 size 1.00GiB used 491.12MiB path /dev/sdc8
 +        devid    3 size 2.00GiB used 176.00MiB path /dev/sdc2
 +
 +btrfs-progs v4.1.2+20151002
 +
 +== Ein Volume aus dem btrfs Filesystem löschen ==
 +
 +
 +SLES12:/mnt/NEU # btrfs device delete /dev/sdc2 /mnt/NEU/
 +SLES12:/mnt/NEU #
 +SLES12:/mnt/NEU #
 +SLES12:/mnt/NEU # btrfs filesystem show /mnt/NEU
 +Label: 'btfilesys'  uuid: da8e5d24-9f2a-431e-a3e5-b3288ba7d0dc
 +        Total devices 2 FS bytes used 792.45MiB
 +        devid    1 size 2.00GiB used 647.12MiB path /dev/sdc1
 +        devid    2 size 1.00GiB used 635.12MiB path /dev/sdc8
 +
 +
 +== Reduzieren des Filesystems um 500M ==
 +
 +
 +SLES12:/mnt/NEU # btrfs filesystem resize -500M /mnt/NEU/
 +Resize '/mnt/NEU/' of '-500M'
 +SLES12:/mnt/NEU #
 +SLES12:/mnt/NEU #
 +SLES12:/mnt/NEU # btrfs filesystem show /mnt/NEU
 +Label: 'btfilesys'  uuid: da8e5d24-9f2a-431e-a3e5-b3288ba7d0dc
 +        Total devices 2 FS bytes used 792.33MiB
 +        devid    1 size 1.51GiB used 647.12MiB path /dev/sdc1
 +        devid    2 size 1.00GiB used 635.12MiB path /dev/sdc8
 +
 +
 +== Informationen über die Belegung ausgeben ==
 +
 +SLES12:/mnt/NEU # btrfs filesystem df /mnt/NEU/
 +Data, RAID0: total=947.12MiB, used=778.25MiB
 +System, RAID1: total=8.00MiB, used=16.00KiB
 +System, single: total=4.00MiB, used=0.00B
 +Metadata, RAID1: total=153.56MiB, used=14.06MiB
 +Metadata, single: total=8.00MiB, used=0.00B
 +GlobalReserve, single: total=16.00MiB, used=0.00B
 +
 +== Filesystem ausbalancieren ==
 +
 +btrfs balance start /mnt
 +btrfs balance status /mnt
 +btrfs balance cancel /mnt
 +btrfs balance pause /mnt
 +btrfs balance resume /mnt
 +
 +== Snapshots ==
 +
 +Subvolume2 unterhalb Subvolume1, wird beim snap von Subvolume1 _nicht_ mitgesnapped
 +
 +
 +SLES12:/mnt/NEU/test # btrfs subvolume snapshot /mnt/NEU/test/subvolume /mnt/NEU/test/subvolume/snap
 +Create a snapshot of '/mnt/NEU/test/subvolume' in '/mnt/NEU/test/subvolume/snap'
 +
 +SLES12:/mnt/NEU/test/subvolume # ls -lR
 +.:
 +total 4
 +drwxr-xr-x 1 root root    6 Jul 15 12:48 ordner1
 +-rw-r--r-- 1 root root** 2929** Jul 15 12:53 passwd
 +drwxr-xr-x 1 root root   26 Jul 15 12:48 snap
 +
 +./ordner1:
 +total 0
 +-rw-r--r-- 1 root root 0 Jul 15 12:48 abc
 +
 +./snap:
 +total 4
 +drwxr-xr-x 1 root root    6 Jul 15 12:48 ordner1
 +-rw-r--r-- 1 root root **1633** Jul 15 12:48 passwd
 +
 +./snap/ordner1:
 +total 0
 +-rw-r--r-- 1 root root 0 Jul 15 12:48 abc
 +
 +
 +cp --reflink
 +       --reflink[=WHEN]
 +       control clone/CoW copies. See below
 +
 +       When --reflink[=always] is specified, perform a lightweight copy, where the data blocks are copied only when modified.  If this is not possible the copy fails, or if
 +       --reflink=auto is specified, fall back to a standard copy.
 +
 +
 +
 +SLES12:/ # snapper list
 +Type   | # | Pre # | Date                     | User | Cleanup | Description           | Userdata
 +-------+---+-------+--------------------------+------+---------+-----------------------+--------------
 +single | 0 |                                | root |         | current               |
 +single | 1 |       | Tue Mar 15 12:29:47 2016 | root |         | first root filesystem |
 +single | 2 |       | Tue Mar 15 12:40:02 2016 | root | number  | after installation    | important=yes
 +pre    | 3 |       | Thu Jul 14 12:22:57 2016 | root | number  | yast firewall         |
 +post   | 4 | 3     | Thu Jul 14 12:23:18 2016 | root | number  |                       |
 +single | 5 |       | Fri Jul 15 15:03:51 2016 | root |                               |
 +
 +
 +SLES12:/ # snapper diff 3..4
 +--- /.snapshots/3/snapshot/etc/sysconfig/SuSEfirewall2  2016-03-15 12:39:22.240000500 +0100
 ++++ /.snapshots/4/snapshot/etc/sysconfig/SuSEfirewall2  2016-07-14 12:23:18.107298481 +0200
 +@@ -318,7 +318,7 @@
 + # FW_SERVICES_ACCEPT_*
 + #
 + # Example: "samba-server nfs-kernel-server"
 +-FW_CONFIGURATIONS_EXT=""
 ++FW_CONFIGURATIONS_EXT="sshd"
 +
 + ## Type:       string
 + #
 +@@ -1068,7 +1068,7 @@
 + #
 + # See also FW_SERVICES_ACCEPT_RELATED_EXT
 + #
 +-FW_LOAD_MODULES=""
 ++FW_LOAD_MODULES="nf_conntrack_netbios_ns"
 +
 + ## Type:       string
 + ## Default:
 +Binary files /.snapshots/3/snapshot/root/.local/share/gvfs-metadata/home and /.snapshots/4/snapshot/root/.local/share/gvfs-metadata/home differ
 +Binary files /.snapshots/3/snapshot/root/.local/share/gvfs-metadata/home-65f4037a.log and /.snapshots/4/snapshot/root/.local/share/gvfs-metadata/home-65f4037a.log differ
 +Binary files /.snapshots/3/snapshot/root/.local/share/gvfs-metadata/home-92bf047e.log and /.snapshots/4/snapshot/root/.local/share/gvfs-metadata/home-92bf047e.log differ
 +
 +
 +SLES12:/etc # snapper diff 6..7 /etc/resolv.conf
 +--- /.snapshots/6/snapshot/etc/resolv.conf      2016-07-15 10:04:25.000638268 +0200
 ++++ /.snapshots/7/snapshot/etc/resolv.conf      2016-07-15 15:21:40.169334418 +0200
 +@@ -17,5 +17,3 @@
 + # file and in case of a "netconfig update -f" call.
 + #
 + ### Please remove (at least) this line when you modify the file!
 +-search localdomain
 +-nameserver 192.168.24.2
 +
 +== Zurückgehen auf einen vorherigen Stand ==
 +SLES12:/etc # snapper undochange 6..7
 +create:12 modify:3 delete:0
 +
  
  
sles_12_update_schulung.1468566699.txt.gz · Last modified: 2021/04/24 07:38 (external edit)