LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-11-2007, 05:04 PM   #1
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Rep: Reputation: 34
Question LVM in slack 12.0 HOW TO--help


hello group.. check this :

http://slackware.osuosl.org/slackwar...README_LVM.TXT

i need some newbie help. . .

accdg to the file :

Quote:

We are going to 'chroot' into our fresh installation and setup the LVM device
nodes which lilo needs in order to install successfully. While we are
chrooted anyway, we will use the opportunity to create a initial ramdisk image
(initrd) which is required for a root filesystem which is created on LVM.
Run the following commands to "bind" mount the proc and sys filesystems in the
chroot, do the actual chroot and finally create the LVM device nodes:

# mount -o bind /proc /mnt/proc

# mount -o bind /sys /mnt/sys

# chroot /mnt

# vgscan --mknodes

question is. .. after opening a new console.. how will i do the chroot?

sorry for being noob... will i just do the instruction as said sequentially? ? or will i do the chroot first? kinda confused here
 
Old 07-15-2007, 07:57 AM   #2
chris_g_g
LQ Newbie
 
Registered: Jul 2007
Distribution: Slackware
Posts: 4

Rep: Reputation: 0
Hi!
You should pretty much follow what the readme says.

Short answer: do the chroot while setup is running in another console/virtual terminal.

Here is my overview of how to put those specific instructions into context of the whole install.
  1. Boot from CD.
  2. Setup your PV's, VG's and LV's how you want them.
  3. Run vgscan and vgchange as suggested. This lets the rest of the booted CD "see" your new LV's.
  4. Run setup and follow the prompts, setting up mountpoints to your new LV's.
  5. When you get to the bit about installing lilo, switch to another console (Alt+F2 or whichever). Do the chroot stuff. Also do the initrd stuff if it applies to you.
  6. Exit the chroot, switch back to the running 'setup' program (Alt+F1) and continue as normal.

I'm afraid I can't give a truly step-by-step account of what to do as I deviated a bit from the instructions (I wanted grub instead of lilo, didn't want my root partition in LVM and didn't want to use an initrd).
 
Old 07-15-2007, 10:03 AM   #3
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Original Poster
Rep: Reputation: 34
okay. . .il update this post once i am done.. noted with THANKS
 
Old 07-18-2007, 12:18 AM   #4
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Original Poster
Rep: Reputation: 34
UPDATE :

ok so im here : but an error occurred :


from the readme file it says :
Quote:

# pvcreate /dev/sda1

# vgcreate myvg /dev/sda1

# lvcreate -L 5G -n root myvg

# lvcreate -L 3G -n usr myvg
on my side :

i have set up my LV partitions to /dev/hdc5 -- for my root
/dev/hdc10 -- for usr and /dev/hdc11 for home

/dev/hdc --- my entire HD


when i did :

pvcreate /dev/hdc


error : no /dev/hdc found (ignored or filtered)

**** so how's that? *****

PLUS i want to use the entire capacity of my partitions for the lv size so, i think il no longer use the " -L option" right? hmm so wat would i replace instead? is it the "l" option? accdg. to :

http://linux.die.net/man/8/lvcreate

the option l - pertains to :
-l, --extents LogicalExtentsNumber[%{VG|FREE}]
Gives the number of logical extents to allocate for the new logical volume. This can also be expressed as a percentage of the total space in the Volume Group with the suffix %VG or of the remaining free space with the suffix %FREE.


sorry for being noob but i cant get it..

Last edited by ic_torres; 07-18-2007 at 01:04 AM.
 
Old 07-20-2007, 12:59 PM   #5
chris_g_g
LQ Newbie
 
Registered: Jul 2007
Distribution: Slackware
Posts: 4

Rep: Reputation: 0
fdisk first

Quote:
Originally Posted by ic_torres
i have set up my LV partitions to /dev/hdc5 -- for my root
/dev/hdc10 -- for usr and /dev/hdc11 for home

/dev/hdc --- my entire HD
I'm a bit confused - you say you have set up LV's on hdc5, 10 and 11 but you haven't yet created any PV's so creating LV's is impossible.

What I think you want to do is:
use all of hdc for LVM and create VG's for /usr, /home and / (root).
If this is wrong, I'll probably be sending you the wrong way!

Anyway, just to run through from the beginning... you need to partition your disk before trying to create anything to do with LVM.
So, using fdisk (or cfdisk if you prefer), create one huge partition and change its type from 83 (linux partition) to 8e (linux LVM partition). In your case this will make /dev/hdc1 and it will cover the whole disk.
If you want to make any swap space or regular partitions that aren't in LVM, do them here and adjust the following accordingly.
Do 'pvcreate' on hdc1.
Then do 'vgcreate' to make your big VG e.g. vgcreate vg00 /dev/hdc1.
Then make your various LV's e.g. lvcreate -n usr -L 5G vg00.

I honestly can't remember now if you have to format the LV's (with ext2/3, xfs, reiserfs, etc) or whether that gets done for you in 'setup'.

