Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

11.1. Initializing disks or disk partitions

Before you can use a disk or disk partition as a physical volume you will have to initialize it:

For entire disks:

  • Run pvcreate on the disk:
    # pvcreate /dev/hdb
                         
    This creates a volume group descriptor at the start of disk.

  • If you get an error that LVM can't initialize a disk with a partition table on it, first make sure that the disk you are operating on is the correct one. If you are very sure that it is, run the following:

    WarningDANGEROUS
     

    The following commands will destroy the partition table on the disk being operated on. Be very sure it is the correct disk.

    # dd if=/dev/zero of=/dev/diskname bs=1k count=1
    # blockdev --rereadpt /dev/diskname
    

For partitions:

  • When using LVM 1 on PCs with DOS partitions, set the partition type to 0x8e using fdisk or some other similar program. This step is unnecessary on PPC systems or when using LVM 2.

  • Run pvcreate on the partition:
    # pvcreate /dev/hdb1
                  
    This creates a volume group descriptor at the start of the /dev/hdb1 partition.

 
 
  Published under the terms of the GNU General Public License Design by Interspire