Question : extend filesystem

Need to know how/if to extend filesystem to new space made available from san. For example, have filesystem /dev/sdf1 mounted on /u02 that has 247G space but need 500G more. Client has made available another 500G from san and now we're not sure how to extend u02 to include the additional space.

OS: Linux version 2.6.9-78.0.8.0.1.ELsmp ([email protected]racle.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-10.0.1)) #1 SMP Wed Nov 19 16:39:14 EST 2008

---------------------------------------------------------
df -h output:
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              20G   16G  3.4G  83% /
none                  3.0G     0  3.0G   0% /dev/shm
/dev/sdc1              30G  5.1G   24G  18% /u01
/dev/sdf1             247G  232G  1.7G 100% /u02
---------------------------------------------------------

fdisk -l output:
Disk /dev/sda: 21.4 GB, 21495808000 bytes
255 heads, 63 sectors/track, 2613 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2613    20988891   83  Linux

Disk /dev/sdb: 12.8 GB, 12897484800 bytes
64 heads, 32 sectors/track, 12300 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       12300    12595184   83  Linux

Disk /dev/sdc: 32.2 GB, 32243712000 bytes
64 heads, 32 sectors/track, 30750 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1       30750    31487984   83  Linux

Disk /dev/sdd: 268.4 GB, 268439650304 bytes
255 heads, 63 sectors/track, 32635 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1       32635   262140606   83  Linux

Disk /dev/sde: 268.4 GB, 268439650304 bytes
255 heads, 63 sectors/track, 32635 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1       32635   262140606   83  Linux

Disk /dev/sdf: 268.4 GB, 268439650304 bytes
255 heads, 63 sectors/track, 32635 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1       32635   262140606   83  Linux

Disk /dev/sdg: 536.8 GB, 536879300608 bytes
255 heads, 63 sectors/track, 65271 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdg doesn't contain a valid partition table
---------------------------------------------------------

cat /etc/fstab output:
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/                 /                       ext3    defaults        1 1
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
LABEL=SWAP-sdb1         swap                    swap    defaults        0 0
LABEL=/u01              /u01                    ext3    defaults        1 2
LABEL=/u02              /u02                    ext3    defaults        1 2
/dev/hda                /media/cdrom            auto    pamconsole,exec,noauto,managed 0 0


Answer : extend filesystem

Hi,

I am afraid you can't. THe volume expansion is only possible under LVM (Logical Volume Manager) but your system thinks this is just a regular hard disk and it can not expand it.

To create a new LVM volume you can follow this procedure:

WARNINIG it is a destructive procedure make sure you've porperly backed all data prior to start :

- Just request a temporary volume with enough space to get all /u02 files form the SAN guy.
- mount it under a temp location such as /mnt
- Copy all /u02 files over the temporary volume.
- Create a LVM volume over the u02
  # pvcreate /dev/sdf1
  # vgcreate lv01 /dev/sdf1
  # lvcreate -L747M -n root lv01

Create a filesystem over the new volume
   # mke2fs /dev/lv01/root
   # mount /dev/lv01/root /u02

now copy the temporary contents over the new volume.

edit your /etc/fstab and chenge this:
LABEL=/u02              /u02                    ext3    defaults        1 2
into this:
/dev/lv01/root            /u02                    ext3    defaults        1 1

Now that you can always use vgexpand command whenever you add space.

Cheers,
K.


         
             
Random Solutions  
 
programming4us programming4us