Monday, November 28, 2005

New 300GB hard drive

Bought 300GB Maxtor, $90, Fry's special.

Disk env before installation of this new hd:

[root@myth ~]# cat /proc/ide/hda/model
WDC WD800JB-00JJA0
[root@myth ~]# cat /proc/ide/hdc/model
WDC WD2000JB-00GVA0

[root@myth ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
268481216 236744304 18098872 93% /
/dev/hda1 101086 15741 80126 17% /boot
none 387716 0 387716 0% /dev/shm

[root@myth ~]# lvdisplay
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID TtE4Ov-y95i-7zme-LfWX-0CGw-XKO5-luRCQ0
LV Write Access read/write
LV Status available
# open 1
LV Size 260.12 GB
Current LE 8324
Segments 2
Allocation inherit
Read ahead sectors 0
Block device 253:0

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID P5tMTw-7ex1-euop-itB1-kUAm-PLk0-YLQjI8
LV Write Access read/write
LV Status available
# open 1
LV Size 512.00 MB
Current LE 16
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:1

[root@myth ~]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/hda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)

[root@myth ~]# vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 260.69 GB
PE Size 32.00 MB
Total PE 8342
Alloc PE / Size 8340 / 260.62 GB
Free PE / Size 2 / 64.00 MB
VG UUID 8ocfxz-02ZT-C7U8-ypaJ-7u3Z-4m46-0X0eKf

[root@myth ~]# pvdisplay
--- Physical volume ---
PV Name /dev/hdc1
VG Name VolGroup00
PV Size 186.28 GB / not usable 0
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 5961
Free PE 0
Allocated PE 5961
PV UUID uZSCIq-n8EN-tGPJ-asuy-Yy2d-Q2rr-0OPvmD

--- Physical volume ---
PV Name /dev/hda2
VG Name VolGroup00
PV Size 74.41 GB / not usable 0
Allocatable yes
PE Size (KByte) 32768
Total PE 2381
Free PE 2
Allocated PE 2379
PV UUID Pfg2Ck-wy44-WAG6-1dXT-qQ5J-Dk6V-g6aVcW

[root@myth ~]# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
[root@myth ~]#

[root@myth ~]# ls /dev/hd*
/dev/hda /dev/hda1 /dev/hda2 /dev/hdc /dev/hdc1
[root@myth ~]#

Pulled jumper from new hd to make it slave, added to ide cable. It is /dev/hdd:

[root@myth ~]# cat /proc/ide/hdd/model
Maxtor 6L300R0
[root@myth ~]# cat /proc/ide/hda/model
WDC WD800JB-00JJA0
[root@myth ~]# cat /proc/ide/hdc/model
WDC WD2000JB-00GVA0

Not formatted yet:

[root@myth ~]# ls /dev/hd*
/dev/hda /dev/hda1 /dev/hda2 /dev/hdc /dev/hdc1 /dev/hdd
[root@myth ~]#

Check the partition type of old hard drive:

[root@myth ~]# fdisk /dev/hdc

Command (m for help): p

Disk /dev/hdc: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 * 1 24321 195358401 8e Linux LVM

Partition new Maxtor:

[root@myth ~]# fdisk /dev/hdd
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

[empty partition table below]

Command (m for help): p

Disk /dev/hdd: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Command (m for help):

MAKE NEW PARTITION:

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-36483, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-36483, default 36483):
Using default value 36483

SET PARTITION TYPE:

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): p

Disk /dev/hdd: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdd1 1 36483 293049666 8e Linux LVM

WRITE PARTITION TO DISK AND QUIT:

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@myth ~]#

Now we have /dev/hdd1:

[root@myth ~]# ls /dev/hd*
/dev/hda /dev/hda1 /dev/hda2 /dev/hdc /dev/hdc1 /dev/hdd /dev/hdd1

Make lvm pv:

[root@myth ~]# pvcreate /dev/hdd1
Physical volume "/dev/hdd1" successfully created

[root@myth ~]# pvdisplay /dev/hdd1
--- NEW Physical volume ---
PV Name /dev/hdd1
VG Name
PV Size 279.47 GB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID X531So-5d3B-BeMh-ObO0-0Dx7-SD8l-sEgVX6

[root@myth ~]#

Run vgscan:

[root@myth ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "VolGroup00" using metadata type lvm2
[root@myth ~]#

Extend the VG:

[root@myth ~]# vgextend VolGroup00 /dev/hdd1
Volume group "VolGroup00" successfully extended

Now the VG is bigger:

[root@myth ~]# vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 3
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 3
Act PV 3
VG Size 540.16 GB
PE Size 32.00 MB
Total PE 17285
Alloc PE / Size 8340 / 260.62 GB
Free PE / Size 8945 / 279.53 GB
VG UUID 8ocfxz-02ZT-C7U8-ypaJ-7u3Z-4m46-0X0eKf

Previously free PEs were:
Free PE / Size 2 / 64.00 MB

Now free PEs:
Free PE / Size 8945 / 279.53 GB

Extend the LV by those free extents:

[root@myth ~]# lvextend --extents +8945 /dev/VolGroup00/LogVol00
Extending logical volume LogVol00 to 539.66 GB
Logical volume LogVol00 successfully resized

Now free PE in the VG is:
Free PE / Size 0 / 0

(good)

Filesystem doesn't yet see the new space:

[root@myth ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
257G 224G 20G 92% /
/dev/hda1 99M 16M 79M 17% /boot
none 379M 0 379M 0% /dev/shm

So, need to extend the filesystem (unlike previous cmds, this takes time to complete):

# ext2online -v /dev/VolGroup00/LogVol00
ext2online v1.1.18 - 2001/03/18 for EXT2FS 0.5b
new filesystem size 141467648
group 2 inode table has offset 2, not 1044
group 4 inode table has offset 2, not 1044
group 6 inode table has offset 2, not 1044
group 8 inode table has offset 2, not 1044
group 10 inode table has offset 2, not 1044
[...]
group 2077 inode table has offset 2, not 1044
group 2078 inode table has offset 2, not 1044
group 2079 inode table has offset 2, not 1044
group 2080 inode table has offset 2, not 1044
using 1024 reserved group descriptor blocks
creating group 4317 with 8192 blocks (rsvd = 1007, newgd = 34)

cache direct hits: 2221, indirect hits: 17, misses: 20
[root@myth ~]#

Now more space! :-)

[root@myth ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
532G 224G 281G 45% /
/dev/hda1 99M 16M 79M 17% /boot
none 379M 0 379M 0% /dev/shm
[root@myth ~]#



[]

0 Comments:

Post a Comment

<< Home