From a8a749726c0afdfc1be3b4c6deafa65791ca2cf4 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 26 Jan 2015 11:31:56 +0800 Subject: [PATCH] =?UTF-8?q?20150126-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...26 4 lvcreate Command Examples on Linux.md | 120 +++++++++++++ ...ning up Ubuntu 14.10,14.04,13.10 system.md | 163 ++++++++++++++++++ ...Without Rebooting on CentOS 7 or RHEL 7.md | 90 ++++++++++ 3 files changed, 373 insertions(+) create mode 100644 sources/tech/20150126 4 lvcreate Command Examples on Linux.md create mode 100644 sources/tech/20150126 Cleaning up Ubuntu 14.10,14.04,13.10 system.md create mode 100644 sources/tech/20150126 How to Add a New Hard Disk Without Rebooting on CentOS 7 or RHEL 7.md diff --git a/sources/tech/20150126 4 lvcreate Command Examples on Linux.md b/sources/tech/20150126 4 lvcreate Command Examples on Linux.md new file mode 100644 index 0000000000..ae7e177116 --- /dev/null +++ b/sources/tech/20150126 4 lvcreate Command Examples on Linux.md @@ -0,0 +1,120 @@ +4 lvcreate Command Examples on Linux +================================================================================ +Logical volume management (LVM) is a widely-used technique and extremely flexible disk management scheme. It basically contain three basic command : + +a. Creates the physical volumes using **pvcreate** +b. Create the volume group and add partition into volume group using **vgcreate** +c. Create a new logical volume using **lvcreate** + +![](http://www.ehowstuff.com/wp-content/uploads/2015/01/lvm-diagram1.jpg) + +The following examples focus on the command to create a logical volume in an existing volume group, **lvcreate**. **lvcreate** is the command do allocating logical extents from the free physical extent pool of that volume group. Normally logical volumes use up any space available on the underlying physical volumes on a next-free basis. Modifying the logical volume will frees and reallocates space in the physical volumes. The following **lvcreate** command has been tested on linux CentOS 5, CentOS 6, CentOS 7, RHEL 5, RHEl 6 and RHEL 7 version. + +### 4 lvcreate Command Examples on Linux : ### + +1. The following command creates a logical volume 15 gigabytes in size in the volume group vg_newlvm : + + [root@centos7 ~]# lvcreate -L 15G vg_newlvm + +2. The following command creates a 2500 MB linear logical volume named centos7_newvol in the volume group +vg_newlvm, creating the block device /dev/vg_newlvm/centos7_newvol : + + [root@centos7 ~]# lvcreate -L 2500 -n centos7_newvol vg_newlvm + +3. You can use the -l argument of the **lvcreate** command to specify the size of the logical volume in extents. You can also use this argument to specify the percentage of the volume group to use for the logical volume. The following command creates a logical volume called centos7_newvol that uses 50% of the total space in volume group vg_newlvm : + + [root@centos7 ~]# lvcreate -l 50%VG -n centos7_newvol vg_newlvm + +4. The following command creates a logical volume called centos7_newvol that uses all of the unallocated space in the volume group vg_newlvm : + + [root@centos7 ~]# lvcreate --name centos7_newvol -l 100%FREE vg_newlvm + +To see more **lvcreate** command options, issue the following command : + + [root@centos7 ~]# lvcreate --help + +---------- + + lvcreate: Create a logical volume + + lvcreate + [-A|--autobackup {y|n}] + [-a|--activate [a|e|l]{y|n}] + [--addtag Tag] + [--alloc AllocationPolicy] + [--cachemode CacheMode] + [-C|--contiguous {y|n}] + [-d|--debug] + [-h|-?|--help] + [--ignoremonitoring] + [--monitor {y|n}] + [-i|--stripes Stripes [-I|--stripesize StripeSize]] + [-k|--setactivationskip {y|n}] + [-K|--ignoreactivationskip] + {-l|--extents LogicalExtentsNumber[%{VG|PVS|FREE}] | + -L|--size LogicalVolumeSize[bBsSkKmMgGtTpPeE]} + [-M|--persistent {y|n}] [--major major] [--minor minor] + [-m|--mirrors Mirrors [--nosync] [{--mirrorlog {disk|core|mirrored}|--corelog}]] + [-n|--name LogicalVolumeName] + [--noudevsync] + [-p|--permission {r|rw}] + [--[raid]minrecoveryrate Rate] + [--[raid]maxrecoveryrate Rate] + [-r|--readahead ReadAheadSectors|auto|none] + [-R|--regionsize MirrorLogRegionSize] + [-T|--thin [-c|--chunksize ChunkSize] + [--discards {ignore|nopassdown|passdown}] + [--poolmetadatasize MetadataSize[bBsSkKmMgG]]] + [--poolmetadataspare {y|n}] + [--thinpool ThinPoolLogicalVolume{Name|Path}] + [-t|--test] + [--type VolumeType] + [-v|--verbose] + [-W|--wipesignatures {y|n}] + [-Z|--zero {y|n}] + [--version] + VolumeGroupName [PhysicalVolumePath...] + + lvcreate + { {-s|--snapshot} OriginalLogicalVolume[Path] | + [-s|--snapshot] VolumeGroupName[Path] -V|--virtualsize VirtualSize} + {-T|--thin} VolumeGroupName[Path][/PoolLogicalVolume] + -V|--virtualsize VirtualSize} + [-c|--chunksize] + [-A|--autobackup {y|n}] + [--addtag Tag] + [--alloc AllocationPolicy] + [-C|--contiguous {y|n}] + [-d|--debug] + [--discards {ignore|nopassdown|passdown}] + [-h|-?|--help] + [--ignoremonitoring] + [--monitor {y|n}] + [-i|--stripes Stripes [-I|--stripesize StripeSize]] + [-k|--setactivationskip {y|n}] + [-K|--ignoreactivationskip] + {-l|--extents LogicalExtentsNumber[%{VG|FREE|ORIGIN}] | + -L|--size LogicalVolumeSize[bBsSkKmMgGtTpPeE]} + [--poolmetadatasize MetadataVolumeSize[bBsSkKmMgG]] + [-M|--persistent {y|n}] [--major major] [--minor minor] + [-n|--name LogicalVolumeName] + [--noudevsync] + [-p|--permission {r|rw}] + [-r|--readahead ReadAheadSectors|auto|none] + [-t|--test] + [--thinpool ThinPoolLogicalVolume[Path]] + [-v|--verbose] + [--version] + [PhysicalVolumePath...] + +-------------------------------------------------------------------------------- + +via: http://www.ehowstuff.com/4-lvcreate-command-examples-on-linux/ + +作者:[skytech][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.ehowstuff.com/author/mhstar/ \ No newline at end of file diff --git a/sources/tech/20150126 Cleaning up Ubuntu 14.10,14.04,13.10 system.md b/sources/tech/20150126 Cleaning up Ubuntu 14.10,14.04,13.10 system.md new file mode 100644 index 0000000000..d87948bc59 --- /dev/null +++ b/sources/tech/20150126 Cleaning up Ubuntu 14.10,14.04,13.10 system.md @@ -0,0 +1,163 @@ +Cleaning up Ubuntu 14.10,14.04,13.10 system +================================================================================ +We have already discussed [Cleaning up a Ubuntu GNU/Linux system][1] and this tutorial is updated with new ubuntu versions and more tools added. + +If you want to clean your ubuntu machine you need to follow these simple steps to remove all unnecessary junk files. + +### Remove partial packages ### + +This is yet another built-in feature, but this time it is not used in Synaptic Package Manager. It is used in the Terminal. Now, in the Terminal, key in the following command + + sudo apt-get autoclean + +Then enact the package clean command. What this commnad does is to clean remove .deb packages that apt caches when you install/update programs. To use the clean command type the following in a terminal window: + + sudo apt-get clean + +You can then use the autoremove command. What the autoremove command does is to remove packages installed as dependencies after the original package is removed from the system. To use autoremove tye the following in a terminal window: + + sudo apt-get autoremove + +### Remove unnecessary locale data ### + +For this we need to install localepurge.Automagically remove unnecessary locale data.This is just a simple script to recover diskspace wasted for unneeded locale files and localized man pages. It will automagically be invoked upon completion of any apt installation run. + +Install localepurge in Ubuntu + + sudo apt-get install localepurge + +After installing anything with apt-get install, localepurge will remove all translation files and translated man pages in languages you cannot read. + +If you want to configure localepurge you need to edit /etc/locale.nopurge + +This can save you several megabytes of disk space, depending on the packages you have installed. + +Example:- + +I am trying to install dicus using apt-get + +sudo apt-get install discus + +after end of this installation you can see something like below + +localepurge: Disk space freed in /usr/share/locale: 41860K + +### Remove "orphaned" packages ### + +If you want to remove orphaned packages you need to install deborphan package. + +Install deborphan in Ubuntu + + sudo apt-get install deborphan + +### Using deborphan ### + +Open Your terminal and enter the following command + + sudo deborphan | xargs sudo apt-get -y remove --purge + +### Remove "orphaned" packages Using GtkOrphan ### + +GtkOrphan (a Perl/Gtk2 application for debian systems) is a graphical tool which analyzes the status of your installations, looking for orphaned libraries. It implements a GUI front-end for deborphan, adding the package-removal capability. + +### Install GtkOrphan in Ubuntu ### + +Open the terminal and run the following command + + sudo apt-get install gtkorphan + +#### Screenshot #### + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/01/41.png) + +### Remove Orphan packages using Wajig ### + +simplified Debian package management front end.Wajig is a single commandline wrapper around apt, apt-cache, dpkg,/etc/init.d scripts and more, intended to be easy to use and providing extensive documentation for all of its functions. + +With a suitable sudo configuration, most (if not all) package installation as well as creation tasks can be done from a user shell. Wajig is also suitable for general system administration.A Gnome GUI command ‘gjig' is also included in the package. + +### Install Wajig in Ubuntu ### + +Open the terminal and run the following command + + sudo apt-get install wajig + +### Debfoster --- Keep track of what you did install ### + +debfoster maintains a list of installed packages that were explicitly requested rather than installed as a dependency. Arguments are entirely optional, debfoster can be invoked per se after each run of dpkg and/or apt-get. + +Alternatively you can use debfoster to install and remove packages by specifying the packages on the command line. Packages suffixed with a --- are removed while packages without a suffix are installed. + +If a new package is encountered or if debfoster notices that a package that used to be a dependency is now an orphan, it will ask you what to do with it. If you decide to keep it, debfoster will just take note and continue. If you decide that this package is not interesting enough it will be removed as soon as debfoster is done asking questions. If your choices cause other packages to become orphaned more questions will ensue. + +### Install debfoster in Ubuntu ### + +Open the terminal and run the following command + + sudo apt-get install debfoster + +### Using debfoster ### + +to create the initial keepers file use the following command + + sudo debfoster -q + +you can always edit the file /var/lib/debfosterkeepers which defines the packages you want to remain on your system. + +to edit the keepers file type + + sudo vi /var/lib/debfoster/keepers + +To force debfoster to remove all packages that aren't listed in this list or dependencies of packages that are listed in this list.It will also add all packages in this list that aren't installed. So it makes your system comply with this list. Do this + + sudo debfoster -f + +To keep track of what you installed additionally do once in a while : + + sudo debfoster + +### xdiskusage -- Check where the space on your hard drive goes ### + +Displays a graphic of your disk usage with du.xdiskusage is a user-friendly program to show you what is using up all your disk space. It is based on the design of the "xdu" program written by Phillip C. Dykstra. Changes have been made so it runs "du" for you, and can display the free space left on the disk, and produce a PostScript version of the display.xdiskusage is nice if you want to easily see where the space on your hard drive goes. + +### Install xdiskusage in Ubuntu ### + + sudo apt-get install xdiskusage + +If you want to open this application you need to use the following command + + sudo xdiskusage + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/01/5.png) + +Once it opens you should see similar to the following screen + +### Bleachbit ### + +BleachBit quickly frees disk space and tirelessly guards your privacy. Free cache, delete cookies, clear Internet history, shred temporary files, delete logs, and discard junk you didn't know was there. Designed for Linux and Windows systems, it wipes clean a thousand applications including Firefox, Internet Explorer, Adobe Flash, Google Chrome, Opera, Safari,and more. Beyond simply deleting files, BleachBit includes advanced features such as shredding files to prevent recovery, wiping free disk space to hide traces of files deleted by other applications, and vacuuming Firefox to make it faster. Better than free, BleachBit is open source. + +### Install Bleachbit in ubuntu ### + +Open the terminal and run the following command + + sudo apt-get install bleachbit + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/01/6.png) + +### Using Ubuntu-Tweak ### + +You can also Use [Ubuntu-Tweak][2] To clean up your system + +-------------------------------------------------------------------------------- + +via: http://www.ubuntugeek.com/cleaning-up-a-ubuntu-gnulinux-system-updated-with-ubuntu-14-10-and-more-tools-added.html + +作者:[ruchi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.ubuntugeek.com/author/ubuntufix +[1]:http://www.ubuntugeek.com/cleaning-up-all-unnecessary-junk-files-in-ubuntu.html +[2]:http://www.ubuntugeek.com/www.ubuntugeek.com/install-ubuntu-tweak-on-ubuntu-14-10.html \ No newline at end of file diff --git a/sources/tech/20150126 How to Add a New Hard Disk Without Rebooting on CentOS 7 or RHEL 7.md b/sources/tech/20150126 How to Add a New Hard Disk Without Rebooting on CentOS 7 or RHEL 7.md new file mode 100644 index 0000000000..2e6886bddf --- /dev/null +++ b/sources/tech/20150126 How to Add a New Hard Disk Without Rebooting on CentOS 7 or RHEL 7.md @@ -0,0 +1,90 @@ +How to Add a New Hard Disk Without Rebooting on CentOS 7/ RHEL 7 +================================================================================ +Normally when you have added new storage to a running Virtual machine, you probably won’t see the new storage automatically. This is because the SCSI bus to which the storage devices are connected needs to be rescanned to make the new hardware visible. The is one simple command to rescan the SCSI Bus and add SCSI Devices. The following steps has been tested on CentOS 7 and RHEL 7. + +1. Add the new 20GB from the ESXi or vCenter : + +![](http://www.ehowstuff.com/wp-content/uploads/2015/01/Create-new-LVM-CentOS7-1.png) + +2. Show current disk and partition : + + [root@centos7 ~]# fdisk -l + +---------- + + Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors + Units = sectors of 1 * 512 = 512 bytes + Sector size (logical/physical): 512 bytes / 512 bytes + I/O size (minimum/optimal): 512 bytes / 512 bytes + Disk label type: dos + Disk identifier: 0x0006b96a + + Device Boot Start End Blocks Id System + /dev/sda1 * 2048 1026047 512000 83 Linux + /dev/sda2 1026048 62914559 30944256 8e Linux LVM + + Disk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors + Units = sectors of 1 * 512 = 512 bytes + Sector size (logical/physical): 512 bytes / 512 bytes + I/O size (minimum/optimal): 512 bytes / 512 bytes + + + Disk /dev/mapper/centos-root: 29.5 GB, 29536288768 bytes, 57688064 sectors + Units = sectors of 1 * 512 = 512 bytes + Sector size (logical/physical): 512 bytes / 512 bytes + I/O size (minimum/optimal): 512 bytes / 512 bytes + +3. Identify host bus number : + + [root@centos7 ~]# ls /sys/class/scsi_host/ + host0 host1 host2 + +4. Rescan the SCSI Bus to Add a SCSI Devices : + + [root@centos7 ~]# echo "- - -" > /sys/class/scsi_host/host0/scan + [root@centos7 ~]# echo "- - -" > /sys/class/scsi_host/host1/scan + [root@centos7 ~]# echo "- - -" > /sys/class/scsi_host/host2/scan + +5. Verify the disk and partiton and make sure 20GB has been added. In this case, the following line appeared “Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors” and confirmed that 20GB has been added without reboot the server : + + [root@centos7 ~]# fdisk -l + + Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors + Units = sectors of 1 * 512 = 512 bytes + Sector size (logical/physical): 512 bytes / 512 bytes + I/O size (minimum/optimal): 512 bytes / 512 bytes + Disk label type: dos + Disk identifier: 0x0006b96a + + Device Boot Start End Blocks Id System + /dev/sda1 * 2048 1026047 512000 83 Linux + /dev/sda2 1026048 62914559 30944256 8e Linux LVM + + Disk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors + Units = sectors of 1 * 512 = 512 bytes + Sector size (logical/physical): 512 bytes / 512 bytes + I/O size (minimum/optimal): 512 bytes / 512 bytes + + + Disk /dev/mapper/centos-root: 29.5 GB, 29536288768 bytes, 57688064 sectors + Units = sectors of 1 * 512 = 512 bytes + Sector size (logical/physical): 512 bytes / 512 bytes + I/O size (minimum/optimal): 512 bytes / 512 bytes + + + Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors + Units = sectors of 1 * 512 = 512 bytes + Sector size (logical/physical): 512 bytes / 512 bytes + I/O size (minimum/optimal): 512 bytes / 512 bytes + +-------------------------------------------------------------------------------- + +via: http://www.ehowstuff.com/how-to-add-a-new-hard-disk-without-rebooting-on-centos-7-rhel-7/ + +作者:[skytech][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.ehowstuff.com/author/mhstar/ \ No newline at end of file