1833625 Members
3778 Online
110062 Solutions
New Discussion

Partions on Disk

 
SOLVED
Go to solution
Girish_17
Regular Advisor

Partions on Disk

Hi friends,
Is there any way of creating two partitions on a single disk (internal)?
If yes ...how do i do it!!!
Thanks in advance.
Regards,
Girish
14 REPLIES 14
MarkSyder
Honored Contributor

Re: Partions on Disk

I take it we're talking about filesystems.

If you've not created a new filesystem before I would advise you to use sam.

Provide us with details of bdf -il, tell us what you want the new filesystem to be for, and you'll get pleny of help here.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Robert-Jan Goossens
Honored Contributor

Re: Partions on Disk

Hi,

LVM - logical volume manager

internal as in vg00 ?

# vgdisplay -v vg00
# lvcreate -L size_in_mb -n lvolx /dev/vg00
# newfs -F vxfs /dev/vg00/rlvolX

or use sam.

Regards,
Robert-Jan
Naveej.K.A
Honored Contributor

Re: Partions on Disk

Girish,

2 logical volumes??

Yes possible

pvcreate -f /dev/rdsk/cXtYdZ
mkdir /dev/vgtest
mknod /dev/vgtest/group c 64 0x070000
vgcreate vgtest /dev/dsk/cXtYdZ
lvcreate vgtest
lvcreate vgtest

now 2 logical volumes have been created
/dev/vgtest/lvol1 and lvol2

create lvol1 with 100 MB and lvol2 with 200MB

lvextend -L 100 /dev/vgtest/lvol1
lvextend -L 200 /dev/vgtest/lvol2

Activate VG
vgchange -a y /dev/vgtest

create filesystems:
mkfs -F vxfs -o largefiles /dev/vgtest/lvol1
mkfs -F vxfs -o largefiles /dev/vgtest/lvol2

Create mountpoints:
mkdir /dir1 /dir2

Mount the filesystems:
mount -F vxfs -o largefiles /dev/vgtest/lvol1 /dir1
mount -F vxfs -o largefiles /dev/vgtest/lvol2 /dir2


Regards,
Naveej
practice makes a man perfect!!!
Alex Lavrov.
Honored Contributor

Re: Partions on Disk

And after you do all this, don't forget to add them to /etc/fstab so they will be mounted next time you boot.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Robert-Jan Goossens
Honored Contributor

Re: Partions on Disk

as an add on.

don't forget to add the filesystems in the /etc/fstab.

so as an example. create new filesystem /rob

# lvcreate -L 100 -n lvol8 /dev/vg00
Logical volume "/dev/vg00/lvol8" has been successfully created with
character device "/dev/vg00/rlvol8".
Logical volume "/dev/vg00/lvol8" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.cof
# newfs -F vxfs /dev/vg00/rlvol8
version 3 layout
102400 sectors, 102400 blocks of size 1024, log size 1024 blocks
unlimited inodes, 102400 data blocks, 101280 free data blocks
4 allocation units of 32768 blocks, 32768 data blocks
last allocation unit has 4096 data blocks
first allocation unit starts at block 0
overhead per allocation unit is 0 blocks
# mkdir /rob
# mount /dev/vg00/lvol8 /rob
# bdf /rob
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol8 102400 1133 94945 1% /rob

add to the /etc/fstab
/dev/vg00/lvol8 /rob vxfs defaults 0 2

Regards,
Robert-Jan
Girish_17
Regular Advisor

Re: Partions on Disk

Thanks a lot for your answer but i think it's my mistake of not making the question clear.

I actually mean Physically partitioning the disk.
e.g. i have one disk /dev/dsk/c0t0d0

when i do "pvcreate /dev/dsk/c0t0d0" i get one LUN i.e one Physical Volume and this is what i am calliing it as partition.

Finally is it possible to have two PV's on a single disk??

Regards,
Naveej.K.A
Honored Contributor
Solution

Re: Partions on Disk

Hi,

Not possible on a sigle device file.

Regards,
Naveej
practice makes a man perfect!!!
Alex Lavrov.
Honored Contributor

Re: Partions on Disk

No, it's not possible. One physical disk (LUN in your case) can belong to only one vg.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Mark Nieuwboer
Esteemed Contributor

Re: Partions on Disk

A simple answer NO
it cant be done.
you can have only one disk device for every disk.
Pravin Salgaonkar
Frequent Advisor

Re: Partions on Disk

no
again repeating the sane but its not possible
regards
Pravin
Suraj Singh_1
Trusted Contributor

Re: Partions on Disk

Well, the answer is NO as long as the disk is connected to a simple SCSI/IDE controller.

But, if you have a hardware RAID controller, you can access the RAID utility, and make two logical drives on this disk. Then the OS will see two disks, and you will be able to create 2 VGs.

Hope i am clear...

Regards,
Suraj
What we cannot speak about we must pass over in silence.
Bernhard Mueller
Honored Contributor

Re: Partions on Disk

Girish,

the answer is YES,

IF you are on HP-UX 11.23

man idisk

In fact you *need to* partition the disks to mirror your internal boot disks on an Itanium machine.

You can also use idisk to slice other disks and put individual slices (partitions) into into different VGs like you do with the entire disks on HP-UX 11.11.

This is a nice feature but bears some complications regarding the event of a disk failure....

Regards,
Bernhard

Senthil Kumar .A_1
Honored Contributor

Re: Partions on Disk

Hi Girish,

I agree with Bernhard Mueller ,

I have tried this in itanium, but i tried finding for post 9.X HPUX for PA-RISC but failed.

So to your question, The answer is yes as before.


Lets assume that your disk is 34 GB and u wanna make it 3 parts of 10 GB each,..then do as follows...lets say the device file is /dev/[r]dsk/c1t2d0...idisk is a interactive command. First answere yes ,when prompted if the data will be destroyed.


#idisk -w -f - /dev/rdsk/c1t2d0
4
EFI 100MB
HPUX 10000MB
HPUX 10000MB
HPUX 10000MB


I think you can use "3" instead of "4" and omit the "EFI" line, but i din't try that.

After issue of the above command, you need to get the hardware path of the disk "ioscan -funC disk"...

then

#insf -e -H "H/W path"

ex H/w path : 0/3/2/5/2.0.1.2

Then do ioscan -funC disk , VOILA..you will have the following files...
/dev/[r]dsk/c1t2d0s0
/dev/[r]dsk/c1t2d0s1
/dev/[r]dsk/c1t2d0s2
/dev/[r]dsk/c1t2d0s3

Do

#diskinfo "on all the newly created raw device files and you can confirm the size".

So the statement "a disk can only belong to one VG" ....hahaha..... its bursted as a myth atleast in itanium servers. I will try something for PA-RISC OS version...wish me luck......

Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Girish_17
Regular Advisor

Re: Partions on Disk

It's amazing to see both answer YES|NO...actually i had made up my mind with "NO" becuase i was also thinking the same.

Well Bernhard and Senthil kumar have cracked the funda with the idisk utility :). Well i am going to try that one and hopefully it should work.

Well, point assignment was too early so both answers enjoys the rabbit....

Regards,
Girish..