1822992 Members
3849 Online
109645 Solutions
New Discussion юеВ

Re: Alter capacity

 
CDADDY
Advisor

Alter capacity

We use hard drives of varying capacity, 2 Gig, 4 Gig, 9 Gig and 18 Gig. There are times when we have a need for a smaller, unused drive but have none available. I understand that a drive can be made to act as a smaller drive. For example, a 9 Gig drive can be made to perform as a 2 Gig drive, but can, when needed, be altered to perform again as a 9 Gig. The ├в df -k├в command shows this to be true. How can this be
12 REPLIES 12
Fabio Ettore
Honored Contributor

Re: Alter capacity

Hi Charles,

what is the command which shows that to be true?
Command has not recognized from forum...Can you post it again?

Best regards,
Ettore
WISH? IMPROVEMENT!
CDADDY
Advisor

Re: Alter capacity

The command is df -k. I used quotes in the original message.
Robert-Jan Goossens
Honored Contributor

Re: Alter capacity

Charles,

could you run bdf command and post the result ?

Robert-Jan
Rory R Hammond
Trusted Contributor

Re: Alter capacity

Charles.

If I understand your question.

When you create a Volume Group, via sam, It will set the volume group PE size to match your Hard Drive size.

If you create a Volume Group using a 2 gig hard drive. The System does not dynamiclly allocted PE past the 2 gig limit of your 2 gig Hard Drive. So, when you add a 9 or 18 gig drive to a Volume Group, with a small PE size, You will get an error message Telling it can't use all of the drives Disk space.

The trick is to set a large PE Size. When creating a Volume Group you have the option to set the PE to large number.
You can also create a Volume group using an 18 gig drive.(That way you will know how many PE it uses without calculating it). Then you can added smaller disks to the group. You can also migrate logical volumes from a large disk in your volume group to a smaller drive (space permiting ) and remove the Large disk from the volume group. Then you would be able to added disk 18,9,4 and 2 gig drives to the volume group.

There are a 100 ways to do things and 97 of them are right
Sridhar Bhaskarla
Honored Contributor

Re: Alter capacity

Hi,

There isn't a good way of doing it. With LVM, you will need to make sure you set the maxPE and PE Size that will allow only 2 GB PV (maxPE * PE Size = 2 GB) in that volume group.

For non-LVM disks, you can create a 2GB HFS filesystem on the disk by specifying the size

For ex.,

mkfs -F hfs /dev/rdsk/cxtydz 2048000
mount /dev/dsk/cxtydz /mount_point


-Sri
You may be disappointed if you fail, but you are doomed if you don't try
CDADDY
Advisor

Re: Alter capacity

The bdf command on one of our 4.5 Gig disks shows:
kbytes used
/dev/vg00/lvol1 47829 14337
/dev/vg00/lvol3 83733 48401
/dev/vg00/lvol4 299157 946
/dev/vg00/lvol5 1994709 1220493
/dev/vg00/lvol6 30597 28
/dev/vg00/lvol7 510613 408853
/dev/vg00/lvol8 491869 350750
which has its full capacity in use.

We have a 9 Gig hard drive, which had been altered to act as a 2 Gig drive, leaving 7 Gig completely unusable. Someone said he could reset the drive to make all 9 Gig useable again, which he did by use, he said, of a ├в program├в . Would this be a firmware change?

We have used lvextend and extendfs to increase the capacity of filesystems, but the change I seek comes before ANY system is put on the disk or regardless of what is on the disk. This change may run a format of a sort. The SAM utility does not come into play.

We use what we call a ├в clone machine├в to copy one hard drive to another, for backup, restoration or testing. This machine will ├в see├в what the capacity of a disk is, regardless of what info is on the disk. This machine showed that the disk whose model number indicated 9 Gig was, in fact, only a 2 Gig, until after the ├в prog
RAC_1
Honored Contributor

Re: Alter capacity

If I understood your question correctly, you can do that.

while including a disk in vg, you can use pvcreate -s "sizeofdisk" option. Disk will be treated as of the size that you used on pvcreate.

But later on if you want to use it to the full size, you will have to backup, then remove pv from vg, again do a pvcreate without -s and include it in vg.

Gurus, correct me if Iam wrong here.

Check man page of pvcreate.
There is no substitute to HARDWORK
Bill Hassell
Honored Contributor

Re: Alter capacity

I'm sort of confused as to why you want to mess with this strange (very non-standard) method of allocating disk space. That's what LVM does. You start with a 9Gb disk, then you break it up into smaller pieces called logical volumes. Whether you use all of the disk to create the lvols is up to the system manager. Unallocated space is never available to users (unless you have bad permissions on the device files). If you need 2Gb of space, you simply use lvcreate to make a lvol that is 2Gb in size.


Bill Hassell, sysadmin
CDADDY
Advisor

Re: Alter capacity

We have certain systems that cannot be installed on hard drives larger than 2 GB and vendors are phasing out 2 GB drives. A utility was written to alter how large a hard drive appears to a system. Two numbers, which determine hard disk size, are written in memory. These numbers are the total block count and the number of bytes per block. Multiplying these two numbers together results in the total drive size in bytes. Using SCSI commands the utility is able to read from and write to the area of memory that stores these numbers, giving it the ability to adjust the size of the hard drive. Alering drive size has been accomplished with these routines.
Sanjay_6
Honored Contributor

Re: Alter capacity

Hi Charles,

Are you talking about filesystem of 2GB. I've never heard of apps that don't get installed on systems with hard disk more than 2GB. df -k output results in the size of filesystems and their current utilization. Maybe what you are trying to say that you need filesystems of 2GB or less.

Hope this helps.

Regds
CDADDY
Advisor

Re: Alter capacity

Not quite. For example, we could only get a 9 GB disk to install one of these special systems on. Being too large, we ran the utility on it and made it a 2 GB drive by altering block count and/or number of bytes per bock. We use a compiled program and do not have access to the source code, but the routine DOES work. We have a copy (clone) machine that we use from time to time. This copy machine ├в sees├в all available space on a disk. The space the copy machine sees on a 9 GB drive at full capacity is proportionately more than when it is cut to 2 GB. If we want to use the drive for something that requires 9 GB, the utility will return it to full capacity. Volume groups and other disk space descriptors are NOT considered with this utility. Any files on the disk will be lost when this utility i
Sanjay_6
Honored Contributor

Re: Alter capacity

Hi,

How about creating a 2GB logical volume and let the app use the raw device for the lv rather than the reference to a physical disk.

instead of /dev/rdsk/cxtydz

use /dev/vgxx/rlvoly

here lvoly is a 2GB lv.

Hope this helps.

Regds