Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
About installing LVM
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
waydaws
n00b
n00b


Joined: 15 Mar 2004
Posts: 17
Location: Vancouver, BC Canada

PostPosted: Sun Mar 28, 2004 8:00 am    Post subject: About installing LVM Reply with quote

Well, some people are going to be newbies like me, and will want to install gentoo using LVM too.

My efforts may be of some use. What I did (based on articles found here), was the following. I left my mistakes in the following. If someone has any suggestions about what I perhaps should have done differently, please let me know. Sorry about the line wraps. Thx .

1) To Start boot from Universal CD.

2)After networking is set up (dhcp), check
ifconfig eth0 192.168.101,
and then ping gateway, and my windows machine.

3)Change root password.

4) Use ssh:
a) Start up sshd from root dir (/), /etc/init.d/sshd start.

b) Go to windows machine and start up my ssh client, configure to
connect to 192.168.1.101 (nb set damn backspace key to delete),
and login as root.

Why this way? So I can browse gentoo site using gui browser instead of the text based links browser while doing the install. Besides, I don't plan to use it much longer -- just until I get a desktop env running on my gentoo notebook. Yeah it's an ibm TP T22.

5) Run fdisk to set up partitions (nb type 8e is for Linux LVM). Decided to use 4 primary partions since most every thing will be in LVM.

Partition Table: boot 100M (mark as active), Swap 512M (type 82), root 250M, & rest is LVM (type 8e):

Disk /dev/hda: 20.0 GB, 20003880960 bytes
240 heads, 63 sectors/track, 2584 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 14 105808+ 83 Linux
/dev/hda2 15 81 506520 82 Linux swap
/dev/hda3 82 114 249480 83 Linux
/dev/hda4 115 2584 18673200 8e Linux LVM

6) Activate and Initialize LVM partitions:
run vgscan (to activate LVM), and pvcreate (to initialize partition):
livecd root # vgscan
Reading all physical volumes. This may take a while...
/dev/cdrom: open failed: Read-only file system
No volume groups found

livecd root # pvcreate /dev/hda4
No physical volume label read from /dev/hda4
Physical volume "/dev/hda4" successfully created

7) Set up the volume group. Vgcreate is going to need the full (DevFS-style) path to the device file (assuming one is using devfs).

a)Find out the the device file for our lvm:
livecd root # ls -l /dev/hda4
lr-xr-xr-x 1 root root 33 Mar 26 02:32 /dev/hda4 -> ide/host0/bus0/target0/lun0/part4

b) Create the volume group, here named "NoStripeVG":
livecd root # vgcreate NoStripeVG /dev/ide/host0/bus0/target0/lun0/part4
/dev/cdrom: open failed: Read-only file system
/dev/cdrom: open failed: Read-only file system
/dev/cdrom: open failed: Read-only file system
Volume group "NoStripeVG" successfully created

Well I'm not sure why it's trying to add the CDROM drive, but it won't
get added anyway, so I'm going to ignore the message.


c) Now create the logical volumes:

i) The plan is to do it this way:
/usr - 7.5G
/home - 4.5G
/opt - 2G
/var - 2G
/tmp - 2G (or whatever is left)

ii ) How to create: The command is "lvcreate -LsizeMB -nmylv myvg (replace sizeMB with partition size in MB, mylv with the logical volume (partition) name, and myvg with the volume group name):

iii) Log of steps (with my mistakes):
livecd root # lvcreate -L7680 -nusrLV NoStripeVG
/dev/cdrom: open failed: Read-only file system
/dev/mapper/control: open failed: No such file or directory
Is device-mapper driver missing from kernel?
Failed to activate new LV.

Looking at error ... well lets look at whether dev/dev/mapper is there:
livecd root # ls -l /dev | grep mapper
Got nothing.

Let's load device mapper as a module.
livecd root # modprobe dm-mod
No errors returned; good.
(Probably should have done this first.)

livecd root # lvcreate -L7680 NoStripeVG
/dev/cdrom: open failed: Read-only file system
Logical volume "lvol0" created
Finally.

Wait, I didn't want to name it lvol0. Damn.

Looked up how to delete it. It says, "First, unmount filesystem (if it is mounted - obviously not mounted in my case). Next, deactive it with lvchange and finally delete it with lvremove."

livecd root # ls /dev/No*
lvol0

livecd root # lvchange -a n /dev/NoStripeVG/lvol0
/dev/cdrom: open failed: Read-only file system

livecd root # ls /dev/No*
ls: /dev/No*: No such file or directory

livecd root # lvremove -f /dev/NoStripeVG/lvol0
/dev/cdrom: open failed: Read-only file system
Logical volume "lvol0" successfully removed

Good. Let's try it again. Back to the LV creation:

livecd root # lvcreate -L7680 -nusrLV NoStripeVG
/dev/cdrom: open failed: Read-only file system
Logical volume "usrLV" created

livecd root # lvcreate -L4608 -nhomeLV NoStripeVG
/dev/cdrom: open failed: Read-only file system
Logical volume "homeLV" created

livecd root # lvcreate -L2048 -noptLV NoStripeVG
/dev/cdrom: open failed: Read-only file system
Logical volume "optLV" created

livecd root # lvcreate -L2048 -nvarLV NoStripeVG
/dev/cdrom: open failed: Read-only file system
Logical volume "varLV" created

livecd root # lvcreate -L2048 -ntmpLV NoStripeVG
/dev/cdrom: open failed: Read-only file system

Insufficient free extents (462) in volume group NoStripeVG: 512 required
Hmmm, maybe I shouldn't have been multiplying by 1024? Let's see how much free space I have:

livecd root # pvscan
/dev/cdrom: open failed: Read-only file system
PV /dev/hda4 VG NoStripeVG lvm2 [17.80 GB / 1.80 GB free]
Total: 1 [1.80 GB] / in use: 1 [1.80 GB] / in no VG: 0 [0 ]

1.8G is close enought for me ;^) This is a volume group after all.

livecd root # lvcreate -L1843 -ntmpLV NoStripeVG
/dev/cdrom: open failed: Read-only file system
Rounding up size to full physical extent 1.80 GB
Logical volume "tmpLV" created

iv) Let's check:
livecd root # ls /dev/NoStripeVG
homeLV optLV tmpLV usrLV varLV


Well now I can get back to installing. Off to put some filesystems on this. I'm thinking reiser for everything? Maybe I should stick to ext3 on my root and boot. Well, I'll think it over first after searching google.

Later...
Back to top
View user's profile Send private message
arkane
l33t
l33t


Joined: 30 Apr 2002
Posts: 918
Location: Phoenix, AZ

PostPosted: Tue Apr 27, 2004 7:04 pm    Post subject: Reply with quote

This helped out alot today. I was trying for the first time in like 2 years to install on LVM, and the livecd is so much different now. Thanks alot for showing how to get LVM working.

I didn't have the time to hack through it, honestly...
Back to top
View user's profile Send private message
pharaoh
Apprentice
Apprentice


Joined: 20 Nov 2003
Posts: 211
Location: Pennsylvania

PostPosted: Thu Oct 07, 2004 1:29 am    Post subject: Reply with quote

This was helpful. Here's a link to Gentoo's howto on this...between the two pages this was pretty easy!

http://www.gentoo.org/doc/en/lvm2.xml
_________________
RYZEN 5 3600 Matisse (Zen 2) 6-Core 3.6 GHz Socket AM4 65W
ASRock B550M PRO4
Crucial Ballistix 3200 MHz DDR4 DRAM 16GB
EVGA GeForce GTX 1060 6GB
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum