Sep
15
2008
0

A basic LVM Setup

# fdisk -l

Disk /dev/hda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 522 4088542+ 8e Linux LVM

Disk /dev/hdb: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 522 4192933+ 83 Linux

# pvcreate /dev/hdb1
Physical volume “/dev/hdb1” successfully created
# vgcreate vg1 /dev/hdb1
Volume group “vg1” successfully created

# lvcreate –size 1G vg1
Logical volume “lvol0” created
# ls -l /dev/vg1/lvol0
lrwxrwxrwx 1 root root 21 Jul 29 20:27 /dev/vg1/lvol0 -> /dev/mapper/vg1-lvol0
# mkfs.ext3 /dev/vg1/lvol0
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
131072 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

# mount /dev/vg1/lvol0 /mnt
# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
2967320 860884 1955704 31% /
/dev/hda1 101086 10199 85668 11% /boot
none 254472 0 254472 0% /dev/shm
/dev/mapper/vg1-lvol0
1032088 34092 945568 4% /mnt

Share
Written by in: linux,storage,sysadm | Tweet This
Sep
15
2008
0

Accessing NTFS Partitions from Linux

This is basically done by two methods:
– The NTFS kernel module
– The NTFS user space programs
from the kernel source or http://www.linux-ntfs.org/

The NTFS Kernel Module
Have a check at the wiki page

You
might find an appropriate prebuilt driver for your current kernel
version. Then you can do normal mounts etc on NTFS partitions. One
problem here is that if you upgrade your kernel, you’ll need to have a
new kernel module. Or eventually build from source.

Alternatively
with 2.6 kernels there is the NTFS support. But with enterprise distros
(like OEL or RHEL) that support is not compiled in and rebuilt kernels
are not supported.

The NTFS Userspace Programs

That is the kernel-version-free solution and it is quite effective. One can get the source from Linux-NTFS Download or more precisely the 2.0.0 version here.

This is the option that I prefer…

Note
that there is an option to have ntfsmount too (–enable-ntfsmount) ..
But that requires FUSE support where enterprise distros generally
discard / disable FUSE support due to security reasons.

# tar jxvf ntfsprogs-2.0.0.tar.bz2
ntfsprogs-2.0.0/
ntfsprogs-2.0.0/doc/
ntfsprogs-2.0.0/doc/attributes.txt
ntfsprogs-2.0.0/doc/CodingStyle

ntfsprogs-2.0.0/COPYING
ntfsprogs-2.0.0/TODO.ntfsprogs
ntfsprogs-2.0.0/CREDITS
ntfsprogs-2.0.0/ntfsprogs.spec
# cd ntfsprogs-2.0.0
# ./configure
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking target system type… i686-pc-linux-gnu

config.status: config.h is unchanged
config.status: executing depfiles commands
# make && make install
make all-recursive
make[1]: Entering directory `/home/oyuksel/projects/ntfsprogs-2.0.0′

make[2]: Leaving directory `/home/oyuksel/projects/ntfsprogs-2.0.0′
make[1]: Leaving directory `/home/oyuksel/projects/ntfsprogs-2.0.0′
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
# ntfsls -l /dev/sdb2
0 May 31 15:23 2008 data
0 Feb 12 15:59 2007 data1
0 Feb 12 15:59 2007 data2
0 Mar 30 15:43 2007 muzik
0 Feb 13 15:21 2007 MyVM
0 Feb 13 15:59 2007 RECYCLER
0 Feb 4 23:14 2007 System Volume Information
42004 Jul 28 16:13 2008 testfile
# ntfscat /dev/sdb2 testfile > testfile
# ls -l testfile
-rw-r–r– 1 root root 42004 Jul 28 16:15 testfile

For more information see Linux-NTFS Wiki

Share
Written by in: linux,storage,sysadm | Tweet This
Sep
15
2008
0

udev: what, why, how?

udev is introduced with the 2.6 kernel (ie not available in RHEL3 and before)
And that is solely for device name persistence. It is mainly a problem when
disks are external / via HBA, and the names across reboots and/or clusters might
not be the same.

We have been using devlabel to be able to get some persistence with RHEL3 and
RHAS 2.1 but it was not the best solution.

What udev does is that based on the specific attributes of a device (especially
UUID – scsi_id) creates a persistently named symbolic link to a device which can
come up with different /dev/sd* names. udev is also crucial for multipathing
too.

That is for disks.. udev can also be used for RH cluster dlm, hotplugging, sane
(scanners), network, pcmcia, tablets, sound (alsa), pam (biometric interfaces),
bluetooth and some xen.. So udev is way generic.

Note that with EL5, the defaults are available under /dev/disk via
by-id by-label by-path by-uuid
directories.

For raw devices, (raw interface) that was devised to provide character devices
mapped on block devices. Traditionally on UNIX the disks are introduced in
character (raw) mode and they have sequential mode. But for mounts we need block
devices. With linux, it was implemented the other way around. Basically the
block devices are available for disks, and when databases needed raw
devices for multinode access (clustering) and async I/O (2.1 times – when
async I/O was not possible with ext2) it was implemented as a mapping
mechanism.

Nowadays we do not use the raw interface as RDBMSes support the use of
block devices as raw and we have cluster filesystems (OCFS2).
. And the raw support via the “raw” interface is deprecated with RHEL5
(although it is available) and not likely be around for EL6.

Share
Written by in: linux,storage,sysadm | Tweet This
Sep
15
2008
0

How to Mount Volumes from a Rescued LVM Disk?

Say we have a LVM’ed /dev/sdd1 and we have to mount logical volume LogVol00 in it..

# file -s /dev/sdd1

/dev/sdd1: LVM2 (Linux Logical Volume Manager) , UUID: 7zKduhTHsMa3YD3t2gocYKUDGRP5QvW

# vgscan
Reading all physical volumes. This may take a while…
Found volume group “VolGroup00” using metadata type lvm2

# vgchange -a y VolGroup00
2 logical volume(s) in volume group “VolGroup00” now active

# lvdisplay
— Logical volume —
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID YcNYud-4BXO-Ro6N-P7VW-yrLm-DDZT-oLGgAO
LV Write Access read/write
LV Status available
# open 0
LV Size 1.94 GB
Current LE 62
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:2

— Logical volume —
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID pSyXMZ-8TXw-fwiw-m3re-Oi3I-0fch-mJ1Q5H
LV Write Access read/write
LV Status available
# open 0
LV Size 1.91 GB
Current LE 61
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:3
# mkdir -p /mnt/VolGroup00/LogVol00
# mount /dev/VolGroup00/LogVol00 /mnt/VolGroup00/LogVol00
# ls /mnt/VolGroup00/LogVol00
bin dev home lib lost+found misc opt root selinux sys usr
boot etc initrd lib64 media mnt proc sbin srv tmp var
#

Share
Written by in: linux,storage,sysadm | Tweet This
Sep
15
2008
0

PXE Boot Config Enterprise Linux

Configuring a PXE boot server

Install required packages:

# yum install bind dhcp system-config-netboot tftp-server

Setup dhcpd:

# vi /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;

subnet 10.10.10.0 netmask 255.255.255.0 {

option routers 10.10.10.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.10.10.1;
option time-offset 7200;
range dynamic-bootp 10.10.10.10 10.10.10.15;
default-lease-time 21600;
max-lease-time 43200;
next-server 10.10.10.1;
option subnet-mask 255.255.255.0;
option broadcast-address 10.10.10.255;
filename “linux-install/pxelinux.0”;
}

Copy the vmlinuz, initrd.img to /tftpboot/linux-install directory.

Create a default:

# cat /tftpboot/linux-install/pxelinux.cfg/default
timeout 100
default el5u1
prompt 1
display boot.msg
label el5u1
kernel vmlinuz
append initrd=initrd.img
#

Set the boot message:

# cat /tftpboot/linux-install/pxelinux.cfg/boot.msg
Press “Enter” to start or auto 100 seconds …
#

Set disable=no in /etc/xinetd.d/tftp (enable tftp)

Setup the services:
# service xinetd restart
# service dhcpd restart
# touch /etc/named.conf
# service named restart
# service iptables stop (or allow tftp connection in the iptables config)

Share
Written by in: linux,network,sysadm | Tweet This

Powered by WordPress | Theme: Aeros 2.0 by TheBuckmaker.com