20140818-2 选题

This commit is contained in:
DeadFire
2014-08-18 13:52:53 +08:00
parent d19bc5a3c6
commit 2fac83eef5
5 changed files with 386 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
How To Schedule A Shutdown In Ubuntu 14.04 [Quick Tip]
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Schedule_Shutdown_Ubuntu.jpeg)
Cannot shutdown your computer as some program are running but you cannot leave the computer running for the whole night? You may find yourself in similar position where you would need to schedule a shutdown in Ubuntu or any other Linux for that matter.
In this quick post, we shall see how to schedule a shutdown in Ubuntu with GUI or in CLI.
### Schedule a shutdown in Ubuntu with EasyShutdown ###
EasyShutdown is a tiny application that provides a tiny GUI so that you can easily schedule a shutdown in Ubuntu. You can [download the .deb file from launchpad page of EayShutdown][1]. Just double click on it to install it. By default, it should open with Ubuntu Software Center.
Once installed, run it from Unity Dash. Interface is very simple. You just have to provide the time at which you want to shut down the system. For example, if you want to shutdown the system at 03:30 AM, fill it as following:
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Schedule_Shudown_Ubuntu.jpeg)
Note that EasyShutdown doesnt have a daemon or system tray. So you have to keep it running to make it work. Good thing with EasyShutdown is that it notifies you one minute before the scheduled shutdown, so that you can choose to pause it.
### Schedule a shutdown in Ubuntu in command line ###
Using command line option to **schedule a shutdown in Ubuntu** is equally easy. All you have to do is to use “shutdown” command. For example, to schedule a shutdown at 03:30 AM, you can use the command in following fashion:
sudo shutdown -h 03:30
Note that you will have to keep running this command. So either keep the terminal open or send the process in background.
I hope these quick tips helps you to schedule a shutdown in Ubuntu or other Linux system such as Linux Mint. Any questions or suggestions are always welcomed.
--------------------------------------------------------------------------------
via: http://itsfoss.com/schedule-shutdown-ubuntu/
作者:[Abhishek][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/Abhishek/
[1]:https://launchpad.net/easyshutdown

View File

@@ -0,0 +1,200 @@
How to Take Snapshot of Logical Volume and Restore in LVM Part III
================================================================================
**LVM Snapshots** are space efficient pointing time copies of lvm volumes. It works only with lvm and consume the space only when changes are made to the source logical volume to snapshot volume. If source volume has a huge changes made to sum of 1GB the same changes will be made to the snapshot volume. Its best to always have a small size of changes for space efficient. Incase the snapshot runs out of storage, we can use lvextend to grow. And if we need to shrink the snapshot we can use lvreduce.
![Take Snapshot in LVM](http://www.tecmint.com/wp-content/uploads/2014/08/Take-Snapshot-in-LVM.jpg)
Take Snapshot in LVM
If we have accidentally deleted any file after creating a Snapshot we dont have to worry because the snapshot have the original file which we have deleted. It is possible if the file was there when the snapshot was created. Dont alter the snapshot volume, keep as it while snapshot used to do a fast recovery.
Snapshots cant be use for backup option. Backups are Primary Copy of some datas, so we cant use snapshot as a backup option.
#### Requirements ####
注:此两篇文章如果发布后可换成发布后链接,原文在前几天更新中
- [Create Disk Storage with LVM in Linux PART 1][1]
- [How to Extend/Reduce LVMs in Linux Part II][2]
### My Server Setup ###
- Operating System CentOS 6.5 with LVM Installation
- Server IP 192.168.0.200
#### Step 1: Creating LVM Snapshot ####
First, check for free space in volume group to create a new snapshot using following **vgs** command.
# vgs
# lvs
![Check LVM Disk Space](http://www.tecmint.com/wp-content/uploads/2014/08/Check-LVM-Disk-Space.jpg)
Check LVM Disk Space
You see, there is 8GB of free space left in above **vgs** output. So, lets create a snapshot for one of my volume named **tecmint_datas**. For demonstration purpose, I am going to create only 1GB snapshot volume using following commands.
# lvcreate -L 1GB -s -n tecmint_datas_snap /dev/vg_tecmint_extra/tecmint_datas
OR
# lvcreate --size 1G --snapshot --name tecmint_datas_snap /dev/vg_tecmint_extra/tecmint_datas
Both the above commands does the same thing:
- **-s** Creates Snapshot
- **-n** Name for snapshot
![Create LVM Snapshot](http://www.tecmint.com/wp-content/uploads/2014/08/Create-LVM-Snapshot.jpg)
Create LVM Snapshot
Here, is the explanation of each point highlighted above.
- Size of snapshot Iam creating here.
- Creates snapshot.
- Creates name for the snapshot.
- New snapshots name.
- Volume which we are going to create a snapshot.
If you want to remove a snapshot, you can use **lvremove** command.
# lvremove /dev/vg_tecmint_extra/tecmint_datas_snap
![Remove LVM Snapshot](http://www.tecmint.com/wp-content/uploads/2014/08/Remove-LVM-Snapshot.jpg)
Remove LVM Snapshot
Now, list the newly created snapshot using following command.
# lvs
![Verify LVM Snapshot](http://www.tecmint.com/wp-content/uploads/2014/08/Verify-LVM-Snapshot.jpg)
Verify LVM Snapshot
You see above, a snapshot was created successfully. I have marked with an arrow where snapshots origin from where its created, Its **tecmint_datas**. Yes, because we have created a snapshot for **tecmint_datas l-volume**.
![Check LVM Snapshot Space](http://www.tecmint.com/wp-content/uploads/2014/08/Check-LVM-Snapshot-Space.jpg)
Check LVM Snapshot Space
Lets add some new files into **tecmint_datas**. Now volume has some datas around 650MB and our snapshot size is 1GB. So there is enough space to backup our changes in snap volume. Here we can see, what is the status of our snapshot using below command.
# lvs
![Check Snapshot Status](http://www.tecmint.com/wp-content/uploads/2014/08/Check-Snapshot-Status.jpg)
Check Snapshot Status
You see, **51%** of snapshot volume was used now, no issue for more modification in your files. For more detailed information use command.
# lvdisplay vg_tecmint_extra/tecmint_data_snap
![View Snapshot Information](http://www.tecmint.com/wp-content/uploads/2014/08/Snapshot-Information.jpg)
View Snapshot Information
Again, here is the clear explanation of each point highlighted in the above picture.
- Name of Snapshot Logical Volume.
- Volume group name currently under use.
- Snapshot volume in read and write mode, we can even mount the volume and use it.
- Time when the snapshot was created. This is very important because snapshot will look for every changes after this time.
- This snapshot belongs to tecmint_datas logical volume.
- Logical volume is online and available to use.
- Size of Source volume which we took snapshot.
- Cow-table size = copy on Write, that means whatever changes was made to the tecmint_data volume will be written to this snapshot.
- Currently snapshot size used, our tecmint_datas was 10G but our snapshot size was 1GB that means our file is around 650 MB. So what its now in 51% if the file grow to 2GB size in tecmint_datas size will increase more than snapshot allocated size, sure we will be in trouble with snapshot. That means we need to extend the size of logical volume (snapshot volume).
- Gives the size of chunk for snapshot.
Now, lets copy more than 1GB of files in **tecmint_datas**, lets see what will happen. If you do, you will get error message saying **Input/output error**, it means out of space in snapshot.
![Add Files to Snapshot](http://www.tecmint.com/wp-content/uploads/2014/08/Add-Files-to-Snapshot.jpg)
Add Files to Snapshot
If the logical volume become full it will get dropped automatically and we cant use it any more, even if we extend the size of snapshot volume. It is the best idea to have the same size of Source while creating a snapshot, **tecmint_datas** size was 10G, if I create a snapshot size of 10GB it will never over flow like above because it has enough space to take snap of your volume.
#### Step 2: Extend Snapshot in LVM ####
If we need to extend the snapshot size before overflow we can do it using.
# lvextend -L +1G /dev/vg_tecmint_extra/tecmint_data_snap
Now there was totally 2GB size for snapshot.
![Extend LVM Snapshot](http://www.tecmint.com/wp-content/uploads/2014/08/Extend-LVM-Snapshot.jpg)
Extend LVM Snapshot
Next, verify the new size and COW table using following command.
# lvdisplay /dev/vg_tecmint_extra/tecmint_data_snap
To know the size of snap volume and usage **%**.
# lvs
![Check Size of Snapshot](http://www.tecmint.com/wp-content/uploads/2014/08/Check-Size-of-Snapshot.jpg)
Check Size of Snapshot
But if, you have snapshot volume with the same size of Source volume we dont need to worry about these issues.
#### Step 3: Restoring Snapshot or Merging ####
To restore the snapshot, we need to un-mount the file system first.
# unmount /mnt/tecmint_datas/
![Un-mount File System](http://www.tecmint.com/wp-content/uploads/2014/08/Unmount-File-System.jpg)
Un-mount File System
Just check for the mount point whether its unmounted or not.
# df -h
![Check File System Mount Points](http://www.tecmint.com/wp-content/uploads/2014/08/Check-Mount-Points.jpg)
Check File System Mount Points
Here our mount has been unmounted, so we can continue to restore the snapshot. To restore the snap using command **lvconvert**.
# lvconvert --merge /dev/vg_tecmint_extra/tecmint_data_snap
![Restore LVM Snapshot](http://www.tecmint.com/wp-content/uploads/2014/08/Restore-Snapshot.jpg)
Restore LVM Snapshot
After the merge is completed, snapshot volume will be removed automatically. Now we can see the space of our partition using **df** command.
# df -Th
![Check Size of Snapshot](http://www.tecmint.com/wp-content/uploads/2014/08/Check-Snapshot-Space.jpg)
After the snapshot volume removed automatically. You can see the size of logical volume.
# lvs
![Check Size of Logical Volume](http://www.tecmint.com/wp-content/uploads/2014/08/Check-Size-of-LV.jpg)
Check Size of Logical Volume
**Important**: To Extend the Snapshots automatically, we can do it using some modification in conf file. For manual we can extend using lvextend.
Open the lvm configuration file using your choice of editor.
# vim /etc/lvm/lvm.conf
Search for word autoextend. By Default the value will be similar to below.
![LVM Configuration](http://www.tecmint.com/wp-content/uploads/2014/08/LVM-Configuration.jpg)
LVM Configuration
Change the **100** to **75** here, if so auto extend threshold is **75** and auto extend percent is 20, it will expand the size more by **20 Percent**
If the snapshot volume reach **75%** it will automatically expand the size of snap volume by **20%** more. Thus,we can expand automatically. Save and exit the file using **wq!**.
This will save snapshot from overflow drop. This will also help you to save more time. LVM is the only Partition method in which we can expand more and have many features as thin Provisioning, Striping, Virtual volume and more Using thin-pool, let us see them in the next topic.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/take-snapshot-of-logical-volume-and-restore-in-lvm/
作者:[Babin Lonston][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/babinlonston/
[1]:http://www.tecmint.com/create-lvm-storage-in-linux/
[2]:http://www.tecmint.com/extend-and-reduce-lvms-in-linux/

View File

@@ -0,0 +1,55 @@
Install Atom Text Editor In Ubuntu 14.04 & Linux Mint 17
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Install_Atom_In_Ubuntu_Linux_Mint.jpeg)
[Atom][1] is sleek and feature rich open source text editor from [Github][2]. It is currently in beta but if you are curious to try it, we shall see **how to install Atom in Ubuntu 14.04 or Linux Mint 17**.
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Atom_Editor.jpeg)
In terms of look and even features, Atom resembles a lot like [Sublime Text editor][3], a hugely popular cross platform but closed source text editor which is preferred by programmers. In fact, Atom is not the only upcoming text editor which is inspired by Sublime Text. [Lime Text][4] is an open source clone of Sublime Text under development.
Without further ado, lets see how to install Atom editor in Ubuntu 14.04 and Linux Mint 17.
###
Install Atom in Ubuntu and Linux Mint via PPA ###
Since it is in beta, there are no binaries for Linux by the time I write this article. But dont worry. You dont have to compile the code on your own (of course you can choose to do so, for your own pleasure). Thanks to [Webupd8 teams][5] effort, we have a PPA that lest you easily install Atom editor in both 32 bit and 64 bit systems.
Open a terminal and use the following commands:
sudo add-apt-repository ppa:webupd8team/atom
sudo apt-get update
sudo apt-get install atom
That would be it. You can run Atom editor from Unity Dash in Ubuntu and application menu in Linux Mint.
### Uninstall Atom from Ubuntu and Linux Mint ###
There could be plenty of reasons why you would like to remove Atom from your system. Being unstable could be one of the major reasons. Whatever may be your reason, here is how to uninstall Atom:
sudo apt-get remove atom
sudo add-apt-repository --remove ppa:webupd8team/atom
This will remove Atom and the PPA repository. A good thing to do would be to run auto remove as well.
sudo apt-get autoremove
### Your experience with Atom? ###
If you tried Atom, do share your experience with us. Do you think it has the potential to become your favorite text editor?
--------------------------------------------------------------------------------
via: http://itsfoss.com/install-atom-text-editor-ubuntu-1404-linux-mint-17/
作者:[Abhishek][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://itsfoss.com/author/Abhishek/
[1]:https://atom.io/
[2]:https://github.com/
[3]:http://www.sublimetext.com/
[4]:http://itsfoss.com/lime-text-open-source-alternative/
[5]:https://launchpad.net/~nilarimogard/+archive/ubuntu/webupd8

View File

@@ -0,0 +1,49 @@
Linux FAQs with Answers--How to fix “X11 forwarding request failed on channel 0″
================================================================================
> **Question**: When I tried to SSH to a remote host with X11 forwarding option, I got "X11 forwarding request failed on channel 0" error after logging in. Why am I getting this error, and how can I fix this problem?
![](https://farm6.staticflickr.com/5562/14909594691_ce7ca01b2d_z.jpg)
First of all, we assume that you already enabled [X11 forwarding over SSH][1] properly.
If you are getting "X11 forwarding request failed on channel 0" message upon SSH login, there could be several reasons. Solutions vary as well.
### Solution One ###
For security reason, OpenSSH server, by default, binds X11 forwarding server to the local loopback address, and sets the hostname in DISPLAY environment variable to "localhost". Under this setup, some X11 clients cannot handle X11 forwarding properly, which causes the reported error. To fix this problem, add the following line in /etc/ssh/sshd_config file, which will let X11 forwarding server bind on the wild card address.
$ sudo vi /etc/ssh/sshd_config
----------
X11Forwarding yes
X11UseLocalhost no
Restart SSH server to activate the change:
$ sudo /etc/init.d/ssh restart (Debian 6, Ubuntu or Linux Mint)
$ sudo systemctl restart ssh.service (Debian 7, CentOS/RHEL 7, Fedora)
$ sudo service sshd restart (CentOS/RHEL 6)
### Solution Two ###
The broken X11 forwarding error may also happen if the remote host where SSH server is running has IPv6 disabled. To fix the error in this case, open /etc/ssh/sshd_config file, and uncomment "AddressFamily all" (if any). Then add the following line. This will force SSH server to use IPv4 only, but not IPv6.
$ sudo vi /etc/ssh/sshd_config
----------
AddressFamily inet
Again, restart SSH server to finalize the change.
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/fix-broken-x11-forwarding-ssh.html
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://xmodulo.com/2012/11/how-to-enable-x11-forwarding-using-ssh.html

View File

@@ -0,0 +1,42 @@
Linux FAQs with Answers--How to set a static MAC address on VMware ESXi virtual machine
================================================================================
> **Question**: I want to assign a static MAC address to a virtual machine (VM) on VMware ESXi. However, when I attempt to start a VM with a static MAC address, the VM fails to start and throws an error "00:0c:29:1f:4a:ab is not an allowed static Ethernet address. It conflicts with VMware reserved MACs". How can I set a static MAC address on VMware ESXi VMs?
When you create a VM on VMware ESXi, each network interface of the VM is assigned a dynamically generated MAC address. If you want to change this default behavior and assign a static MAC address to your VM, here is how to do it.
![](https://farm6.staticflickr.com/5592/14726591627_64c1dc67ce_z.jpg)
As you can see above, VMware's vSphere GUI client already has a menu for setting a static MAC address for a VM. However, this GUI-based method only allows you to choose a static MAC address from **00:50:56:xx:xx:xx**, which is VMware-reserved MAC address range. If you attempt to set any arbitrary MAC address outside this MAC range, you will fail to launch the VM, and get the following error.
![](https://farm6.staticflickr.com/5591/14890165456_a82ded21b9_z.jpg)
Then what if I want to assign any arbitrary MAC address to a VM?
Fortunately, there is a workaround to this limitation. The solution is, instead of using vSphere GUI client, editing .vmx file of your VM directly, after logging in to the ESXi host.
First, turn off the VM to which you want to assign a static MAC address.
[Enable SSH access to your ESXi host][1] if you haven't done it already. Then log in to the ESXi host via SSH.
Move to the directory where your VM's .vmx file is located:
# cd vmfs/volumes/datastore1/[name-of-vm]
Open .vmx file with a text editor, and add the following fields. Replace the MAC address field with your own.
ethernet0.addressType = "static"
ethernet0.checkMACAddress = "false"
ethernet0.address = "00:0c:29:1f:4b:ac"
Now you should be able to launch a VM with the static MAC address you defined in .vmx file.
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/static-mac-address-vmware-esxi-virtual-machine.html
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://ask.xmodulo.com/enable-ssh-remote-access-vmware-esxi5.html