Step-by-step manual to partition HD with LVM

Alexander Skwar listen at alexander.skwar.name
Thu Aug 3 09:19:21 UTC 2006


Stephen Liu <satimis at yahoo.com>:

> Hi Alexander,
> 
> Tks for your advice.
> 
>> Okay - but why do you want to do that? Do you have different hard
>> drives?
> 
> This is a test only, building up my knowledge on installing dual boot
> which I never did it before.
> 
> 
> If only creating 1 VolGroup, would running "apt-get update/upgrade"
> cause confusion???

No. Why should it? VGs are some sort of "disk", so to speak.
apt-get doesn't know anything about disks - it just knows
about directories and files.

> Summing up your advice (hoping that I did not understand it wrong) I
> shall perform following steps on partitioning the HD
> 
> # fdisk /dev/hda
> creating 2 partitions;
> /dev/hda1 255M ext3 as /boot for both OS
> /dev/hda2 remaining space ext3
> 
> 
> # vgcreate vg /dev/hda2
> 
> # lvcreate -L 8G -n FC5Root vg
> # lvcreate -L 10G -n FC5home vg
> # lvcreate -L 1G -n swap vg
> 
> # lvcreate -L 8G -n UbuntuRoot vg
> # lvcreate -L 10G -n Ubuntuhome vg
> # lvcreate -L (restspace) -n data vg
> 
> - swap will be shared
> - /home will not be shared because I'm worrying some files being
> conflict
> - data partition will be for sharing data storage, automatically
> mounted on booting either OS
> 
> 
> # mke2fs -j /dev/vg/FC5Root
> # mke2fs -j /dev/vg/FC5home
> 
> # mke2fs -j /dev/vg/UbuntuRoot
> # mke2fs -j /dev/vg/Ubuntuhome
> # mke2fs -j /dev/vg/data
> 
> 
> Please correct them if I made any mistiakes.  Tks.

Sounds correct.

> Now I come to a roadcross, how to netvigate Ubuntu/FC5 installing
> /boot, /, /home, swap on respective LV.

What do you mean with navigate? You'll mount /dev/vg/UbuntuRoot to
/ in Ubuntu, and then it's there.

But actually, you can create all those Volume Groups and Logical Volumes
and File Systems using the Ubuntu installer from the alternate CD.

> I don't expect install them on 
> the /dev/hdaX partitions first and then copying them to their
> respective LV.

?

You don't install or copy any files to a partition or LV. You'll
always copy files to directories. Directories are contained in filesystems.
Filesystems are stored on Logical Volumes or partitions.

> Please shed me some light.  TIA 
> 
> B.R.
> SL
> 
> 
>  
>> > /dev/hda1 /boot/grub /boot ext3 255MB
>> > 
>> > /dev/hda2
>> > Linux-1
>> > VolGroups00
>> > Primary LogVol / 8G ext3
>> > extended LogVol /home ext3 10G
>> > extended LogVol swap 1G
>> > 
>> > /dev/hda3
>> > Linux-2
>> > VolGroups00
>> > Primary LogVol / 8G ext3
>> > extended LogVol /home ext3 10G
>> > swap partition will be shared
>> 
>> I don't understand that. What's that supposed to show? hda3 and
>> then something about a Primary LogVol? I don't get it.
>> 
>> > In my present situation I can tolerate as follows if not necessary
>> to
>> > delete the partitions;
>> > 
>> > /dev/hda1 /boot/grub /boot ext3 255MB
>> > 
>> > /dev/hda2
>> > VolGroups00
>> > (for Linux-1)
>> > Primary LogVol / 8G ext3 
>> > extended LogVol /home ext3 10G
>> > extended LogVol swap 1G
>> > 
>> > (for Linux-2)
>> > Primary LogVol / 8G ext3
>> > extended LogVol /home ext3 10G
>> > swap partition will be shared
>> > 
>> > Please advise.  TIA
>> 
>> I don't understand.
>> 
>> You said, you want to  dual boot linux/linux. In this case, I'd 
>> create *ONE* Volume Group. I'd make this VG out of just ONE Physical
>> Volume /dev/hda2.
>> 
>> In the VG, I'd then create Logical Volumes as necessary.
>> 
>> Suppose you'd install Fedora Core 5 and Ubuntu, I'd create the
>> following LVs:
>> 
>> - FC5Root
>> - FC5USR
>> - FC5Var
>> - FC5Opt
>> 
>> - UbuntuRoot
>> - UbuntuUSR
>> - UbuntuVar
>> - UbuntuOpt
>> 
>> - Home
>> - Swap
>> 
>> I'd actually name them EXACTLY this way. 
>> 
>> Alexander Skwar
>> -- 
>> Ein Dichter hat zwar die schnellsten Irrtümer, aber auch dafür die
>> schnellsten Bekehrungen. Andere haben keinen Standort, um ihre Fehler
>> zu übersehen, die sich von einem Tal ins andere verlieren.
>>                 -- Jean Paul (eig. Johann Paul Friedrich Richter)
>> 
>> 
>> 
>> -- 
>> ubuntu-users mailing list
>> ubuntu-users at lists.ubuntu.com
>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>> 
> 
> 

Alexander Skwar
-- 
The complexity of software is an essential property, not an accidental one.
Hence, descriptions of a software entity that abstract away its complexity
often abstract away its essence.
- Fred Brooks, Jr.






More information about the ubuntu-users mailing list