---------------------
To give you some context, here's my setup (one 500GB SATA disk). It may help, it may not!!

Code:
root@slack# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          12       96358+  83  Linux
/dev/sda2              13         136      996030   82  Linux swap
/dev/sda3             137         260      996030   83  Linux
/dev/sda4             261       60801   486295582+  8e  Linux LVM
My sda1 is real small and contains /boot (I like to keep kernels on their own, don't know why!). It is ext2.
sda2 is swap. sda3 is / (root) and is ext3.
sda4 is for my PV.

Code:
root@slack# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda4
  VG Name               vg
  PV Size               463.77 GB / not usable 0
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              118724
  Free PE               107716
  Allocated PE          11008
  PV UUID               2YIEMm-Nkhq-qClp-B2WE-KkCr-jFmq-UFsq0L
This is the only PV in my VG.

Code:
root@slack# vgdisplay
  --- Volume group ---
  VG Name               vg
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  6
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                4
  Open LV               4
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               463.77 GB
  PE Size               4.00 MB
  Total PE              118724
  Alloc PE / Size       11008 / 43.00 GB
  Free  PE / Size       107716 / 420.77 GB
  VG UUID               bDmQv5-iy9Z-0iSu-oz4t-pB7w-8ym5-v0uJBT
As you can see, lots of space left!

I currently have /usr, /var, /tmp and /home set up as LV's (no need for this many, I just wanted to play!).
Code:
root@slack# lvdisplay
  --- Logical volume ---
  LV Name                /dev/vg/usr
  VG Name                vg
  LV UUID                Q3Jc1T-MQRh-60ZH-hEwO-OVVy-WN89-Ov2bPW
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                5.00 GB
  Current LE             1280
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:0

  --- Logical volume ---
  LV Name                /dev/vg/var
  VG Name                vg
  LV UUID                ReV7nw-mTdd-L0jG-jaix-GImy-p8G9-6YP3em
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                3.00 GB
  Current LE             768
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:1

  --- Logical volume ---
  LV Name                /dev/vg/tmp
  VG Name                vg
  LV UUID                ACG9tL-mL2d-Y2XW-NfBK-8lZp-DLVE-X6IJ5Z
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                5.00 GB
  Current LE             1280
  Segments               2
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:2

  --- Logical volume ---
  LV Name                /dev/vg/home
  VG Name                vg
  LV UUID                0xajHB-9ftd-Vymf-pciW-CwE6-UVM3-528exF
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                30.00 GB
  Current LE             7680
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:3
You can see /tmp uses 2 segments. That's because I already grew it once from 2GB to 5GB. All my LV's are formatted with XFS so to grow I simply use 'lvextend' and 'xfs_growfs'.

Sorry for the huge post, hope this helps!
 
Old 07-22-2007, 03:35 AM   #6
ic_torres
Member
 
Registered: Nov 2005
Location: ABAP
Distribution: slackware 12.0, Vector Linux STD 6.0 and 5.8, ZenWalk 4.6.1, OpenBSD 3.9
Posts: 389

Original Poster
Rep: Reputation: 34

ok sir.. hmm i think I was really mistaken here.. I MUST HAVE a new partition instead of doing it by chunks (hdc5 with 5G space already set.. etc.. )

I will be creating a new PV in the remaining 14G space of my logical partition.. il update this thread as soon as i finished my "lvm trial project"

THANKS..

CHEERS..


 
Old 07-24-2007, 02:34 PM   #7
chris_g_g
LQ Newbie
 
Registered: Jul 2007
Distribution: Slackware
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by ic_torres
ok sir.. hmm i think I was really mistaken here.. I MUST HAVE a new partition instead of doing it by chunks (hdc5 with 5G space already set.. etc.. )
Chunks are fine but they must be dedicated solely to LVM.

If you create a PV on a partition it will take 100% of that space. Doesn't matter how big it is.

When you add one or more PV's to a volume group, the size of the individual partitions gets "lost". All that matters is the total size of the VG.
For LVM, at the fdisk level just ask yourself how much space you want to put into your VG.
When you have finished adding partitions to the VG, then move on to choosing how much space /usr, /home and so on need.

Good luck with your trials!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to change non-LVM to LVM? darthfoolish Linux - Software 2 08-01-2008 03:47 AM
LXer: Back Up (And Restore) LVM Partitions With LVM Snapshots LXer Syndicated Linux News 0 04-17-2007 11:16 AM
Slack 10.2 slack 10.2 ran xserver after all on sata with via board devafree LinuxQuestions.org Member Success Stories 5 05-30-2006 11:54 PM
Slack/Fedora dual-boot using LVM Phaete Fedora 3 04-14-2005 04:13 PM
Slack 9.1/LVM 1.08/2.6.6 mtdewisgoodforu Slackware 2 06-16-2004 10:03 AM


All times are GMT -5. The time now is 01:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration