Archive for the 'Linux Support' Category

More about LVM Components Physical Volumes

Physical Volumes

The underlying physical storage unit of an LVM logical volume is a block device such as a partition or whole disk. To use the device for an LVM logical volume the device must be initialized as a physical volume (PV).

Initializing a block device as a physical volume places a label near the start of the device.

By default, the LVM label is placed in the second 512-byte sector. You can overwrite this default by placing the label on any of the first 4 sectors. This allows LVM volumes to co-exist with other users of these sectors, if necessary.

An LVM label provides correct identification and device ordering for a physical device, since devices can come up in any order when the system is booted. An LVM label remains persistent across reboots and throughout a cluster.

The LVM label identifies the device as an LVM physical volume. It contains a random unique identifier (the UUID) for the physical volume. It also stores the size of the block device in bytes, and it records where the LVM metadata will be stored on the device.

The LVM metadata contains the configuration details of the LVM volume groups on your system. By default, an identical copy of the metadata is maintained in every metadata area in every physical volume within the volume group. LVM metadata is small and stored as ASCII.

SBDavid

LVM - Initializing Physical Volumes

Initializing Physical Volumes

Use the pvcreate command to initialize a block device to be used as a physical volume.

Initialization is analogous to formatting a file system.

The following command initializes /dev/sdd1, /dev/sde1, and /dev/sdf1 for use as LVM physical volumes.

pvcreate /dev/sdd1 /dev/sde1 /dev/sdf1

To initialize partitions rather than whole disks: run the pvcreate command on the partition.

The following example initializes the partition /dev/hdb1 as an LVM physical volume for later use as part of an LVM logical volume.

pvcreate /dev/hdb1

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 should be set to 0×8e using fdisk(8), cfdisk(8), or a equivalent. 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.

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

See Also

lvm(8), vgcreate(8), vgextend(8), lvcreate(8), cfdisk(8), fdisk(8), losetup(8), mdadd(8), vgcfgrestore(8), vgconvert(8)

Referenced By

pvchange(8), pvck(8), pvdisplay(8), pvremove(8), pvscan(8), vgchange(8), vgdisplay(8)

SBDavid

fdisk usage

fdisk is started by typing (as root) fdisk device at the command prompt, device might be something like /dev/hda or /dev/sda. The basic fdisk commands you need are:

p print the partition table

n create a new partition

d delete a partition

q quit without saving changes

w write the new partition table and exit

Changes you make to the partition table do not take effect until you issue the write (w) command.

Here is a sample partition table:

Disk /dev/hdb: 64 heads, 63 sectors, 621 cylinders
Units = cylinders of 4032 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 184 370912+ 83 Linux
/dev/hdb2 185 368 370944 83 Linux
/dev/hdb3 369 552 370944 83 Linux
/dev/hdb4 553 621 139104 82 Linux swap

The first line shows the geometry of your hard drive. It may not be physically accurate, but you can accept it as though it were. The hard drive in this example is made of 32 double-sided platters with one head on each side (probably not true). Each platter has 621 concentric tracks. A 3-dimensional track (the same track on all disks) is called a cylinder. Each track is divided into 63 sectors. Each sector contains 512 bytes of data. Therefore the block size in the partition table is 64 heads * 63 sectors * 512 bytes er…divided by 1024. (See 4 for discussion on problems with this calculation.) The start and end values are cylinders.

More .. detail at http://tldp.org/HOWTO/

The Sysstat Suite of Resource Monitoring Tools

Sysstat contains the following tools related to collecting I/O and CPU statistics:

iostat
Displays an overview of CPU utilization, along with I/O statistics for one or more disk drives.

mpstat
Displays more in-depth CPU statistics.

Sysstat also contains tools that collect system resource utilization data and create daily reports based on that data. These tools are:

sadc
Known as the system activity data collector, sadc collects system resource utilization information and writes it to a file.

sar
Producing reports from the files created by sadc, sar reports can be generated interactively or written to a file for more intensive analysis.

SBDavid

MySQL Error Log File

MySQL Error Log File

The error log contains information indicating when mysqld was started and stopped and also any critical errors that occur while the server is running.

If mysqld notices a table that needs to be automatically checked or repaired, it writes a message to the error log.
On some operating systems, the error log contains a stack trace if mysqld dies.

You can specify where mysqld writes the error log with the –log-error[=file_name] option.
If no file_name value is given, mysqld uses the name host_name.err by default and writes the file in the data directory.

On Windows, error output is always written to the .err file if –console is not given.

If you use mysqld_safe to start mysqld, mysqld_safe arranges for mysqld to write error messages to a log file or to syslog mysqld_safe has three error-logging options, –syslog, –skip-syslog, and –log-error.

« Prev - Next »