CIS 228 – UNIX System Administration

Total Page:16

File Type:pdf, Size:1020Kb

CIS 228 – UNIX System Administration CIS 228 – UNIX System Administration Lab Exercise #7: Setting up an alternate filesystem (/home). Scenario: /home is full you need to allocate a new filesystem to accommodate more user space Review TAR command (Chapter 5) 1) Run grub2-install /dev/sda to reinstall Fedora MBR (See recovery notes). 2) Remove Ubuntu partitions via fdisk 3 3) Review DMESG messages to see devices 4) Display filesystems with du, df –v, mount 5) Add diskquotas for remaining users. How? 6) Add quotaon to system startup . How? 7) Place system into single user or maintenance mode 8) Run fdisk –l to display the hardrive layout 9) Allocate a partition twice the size of current /home allocation (? To view menu). fdisk /dev/sda m n accept default starting cylinder +xxxxM …. Where xxxx is twice the size of the current /home directory p ….. to show results w to write to disk 10) Reboot? 11) Make a new filesystem: mkfs –t ext3 /dev/sdax … x is new partition # Pay attention to messages 12) make a temporary home directory /mnt/hometmp 13) mount the new filesystem under /mnt/hometmp 14) Copy the contents of /home to /mnt/hometmp using commands: cd /home cp –rp * /mnt/hometmp What do the copy command flags do? 15) Change /etc/fstab to mount /home on the new filesystem and /mnt/hometmp on the old file system 16) Reboot 17) Mount old /home partition to /mnt/hometmp 18) Backup /mnt/hometmp directory to /var/tmp using TAR 19) Restore it to /home 20) Backup current /home directory using TAR and GZIP and restore it to /mnt/hometmp Related commands: cp, du, df, fdisk, mkfs, mount, umount, CIS 228 – UNIX System Administration Lab Exercise 8: Using TAR and ZIP, other file systems Make sure you complete LAB 7 1) umount /mnt/hometmp 2) use fdisk /dev/sda to change the old /home partition type from Lab 7 to Fat32 fdisk /dev/sda m t x …. x is old /home partition l …. list partition types b …. set partition type to WIN 95 FAT32 p …. to show results w …. to write to disk 3) Reformat the old /home partition as MSDOS filesystem and call it /share mkfs –t vfat /dev/sdax … x is old /home partition Pay attention to messages 4) Backup /home using TAR and GZIP and restore it to /share. Compare results to /home using ls –al. Related commands: mkdev, mkfs, df, fdisk, du, mount, parted .
Recommended publications
  • The Linux Command Line
    The Linux Command Line Fifth Internet Edition William Shotts A LinuxCommand.org Book Copyright ©2008-2019, William E. Shotts, Jr. This work is licensed under the Creative Commons Attribution-Noncommercial-No De- rivative Works 3.0 United States License. To view a copy of this license, visit the link above or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042. A version of this book is also available in printed form, published by No Starch Press. Copies may be purchased wherever fine books are sold. No Starch Press also offers elec- tronic formats for popular e-readers. They can be reached at: https://www.nostarch.com. Linux® is the registered trademark of Linus Torvalds. All other trademarks belong to their respective owners. This book is part of the LinuxCommand.org project, a site for Linux education and advo- cacy devoted to helping users of legacy operating systems migrate into the future. You may contact the LinuxCommand.org project at http://linuxcommand.org. Release History Version Date Description 19.01A January 28, 2019 Fifth Internet Edition (Corrected TOC) 19.01 January 17, 2019 Fifth Internet Edition. 17.10 October 19, 2017 Fourth Internet Edition. 16.07 July 28, 2016 Third Internet Edition. 13.07 July 6, 2013 Second Internet Edition. 09.12 December 14, 2009 First Internet Edition. Table of Contents Introduction....................................................................................................xvi Why Use the Command Line?......................................................................................xvi
    [Show full text]
  • Filesystem Hierarchy Standard
    Filesystem Hierarchy Standard LSB Workgroup, The Linux Foundation Filesystem Hierarchy Standard LSB Workgroup, The Linux Foundation Version 3.0 Publication date March 19, 2015 Copyright © 2015 The Linux Foundation Copyright © 1994-2004 Daniel Quinlan Copyright © 2001-2004 Paul 'Rusty' Russell Copyright © 2003-2004 Christopher Yeoh Abstract This standard consists of a set of requirements and guidelines for file and directory placement under UNIX-like operating systems. The guidelines are intended to support interoperability of applications, system administration tools, development tools, and scripts as well as greater uniformity of documentation for these systems. All trademarks and copyrights are owned by their owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Permission is granted to make and distribute verbatim copies of this standard provided the copyright and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this standard under the conditions for verbatim copying, provided also that the title page is labeled as modified including a reference to the original standard, provided that information on retrieving the original standard is included, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this standard into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the copyright holder. Dedication This release is dedicated to the memory of Christopher Yeoh, a long-time friend and colleague, and one of the original editors of the FHS.
    [Show full text]
  • Oracle® Linux 7 Managing File Systems
    Oracle® Linux 7 Managing File Systems F32760-07 August 2021 Oracle Legal Notices Copyright © 2020, 2021, Oracle and/or its affiliates. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs) and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are "commercial computer software" or "commercial computer software documentation" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, reproduction, duplication, release, display, disclosure, modification, preparation of derivative works, and/or adaptation of i) Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs), ii) Oracle computer documentation and/or iii) other Oracle data, is subject to the rights and limitations specified in the license contained in the applicable contract.
    [Show full text]
  • Filesystem Considerations for Embedded Devices ELC2015 03/25/15
    Filesystem considerations for embedded devices ELC2015 03/25/15 Tristan Lelong Senior embedded software engineer Filesystem considerations ABSTRACT The goal of this presentation is to answer a question asked by several customers: which filesystem should you use within your embedded design’s eMMC/SDCard? These storage devices use a standard block interface, compatible with traditional filesystems, but constraints are not those of desktop PC environments. EXT2/3/4, BTRFS, F2FS are the first of many solutions which come to mind, but how do they all compare? Typical queries include performance, longevity, tools availability, support, and power loss robustness. This presentation will not dive into implementation details but will instead summarize provided answers with the help of various figures and meaningful test results. 2 TABLE OF CONTENTS 1. Introduction 2. Block devices 3. Available filesystems 4. Performances 5. Tools 6. Reliability 7. Conclusion Filesystem considerations ABOUT THE AUTHOR • Tristan Lelong • Embedded software engineer @ Adeneo Embedded • French, living in the Pacific northwest • Embedded software, free software, and Linux kernel enthusiast. 4 Introduction Filesystem considerations Introduction INTRODUCTION More and more embedded designs rely on smart memory chips rather than bare NAND or NOR. This presentation will start by describing: • Some context to help understand the differences between NAND and MMC • Some typical requirements found in embedded devices designs • Potential filesystems to use on MMC devices 6 Filesystem considerations Introduction INTRODUCTION Focus will then move to block filesystems. How they are supported, what feature do they advertise. To help understand how they compare, we will present some benchmarks and comparisons regarding: • Tools • Reliability • Performances 7 Block devices Filesystem considerations Block devices MMC, EMMC, SD CARD Vocabulary: • MMC: MultiMediaCard is a memory card unveiled in 1997 by SanDisk and Siemens based on NAND flash memory.
    [Show full text]
  • Outline of Ext4 File System & Ext4 Online Defragmentation Foresight
    Outline of Ext4 File System & Ext4 Online Defragmentation Foresight LinuxCon Japan/Tokyo 2010 September 28, 2010 Akira Fujita <[email protected]> NEC Software Tohoku, Ltd. Self Introduction ▐ Name: Akira Fujita Japan ▐ Company: NEC Software Tohoku, Ltd. in Sendai, Japan. Sendai ● ▐ Since 2004, I have been working at NEC Software Tohoku developing Linux file system, mainly ext3 and ● ext4 filesystems. Tokyo Currently, I work on the quality evaluation of ext4 for enterprise use, and also develop the ext4 online defragmentation. Page 2 Copyright(C) 2010 NEC Software Tohoku, Ltd. All Rights Reserved. Outline ▐ What is ext4 ▐ Ext4 features ▐ Compatibility ▐ Performance measurement ▐ Recent ext4 topics ▐ What is ext4 online defrag ▐ Relevant file defragmentation ▐ Current status / future plan Page 3 Copyright(C) 2010 NEC Software Tohoku, Ltd. All Rights Reserved. What is ext4 ▐ Ext4 is the successor of ext3 which is developed to solve performance issues and scalability bottleneck on ext3 and also provide backward compatibility with ext3. ▐ Ext4 development began in 2006. Included in stable kernel 2.6.19 as EXPERIMENTAL (ext4dev). Since kernel 2.6.28, ext4 has been released as stable (Renamed from ext4dev to ext4 in kernel 2.6.28). ▐ Maintainers Theodore Ts'o [email protected] , Andreas Dilger [email protected] ▐ ML [email protected] ▐ Ext4 Wiki http://ext4.wiki.kernel.org Page 4 Copyright(C) 2010 NEC Software Tohoku, Ltd. All Rights Reserved. Ext4 features Page 5 Copyright(C) 2010 NEC Software Tohoku, Ltd. All Rights Reserved. Ext4 features Bigger file/filesystem size support. Compared to ext3, ext4 is: 8 times larger in file size, 65536 times(!) larger in filesystem size.
    [Show full text]
  • Unix Programmer's Manual
    There is no warranty of merchantability nor any warranty of fitness for a particu!ar purpose nor any other warranty, either expressed or imp!ied, a’s to the accuracy of the enclosed m~=:crials or a~ Io ~helr ,~.ui~::~::.j!it’/ for ~ny p~rficu~ar pur~.~o~e. ~".-~--, ....-.re: " n~ I T~ ~hone Laaorator es 8ssumg$ no rO, p::::nS,-,,.:~:y ~or their use by the recipient. Furln=,, [: ’ La:::.c:,:e?o:,os ~:’urnes no ob~ja~tjon ~o furnish 6ny a~o,~,,..n~e at ~ny k:nd v,,hetsoever, or to furnish any additional jnformstjcn or documenta’tjon. UNIX PROGRAMMER’S MANUAL F~ifth ~ K. Thompson D. M. Ritchie June, 1974 Copyright:.©d972, 1973, 1974 Bell Telephone:Laboratories, Incorporated Copyright © 1972, 1973, 1974 Bell Telephone Laboratories, Incorporated This manual was set by a Graphic Systems photo- typesetter driven by the troff formatting program operating under the UNIX system. The text of the manual was prepared using the ed text editor. PREFACE to the Fifth Edition . The number of UNIX installations is now above 50, and many more are expected. None of these has exactly the same complement of hardware or software. Therefore, at any particular installa- tion, it is quite possible that this manual will give inappropriate information. The authors are grateful to L. L. Cherry, L. A. Dimino, R. C. Haight, S. C. Johnson, B. W. Ker- nighan, M. E. Lesk, and E. N. Pinson for their contributions to the system software, and to L. E. McMahon for software and for his contributions to this manual.
    [Show full text]
  • Physical Disentanglement in a Container-Based File System Lanyue Lu, Yupu Zhang, Thanh Do, Samer Al-Kiswany, Andrea C
    Physical Disentanglement in a Container-Based File System Lanyue Lu, Yupu Zhang, Thanh Do, Samer Al-Kiswany, Andrea C. Arpaci-Dusseau, and Remzi H. Arpaci-Dusseau, University of Wisconsin—Madison https://www.usenix.org/conference/osdi14/technical-sessions/presentation/lu This paper is included in the Proceedings of the 11th USENIX Symposium on Operating Systems Design and Implementation. October 6–8, 2014 • Broomfield, CO 978-1-931971-16-4 Open access to the Proceedings of the 11th USENIX Symposium on Operating Systems Design and Implementation is sponsored by USENIX. Physical Disentanglement in a Container-Based File System Lanyue Lu, Yupu Zhang, Thanh Do, Samer Al-Kiswany Andrea C. Arpaci-Dusseau, Remzi H. Arpaci-Dusseau Department of Computer Sciences University of Wisconsin, Madison {ll, yupu, thanhdo, samera, dusseau, remzi}@cs.wisc.edu Abstract ing to painful and well-documented performance prob- We introduce IceFS, a novel file system that separates lems [4, 5, 8]. physical structures of the file system. A new abstrac- The surprising entanglement found in these systems tion, the cube, is provided to enable the grouping of files arises from a central truth: logically-independent file sys- and directories inside a physically isolated container. We tem entities are not physically independent. The result is show three major benefits of cubes within IceFS: local- poor reliability, poor performance, or both. ized reaction to faults, fast recovery, and concurrent file- In this paper, we first demonstrate the root problems system updates. We demonstrate these benefits within caused by physical entanglement in current file systems. a VMware-based virtualized environment and within the For example, we show how a single disk-block failure Hadoop distributed file system.
    [Show full text]
  • The Linux Command Line
    The Linux Command Line Second Internet Edition William E. Shotts, Jr. A LinuxCommand.org Book Copyright ©2008-2013, William E. Shotts, Jr. This work is licensed under the Creative Commons Attribution-Noncommercial-No De- rivative Works 3.0 United States License. To view a copy of this license, visit the link above or send a letter to Creative Commons, 171 Second Street, Suite 300, San Fran- cisco, California, 94105, USA. Linux® is the registered trademark of Linus Torvalds. All other trademarks belong to their respective owners. This book is part of the LinuxCommand.org project, a site for Linux education and advo- cacy devoted to helping users of legacy operating systems migrate into the future. You may contact the LinuxCommand.org project at http://linuxcommand.org. This book is also available in printed form, published by No Starch Press and may be purchased wherever fine books are sold. No Starch Press also offers this book in elec- tronic formats for most popular e-readers: http://nostarch.com/tlcl.htm Release History Version Date Description 13.07 July 6, 2013 Second Internet Edition. 09.12 December 14, 2009 First Internet Edition. 09.11 November 19, 2009 Fourth draft with almost all reviewer feedback incorporated and edited through chapter 37. 09.10 October 3, 2009 Third draft with revised table formatting, partial application of reviewers feedback and edited through chapter 18. 09.08 August 12, 2009 Second draft incorporating the first editing pass. 09.07 July 18, 2009 Completed first draft. Table of Contents Introduction....................................................................................................xvi
    [Show full text]
  • Unix Commands (09/04/2014)
    Unix Commands (09/04/2014) • Access control – login <login_name> – exit – passwd <login_name> – yppassswd <loginname> – su – • Login as Super user – su <login> • Login as user <login> • Root Prompt – [root@localhost ~] # • User Prompt – [bms@raxama ~] $ On Line Documentation – man <command/topic> – info <command/topic> • Working with directories – mkdir –p <subdir> ... {-p create all directories in path if not present} mkdir –p /2015/Jan/21/14 will create /2015, Jan, 21 & 14 in case any of these is absent – cd <dir> – rm -r <subdir> ... Man Pages • 1 Executable programs or shell commands • 2 System calls (functions provided by the kernel) • 3 Library calls (functions within program libraries) • 4 Special files (usually found in /dev) • 5 File formats and conventions eg /etc/passwd • 6 Games • 7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7) • 8 System administration commands (usually only for root) • 9 Kernel routines [Non standard] – man grep, {awk,sed,find,cut,sort} – man –k mysql, man –k dhcp – man crontab ,man 5 crontab – man printf, man 3 printf – man read, man 2 read – man info Runlevels used by Fedora/RHS Refer /etc/inittab • 0 - halt (Do NOT set initdefault to this) • 1 - Single user mode • 2 - Multiuser, – without NFS (The same as 3, if you do not have networking) • 3 - Full multi user mode w/o X • 4 - unused • 5 - X11 • 6 - reboot (Do NOT set init default to this) – init 6 {Reboot System} – init 0 {Halt the System} – reboot {Requires Super User} – <ctrl> <alt> <del> • in tty[2-7] mode – tty switching • <ctrl> <alt> <F1-7> • In Fedora 10 tty1 is X.
    [Show full text]
  • UNIX and Linux Fundamentals
    UNIX and Linux Fundamentals Workbook December 2004 © Alan Johnson Revision 1.38 i UNIX Fundamentals Disclaimer The information provided in this manual is provided with the best intent. No responsibility is assumed for any errors or omissions resulting from the use of this document. The document is a work in progress and will be updated regularly. All trademarks acknowledged. Copyright © Alan Johnson http://www.alan.johnson.org ii UNIX Fundamentals Typographical Conventions This document uses the following typeface conventions: • The default font is Times New Roman. • Keywords and important concepts are introduced with italicized text. • File names, commands and computer output is shown in Courier font. • Bold type is used for emphasis • Shell prompt changes to reflect user - # for root and $ for ordinary user. • Angled brackets <> denote an option such as # mount /dev/sda1 /mnt/<mountpoint> iii UNIX Fundamentals Edit History • Version 1.0 June 2001 o Section 1, 2 and 3 added • Version 1.1 Feb 2002 o Added in section 4 to cover Solaris 2.8 disk admin and other miscellaneous functions o setuid information added to section 2. • Version 1.2 Sept. 2002 o Minor edits • Version 1.3 Nov. 2002 o Added in a new section involving advanced topics such as driver modules and kernel compiling • Version 1.31 Dec. 2002 o Added exportfs command after nfs section o Added in section to load device driver modules and creating new ramdisks • Version 1.32 February 2003 o Added in more kernel/ramdisk topics • Version 1.33 March 2003 o Minor kernel/ramdisk edits • Version 1.34 May 2003 o Minor edits • Version 1.35 July 2003 o Added section on Red Hat Advanced Server 2.1 Clustering • Version 1.36 July 2003 o Added section on client server operation with X • Version 1.37 May 2004 iv UNIX Fundamentals o Added in Appendix A to show SuSE installation screenshots • Version 1.38 Dec 2004 o Added example showing how to pass multiple LUN support with the insmod command.
    [Show full text]
  • Using Model Checking to Find Serious File System Errors
    Using Model Checking to Find Serious File System Errors Junfeng Yang, Paul Twohey, Dawson Engler ∗ Madanlal Musuvathi {junfeng, twohey, engler}@cs.stanford.edu [email protected] Computer Systems Laboratory Microsoft Research Stanford University One Microsoft Way Stanford, CA 94305, U.S.A. Redmond, WA 98052, U.S.A. Abstract Not only are errors in file systems dangerous, file This paper shows how to use model checking to find system code is simultaneously both difficult to reason serious errors in file systems. Model checking is a for- about and difficult to test. The file system must cor- mal verification technique tuned for finding corner-case rectly recover to an internally consistent state if the sys- errors by comprehensively exploring the state spaces de- tem crashes at any point, regardless of what data is being fined by a system. File systems have two dynamics that mutated, flushed or not flushed to disk, and what invari- make them attractive for such an approach. First, their ants have been violated. Anticipating all possible failures errors are some of the most serious, since they can de- and correctly recovering from them is known to be hard; stroy persistent data and lead to unrecoverable corrup- our results do not contradict this perception. tion. Second, traditional testing needs an impractical, The importance of file system errors has led to the de- exponential number of test cases to check that the sys- velopment of many file system stress test frameworks; tem will recover if it crashes at any point during execu- two good ones are [24, 30]. However, these focus mostly tion.
    [Show full text]
  • Setting up a Simple Lustre Filesystem
    Setting up a simple Lustre Filesystem 2008-05-07 Stephan Wiesand DESY - DV - Motivation we've been watching Lustre for (>= 5) years it always looked promising, but not quite ready for us recently, things changed: patchless client (EL4.5+, EL5.x) improved documentation much simplified installation & management (since 1.6) mountconf truly open source this may be the right time to start using it in HEP we recently made our first serious attempt it was rather simple, and results are encouraging Lustre Terminology MGS: “ManaGement Service” one per Lustre site can be co-located on an MDT MDS/MDT: “MetaData Server/Target” one per Lustre filesystem OSS: “Object Storage Server” a box with storage attached, direct or not one or more per Lustre filesystem OST “Object Storage Target” one or more per OSS where files/stripes go Hardware & Assignment 2 x 146 GB SAS RAID1 4 x 146 GB SAS RAID10 System & OST Journals System & MDT OSSs: HP DL380 G5 2 x 4 Cores 2.33 GHz 16 GB RAM, P400+P800 OSTs: HP MSA 60 12 x 750 GB E-SATA OSS 0 OSS 1 OSS 2 RAID6 on P800 MGS/MDS OST 0, 3 OST 1, 4 OST 2,5 Scientific Linux 5.1 (x86_64), Lustre 1.6.4.3 40 TB usable capacity, Inodes balanced for 1 MB average file size 2 bonded GbE links per server 1 Gb/s clients -> server (3 x 118 MB/s) 2 Gb/s server -> clients (6 x 118 MB/s) Performance mostly read: saturates 6 GbE links mostly write: saturates 3 GbE links read & write: ~ 400 + 300 MB/s up to 40 clients NO tuning yet large files (20 GB), different except proper stripe (128k) alignment on each client (no cache eff.) & stride
    [Show full text]