07-09-2008
zaxxon as well as johnf are correct: you probably have to make sure nothing is accessing the disk, which is probably not possible because it is part of a volume group and hence accessed - not by a user process but the filesystem driver.
Find out if this is the case ("lsvg -p rootvg") and - if you are doing this for testing purposes - better don'tproceed.
If you really have to do it: use "reducevg" to get the disk out of the VG, then try the "chdev" command again.
I hope this helps.
bakunin
9 More Discussions You Might Find Interesting
1. AIX
I want to write a script in ksh that will delete file that are more than 2 weeks old. (4 Replies)
Discussion started by: jango
4 Replies
2. UNIX for Advanced & Expert Users
I recently had a disk crash and was not able to clean the dump lv off the disk. Now trying to create new lvdump I am running into errors.
My question is how do I remove the old lv out of the ODM? I have tried going through smit and also just rmlv and it cannot find the lv. Yet when I run lslv on... (0 Replies)
Discussion started by: Wamland
0 Replies
3. Shell Programming and Scripting
I have a script which would monitor a given directory and delete any files which are older than 10 days. I was going to set the 10 crob jobs to perform this operation for 10 different directories (some are actually sub-directories), but my boss doesn't like that idea, so I need to do that in one... (1 Reply)
Discussion started by: mpang_
1 Replies
4. UNIX for Advanced & Expert Users
BeginDate 07/01/06
End: 07/31/06
Cust: A02991 - Burnham
0002000 5,829,773 145.3
0009701 4,043,850 267.3
2005000 286,785.13 100.0
BeginDate 07/01/06
End: 07/31/06
Cust: A01239 - East Track PSE
Index A
0009902 317,356.82 890.2
0020021 ... (5 Replies)
Discussion started by: kris01752
5 Replies
5. Shell Programming and Scripting
hi all,
i need to write a script. it should be able to clean the /etc/hosts file like this:
first field is the ip (what else ;))
second field is the fqdn (full qualified domain name)
third field is the hostname
the fourth to n'th field is the rest.
i hope you understand what is needed?... (5 Replies)
Discussion started by: DukeNuke2
5 Replies
6. UNIX for Dummies Questions & Answers
UNIX amature/novice. I've written a script (it works) that needs to be cleaned up. I'm searching for a way to perform a "go to , perform this then return" section of code. The books I have and searches i"ve done so far do not show me how to do this. I've pasted in the current code below. I've... (1 Reply)
Discussion started by: scanner248
1 Replies
7. Shell Programming and Scripting
Hello guys,
this script partially works but it's still pretty ugly and, moreover, if the month is jan/feb/mar... it doesn't work at all.
Could anyone say me how to correct, cut and clean a little bit?
#!/usr/bin/ksh
egrep -v -e "^\s*#" /file/permission | awk '{ print $1 }' | sort | uniq... (3 Replies)
Discussion started by: gogol_bordello
3 Replies
8. UNIX for Advanced & Expert Users
Hi
i have a perl script that i use to clean up empty folders on our server.
I need to make a amendment to this to exclude certain folders. Folders are invisible to end users but must not be cleaned up by this script.
folders i need protecting have unique names
.Highres
.HighresF
.Lowres... (0 Replies)
Discussion started by: treds
0 Replies
9. Shell Programming and Scripting
Hi
I just want to clean up the space in UNIX. Is there any special command that does this process or do I need to manually type the following
rm <filename>
Any help would be really appreciated. Thanks (2 Replies)
Discussion started by: bobby1015
2 Replies
LEARN ABOUT REDHAT
pvcreate
PVCREATE(8) System Manager's Manual PVCREATE(8)
NAME
pvcreate - initialize a disk or partition for use by LVM
SYNOPSIS
pvcreate [-d|--debug] [-f[f]|--force [--force]] [-y|--yes] [-h|--help] [-v|--verbose] [-V|--version] PhysicalVolume [PhysicalVolume...]
DESCRIPTION
pvcreate initializes PhysicalVolume for later use by the Logical Volume Manager (LVM). Each PhysicalVolume can be a disk partition, whole
disk, meta device, or loopback file. For DOS disk partitions, the partition id must be set to 0x8e using fdisk(8), cfdisk(8), or a equiva-
lent. For whole disk devices only the partition table must be erased, which will effectively destroy all data on that disk. This can be
done by zeroing the first sector with:
dd if=/dev/zero of=PhysicalVolume bs=512 count=1
Continue with vgcreate(8) to create a new volume group on PhysicalVolume, or vgextend(8) to add PhysicalVolume to an existing volume group.
OPTIONS
-d, --debug
Enables additional debugging output (if compiled with DEBUG).
-f, --force
Force the creation without any confirmation. You can not recreate (reinitialize) a physical volume belonging to an existing volume
group. In an emergency you can override this behaviour with -ff. In no case case can you initialize an active physical volume with
this command.
-s, --size
Overrides the size of the physical volume which is normally retrieved. Useful in rare case where this value is wrong. More useful
to fake large physical volumes of up to 2 Terabyes - 1 Kilobyte on smaller devices for testing purposes only where no real access to
data in created logical volumes is needed. If you wish to create the supported maximum, use "pvcreate -s 2147483647k PhysicalVolume
[PhysicalVolume ...]". All other LVM tools will use this size with the exception of lvmdiskscan(8)
-y, --yes
Answer yes to all questions.
-h, --help
Print a usage message on standard output and exit successfully.
-v, --verbose
Gives verbose runtime information about pvcreate's activities.
-V, --version
Print the version number on standard output and exit successfully.
Example
Initialize partition #4 on the third SCSI disk and the entire fifth SCSI disk for later use by LVM:
pvcreate /dev/sdc4 /dev/sde
DIAGNOSTICS
pvcreate returns an exit code of 0 for success or > 0 for error:
1 no physical volume on command line
2 error removing existing lvmtab entry for new physical volume
3 error setting up physical volume structure
4 error writing physical volume structure to disk
5 wrong partition type identifier
6 error physical volume name
7 error getting size of physical volume
95 driver/module not in kernel
96 invalid I/O protocol version
97 error locking logical volume manager
98 invalid lvmtab (run vgscan(8))
99 invalid command line
SEE ALSO
lvm(8), vgcreate(8), vgextend(8), lvcreate(8), cfdisk(8), fdisk(8), losetup(8), mdadd(8)
AUTHOR
Heinz Mauelshagen <Linux-LVM@Sistina.com>
Heinz Mauelshagen LVM TOOLS PVCREATE(8)