Showing posts with label fedora. Show all posts
Showing posts with label fedora. Show all posts

Tuesday, 2 July 2024

How to LVM resize filesystem Guide

 Increase the size of an LVM logical volume - Step-by-step Guide.

Tested on

Debian (Etch, Lenny, Squeeze)
Fedora (14)
Ubuntu (Hardy, Intrepid, Jaunty, Karmic, Lucid, Maverick, Natty)

Objective

To increase the size of an existing LVM logical volume

Background

Be aware that extending a logical volume does not by itself let you to store more files in a filesystem located on that volume. If that is your aim then you will need to:
  1. increase the size of the underlying block device (the logical volume), then
  2. increase the size of the filesystem to fill the block device.
These instructions cover the first step only. The method for the second step will depend on the type of filesystem (and in some cases there will be no practicable method). See below for further information.

Scenario

Suppose that /dev/vg0/foo is a logical volume of size 80GB. You wish to increase its size by 40GB to 120GB.

Method

A logical volume can be extended using the lvextend command. You can specify either the amount by which you want to increase the size of the volume:
lvextend --size +40G /dev/vg0/foo

or the final size that you want to achieve:
lvextend --size 120G /dev/vg0/foo

If successful you should see a response of the form:
Extending logical volume foo to 8.00 GB
Logical volume foo successfully resized

Testing

Verify the new size of the logical volume using the lvdisplay command:
lvdisplay /dev/vg0/foo

This should give a response of the form:
--- Logical volume ---
LV Name /dev/vg0/foo
VG Name vg0
LV UUID w2q9ZN-hKnN-CLGf-6Z5g-e1QZ-DCKX-1DYZvR
LV Write Access read/write
LV Status available
# open 0
LV Size 120.00 GB
Current LE 30720
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:85

You should not at this stage expect to see any increase in the amount of usable space within whatever filesystem located on the logical volume, for example, as reported by the df command: it is only the size of the underlying block device that has been changed.

Next steps

If the logical volume contains a filesystem then you will probably now want to extend it to fill the newly available space. Filesystems that can be extended include ext2, ext3, ext4, jfs, reiserfs and xfs. See:
Some filesystems cannot be extended, either because their design makes this impracticable or because the necessary software has not been written. In that case your only option is to move the files somewhere else, then recreate the filesystem, then move the files back.

Troubleshooting

Alternatives

lvresize

An alternative to lvextend is to use the lvresize command:
lvresize --size +40G /dev/vg0/foo

or:
lvresize --size 120G /dev/vg0/foo

The difference is that lvextend can only increase the size of a volume, whereas lvresize can increase or reduce it. This makes lvresize more powerful but more dangerous. If you accidentally reduce the size of a volume without first reducing the size of the filesystem contained within it then the filesystem is likely to be damaged irreparably. For scenarios similar to the one described here, lvextend is recommended because mistakes of this type are not then possible.

See also

Tuesday, 26 July 2016

How to Create You Lab on Kali Linux - Using VMware or VBox

Before you start - Here are something that you need to consider..

  • Install VirtualBox or Vmware
  • Install LiveCD in VirtualBox or Vmware
  • Boot and try out your LiveCD

Introduction.


There are lots of tutorials available on the internet related to hacking but the big problem lies in testing your theoretical skills. Unless you don't have practical exposure to hacking, you cannot really understand the strength of it. The technique I will discuss here will be advantageous for those who have only single system and want to set up a testing network using it. In case you have multiple systems then you can easily test for your skills by making one system as target and other as attacker.
VMware Workstation 12 Pro - Leading Edge PC Virtualization VMware Workstation 12 Pro


Download VMware Workstation or Player

The best way to practice hacking is within a virtual environment. Essentially, you set up a hacking system, such as Kali Linux, and some victims to exploit. Ideally, you would want multiple operating systems (Windows XP, Vista, 7, and 8, as well as a Linux flavor) and applications so that you can try out a variety of hacks.

Virtual machines and a virtual network are the best and safest way to set up a hacking lab. There are several virtualization systems out there, including Citrix, Oracle's VirtualBox, KVM, Microsoft's Virtual PC and Hyper-V, and VMware'sWorkstation, VMware Player and ESXi. For a laboratory environment, I strongly recommend VMware's Workstation or Player. Workstation is commercial product that costs under $200, while Player is free. You can also get a free 30-day trial of Workstation.

Player is limited to just playing VMs , while Workstation can both create and play VMs. Let's download VMware's Workstation or Player here.


Then - For you Images you can download a pre-built image. As it will allow you to save some time, you don't need to build the image from scratch. Here is a link for you to download several Linux pre-built Linux Images on SourceForge.

I don't encourage you to download pre-built Windows VM from anywhere, for the single fact that Microsoft itself provides you with pre-built Windows VM for you to use on your VM Lab. Again I did the research for you and here it the link for you to download the Windows of your choice,  Obs: Remember Windows only allow you to use those VM images for 30 days. Please, READ Microsoft TERMS AND CONDITIONS before you use their software here is the url for you.



Keep posted - This tutorial continues on Part 2

Also check this Handful tutorials I have found online:

Checkout our tutorial videos below. Learn more about.
  1. OWASP AppSec Basics: http://www.youtube.com/watch?v=CDbWvEwBBxo
  2. OWASP SQL Injection: http://www.youtube.com/watch?v=pypTYPaU7mM
  3. OWASP Cross Site Scripting: http://www.youtube.com/watch?v=_Z9RQSnf8-g
  4. OWASP Strict Transport Security: http://www.youtube.com/watch?v=zEV3HOuM_Vw

Tuesday, 1 October 2013

How to Install Ruby & Rails on CentOS, Fedora or RedHat

#get root access
$su -
$ cd /tmp
 
#Remove old Ruby
$ yum remove ruby
# Install dependencies
$ yum groupinstall "Development Tools"
$ yum install zlib zlib-devel
$ yum install openssl-devel
$ wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
$ tar xzvf yaml-0.1.4.tar.gz
$ cd yaml-0.1.4
$ ./configure
$ make
$ make install
# Install ruby
$ wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
$ tar zxf ruby-1.9.3-p194.tar.gz
$ cd ruby-1.9.3-p194
$ ./configure
$ make
$ make install
# Update rubygems
$ gem update --system
$ gem install bundler
#Test ruby and rubygems are working
#Close shell and reopen for changes to take effect
$ruby -v
$gem --version
# Rails
$ yum install sqlite-devel
$ gem install rails
$ gem install sqlite3

Friday, 12 July 2013

How to get Fedore 17 to upgrade to Fedore 18 Using Yum !!


Hi Guys !!!

I am using Fedora 17 for quite a while on VMware I decide to give it a go because my older brother advice me to do so.. Since here, most of time I've using  CentOS, RedHat, Debian Kali and uBuntu mainly... 



But I decided to give it a go on Fedora 17, after some months into it I realize that a new release was launched, therefore I decide to upgrade my machine ... And here is the workout ...

Here are some WORDS of RECOMMENDATION BEFORE YOU DO THIS ...

Upgrading using the yum method described here is not recommended for new users. Use FedUp instead 
 
For upgrades to Fedora 18 and later, the recommended upgrade method is the FedUp tool. This section has instructions on using FedUp to upgrade. 


For upgrades to Fedora 17 and earlier, the recommended installation method is with a boot media with the Anaconda installer as detailed in the Installation Guide or via PreUpgrade. PreUpgrade is a slightly different upgrade method where all the packages are downloaded before the system is rebooted into the Anaconda installer. 

Although upgrades with yum do work, they are not explicitly tested as part of the release process by the Fedora QA and are not documented in the Fedora installation guide. If you are not prepared to resolve issues on your own if things break, you should probably use the recommended installation methods instead
 Extracted from: https://fedoraproject.org/wiki/Upgrading_Fedora_using_yum

2 Upgrading To Fedora 18 (Desktop & Server)

First we must upgrade the rpm package:

# sudo yum clean-all

yum upgrade yum
yum install fedup
yum -y upgrade
fedup-cli --network 18 --debuglog fedup-to-18.log


Than when the install finished .. run on terminal the command " # reboot "
Let the machine boot up and then look into the Grub menu and choose the option that says "fedora fedup upgrade"


Press "Enter" and let the system upgrade start ! When it finish's the system will reboot again and then if all goes well you will boot up on the Fedora 18 ...

For more help  here are some links : http://fedoraproject.org/wiki/FedUp , http://tech.saos.co.in/post/2013/02/16/upgrade-fedora-17-to-18-using-yum.aspx

To download Fedora : go here http://fedoraproject.org/get-fedora

Hope this article help you guys somehow .. If you guys got any query please drop me some questions  I will very happy to answer them ..

:-) Enjoy

This is another posting showing "how to do computing" for everyday computer usages... For a general public 

How to check for open ports on Linux

Checking for open ports is among the first steps to secure your device. Listening services may be the entrance for attackers who may exploit...