Storage : Expansion of solaris filesystem after expanding the corresponding LUN from storage.
Other Learning Articles that you may like to read
Free Courses We Offer
Paid Training Courses we Offer
Procedure to expand default partition table using native OS utilities:
Note: Because the partition table will be removed and rewritten, the following procedure is appropriate ONLY when the file system on the disk has been created on slice 2 and spans the entire Symmetrix volume.
The following procedure rewrites the partition table and is designed to be used only with disk devices that have been configured with a single file system on slice2 (the backup partition) of the disk.
General steps for logical volume and file system expansion:
In the following example a we assume a storage LUN from a Symmetrix device is expanded with addition size.
The partition table (viewed from format) shows the current size of the disk, which is 12.64 GB:
# format
…
partition> print
Current partition table (original):
Total disk cylinders available: 13807 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 – 13806 12.64GB (13807/0/0) 26509440
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
A file system has been created that spans the entire device:
# df -k
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 8187339 5941342 2164124 74% /
/proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
fd 0 0 0 0% /dev/fd
swap 2028792 40 2028752 1% /var/run
dmpfs 2028752 0 2028752 0% /dev/vx/dmp
dmpfs 2028752 0 2028752 0% /dev/vx/rdmp
swap 2028752 0 2028752 0% /tmp
/dev/dsk/c2t0d12s2 13046571 160 12915946 1% /mp/testfs
The file system contains data:
# ls /mp/testfs
arp.conf fcip.conf llc1.conf ptc.conf stp4020.conf
audiocs.conf fcp.conf lofi.conf ptsl.conf sy.conf
audioens.conf fp.conf log.conf qlc.conf sysmsg.conf
audiots.conf hci1394.conf lost+found ramdisk.conf tcp6.conf
bofi.conf icmp6.conf md.conf random.conf tcp.conf
clone.conf icmp.conf mm.conf rts.conf tl.conf
cn.conf ifp.conf nca.conf sad.conf udp6.conf
…
1. LUN expansion from th storage side
# format
…
partition> print
Current partition table (original):
Total disk cylinders available: 13807 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 – 13806 12.64GB (13807/0/0) 26509440
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
2. Unmount the file system.
# umount /mp/testfs
3. Run format, choose ‘type’, followed by ‘0. Auto configure’:
# format
…
Specify disk (enter its number): 14
selecting c2t0d12
[disk formatted]
FORMAT MENU:
disk – select a disk
type – select (define) a disk type
partition – select (define) a partition table
current – describe the current disk
format – format and analyze the disk
repair – repair a defective sector
label – write label to the disk
analyze – surface analysis
defect – defect list management
backup – search for backup labels
verify – read and display labels
save – save new disk/partition definitions
inquiry – show vendor, product and revision
volname – set 8-character volume name
!<cmd> – execute <cmd>, then return
quit
format> type
AVAILABLE DRIVE TYPES:
0. Auto configure
1. Quantum ProDrive 80S
2. Quantum ProDrive 105S
3. CDC Wren IV 94171-344
4. SUN0104
5. SUN0207
6. SUN0327
7. SUN0340
8. SUN0424
9. SUN0535
10. SUN0669
11. SUN1.0G
12. SUN1.05
13. SUN1.3G
14. SUN2.1G
15. SUN2.9G
16. Zip 100
17. Zip 250
18. EMC-SYMMETRIX-5771
19. EMC-SYMMETRIX-5771
20. EMC-SYMMETRIX-5771
21. SUN9.0G
22. EMC-SYMMETRIX-5771
23. other
Specify disk type (enter its number)[20]: 0
c2t0d12: configured with capacity of 16.85GB
<EMC-SYMMETRIX-5771 cyl 18410 alt 2 hd 15 sec 128>
selecting c2t0d12
[disk formatted]
format>
4. Write the new label:
format> label
Ready to label disk, continue? y
format>
The operating system now displays the correct disk size:
format> part
PARTITION MENU:
0 – change `0′ partition
1 – change `1′ partition
2 – change `2′ partition
3 – change `3′ partition
4 – change `4′ partition
5 – change `5′ partition
6 – change `6′ partition
7 – change `7′ partition
select – select a predefined table
modify – modify a predefined partition table
name – name the current table
print – display the current table
label – write partition map and label to the disk
!<cmd> – execute <cmd>, then return
quit
partition> print
Current partition table (default):
Total disk cylinders available: 18410 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 0 – 136 128.44MB (137/0/0) 263040
1 swap wu 137 – 273 128.44MB (137/0/0) 263040
2 backup wu 0 – 18409 16.85GB (18410/0/0) 35347200
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 274 – 18409 16.60GB (18136/0/0) 34821120
7 unassigned wm 0 0 (0/0/0) 0
Note: If “Auto configure” is run but the disk is not labeled, format will display the new partition table information from host memory, but any attempt to use the newly configured space will fail because the label will still contain the incorrect, older partition information. This will prevent mkfs from expanding the file system.
5. The file system can now be mounted and expanded:
# mount /dev/dsk/c2t0d12s2 /mp/testfs
# /usr/lib/fs/ufs/mkfs -G -M /mp/testfs /dev/rdsk/c2t0d12s2 34821120
/dev/rdsk/c2t0d12s2: 34821120 sectors in 18136 cylinders of 15 tracks, 128 sectors
17002.5MB in 356 cyl groups (51 c/g, 47.81MB/g, 6016 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98080, 196128, 294176, 392224, 490272, 588320, 686368, 784416, 882464,
Initializing cylinder groups:
……
super-block backups for last 10 cylinder groups at:
33881632, 33979680, 34077728, 34175776, 34273824, 34371872, 34467872,
34565920, 34663968, 34762016,
Note: to expand a ufs filesystem, you must use the mkfs command from the /usr/lib/fs/ufs directory.
# df -k
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 8187339 5942357 2163109 74% /
/proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
fd 0 0 0 0% /dev/fd
swap 2050960 40 2050920 1% /var/run
dmpfs 2050920 0 2050920 0% /dev/vx/dmp
dmpfs 2050920 0 2050920 0% /dev/vx/rdmp
swap 2050920 0 2050920 0% /tmp
/dev/dsk/c2t0d12s2 17137130 160 17006505 1% /mp/testfs
The data is preserved:
# cd /mp/testfs
# ls
arp.conf fcip.conf llc1.conf ptc.conf stp4020.conf
audiocs.conf fcp.conf lofi.conf ptsl.conf sy.conf
audioens.conf fp.conf log.conf qlc.conf sysmsg.conf
audiots.conf hci1394.conf lost+found ramdisk.conf tcp6.conf
bofi.conf icmp6.conf md.conf random.conf tcp.conf
clone.conf icmp.conf mm.conf rts.conf tl.conf
…
# cat fp.conf
#
# Copyright (c) 1999, 2001 by Sun Microsystems, Inc.
# All rights reserved.
#
# Sun Fibre Channel Port driver configuration
#
#ident “@(#)fp.conf 1.2 01/03/30 SMI”
#
name=”fp” port=0;
name=”fp” port=1;
#
# List of ULP modules for loading during port driver attach time
#
load-ulp-list=”1″,”fcp”;
#
# Force attach driver to support hotplug activity (do not remove the property)
#
ddi-forceattach=1;
#
Procedure to Preserve a custom partition table while allowing the last slice of the disk to be extended
Note: In a Solaris environment, only the last partition can be extended because format will only allow the user to specify the new size of the partition. It will not allow the creation of a partition with non-contiguous disk blocks.
In this example, c3t0d61 has a custom partition table with 4 mounted file systems:
partition> print
Current partition table (user_defined):
Total disk cylinders available: 27616 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 0 – 136 128.44MB (137/0/0) 263040
1 swap wu 137 – 273 128.44MB (137/0/0) 263040
2 backup wu 0 – 27615 25.28GB (27616/0/0) 53022720
3 unassigned wm 274 – 7108 6.26GB (6835/0/0) 13123200
4 unassigned wm 7109 – 13943 6.26GB (6835/0/0) 13123200
5 unassigned wm 13944 – 20778 6.26GB (6835/0/0) 13123200
6 usr wm 20779 – 20780 1.88MB (2/0/0) 3840
7 unassigned wm 20781 – 27615 6.26GB (6835/0/0) 13123200
# df -k
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 32992541 3194086 29468530 10% /
/proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
fd 0 0 0 0% /dev/fd
swap 2242680 104 2242576 1% /var/run
dmpfs 2242576 0 2242576 0% /dev/vx/dmp
dmpfs 2242576 0 2242576 0% /dev/vx/rdmp
swap 3318120 1075544 2242576 33% /tmp
/dev/dsk/c3t0d61s3 6457709 9 6393123 1% /data3
/dev/dsk/c3t0d61s4 6457709 9 6393123 1% /data4
/dev/dsk/c3t0d61s5 6457709 9 6393123 1% /data5
/dev/dsk/c3t0d61s7 6457709 9 6393123 1% /data7
All of the file systems contain data:
# ls /data3
arp.conf log.conf sy.conf
audiocs.conf lost+found sysmsg.conf
audioens.conf md.conf tcp.conf
audiots.conf mm.conf tcp6.conf
bofi.conf nca.conf tl.conf
clone.conf ohci.conf uata.conf
cn.conf openeepr.conf udp.conf
conskbd.conf options.conf udp6.conf
consms.conf pln.conf usb_ac.conf
…
# prtvtoc /dev/dsk/c3t0d61s2 > /vtoc_output/c3t0d61.part
# cat /vtoc_output/c3t0d61.part
* /dev/dsk/c3t0d61s2 partition map
*
* Dimensions:
* 512 bytes/sector
* 128 sectors/track
* 15 tracks/cylinder
* 1920 sectors/cylinder
* 27618 cylinders
* 27616 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 263040 263039
1 3 01 263040 263040 526079
2 5 01 0 53022720 53022719
3 0 00 526080 13123200 13649279 /data3
4 0 00 13649280 13123200 26772479 /data4
5 0 00 26772480 13123200 39895679 /data5
6 4 00 39895680 3840 39899519
7 0 00 39899520 13123200 53022719 /data7
# umount /data3
# umount /data4
# umount /data5
# umount /data7
# format
Searching for disks…done
c2t0d46: configured with capacity of 8.43GB
…
c3t0d242: configured with capacity of 3.75MB
AVAILABLE DISK SELECTIONS:
0. c0t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107> /pci@1f,4000/scsi@3/sd@0,0
1. c0t1d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107> /pci@1f,4000/scsi@3/sd@1,0
2. c2t0d0 <EMC-SYMMETRIX-5772 cyl 94 alt 2 hd 15 sec 128>
/pci@1f,4000/fibre-channel@5/sd@0,0
3. c2t0d44 <EMC-SYMMETRIX-5772 cyl 9204 alt 2 hd 15 sec 128>
/pci@1f,4000/fibre-channel@5/sd@0,2c
…
19. c2t0d231 <EMC-SYMMETRIX-5772 cyl 4 alt 2 hd 15 sec 128>
/pci@1f,4000/fibre-channel@5/sd@0,e7
20. c2t0d232 <EMC-SYMMETRIX-5772 cyl 4 alt 2 hd 15 sec 128>
/pci@1f,4000/fibre-channel@5/sd@0,e8
21. c2t0d233 <EMC-SYMMETRIX-5772 cyl 4 alt 2 hd 15 sec 128>
/pci@1f,4000/fibre-channel@5/sd@0,e9
22. c3t0d0 <EMC-SYMMETRIX-5772 cyl 94 alt 2 hd 15 sec 128>
/pci@1f,4000/fibre-channel@5,1/sd@0,0
23. c3t0d44 <EMC-SYMMETRIX-5772 cyl 9204 alt 2 hd 15 sec 128>
/pci@1f,4000/fibre-channel@5,1/sd@0,2c
Specify disk (enter its number): 18
selecting c3t0d61
[disk formatted]
FORMAT MENU:
disk – select a disk
type – select (define) a disk type
partition – select (define) a partition table
current – describe the current disk
format – format and analyze the disk
repair – repair a defective sector
label – write label to the disk
analyze – surface analysis
defect – defect list management
backup – search for backup labels
verify – read and display labels
save – save new disk/partition definitions
inquiry – show vendor, product and revision
volname – set 8-character volume name
!<cmd> – execute <cmd>, then return
quit
format> type
AVAILABLE DRIVE TYPES:
0. Auto configure
1. Quantum ProDrive 80S
2. Quantum ProDrive 105S
3. CDC Wren IV 94171-344
4. SUN0104
5. SUN0207
6. SUN0327
7. SUN0340
8. SUN0424
9. SUN0535
10. SUN0669
11. SUN1.0G
12. SUN1.05
13. SUN1.3G
14. SUN2.1G
15. SUN2.9G
16. Zip 100
17. Zip 250
18. SUN36G
19. EMC-SYMMETRIX-5772
20. EMC-SYMMETRIX-5772
21. EMC-SYMMETRIX-5772
22. EMC-SYMMETRIX-5772
23. EMC-SYMMETRIX-5772
24. EMC-SYMMETRIX-5772
25. other
Specify disk type (enter its number)[23]: 0
c2t0d61: configured with capacity of 33.71GB
<EMC-SYMMETRIX-5772 cyl 36822 alt 2 hd 15 sec 128>
selecting c3t0d61
[disk formatted]
format> label
Ready to label disk, continue? y
format> q
The operating system now sees the added space. The size of the disk, reflected in the number of sectors in the backup partition (slice 2), has increased from 53022720 to 70698240:
# prtvtoc /dev/dsk/c3t0d61s2
* /dev/dsk/c3t0d61s2 partition map
*
* Dimensions:
* 512 bytes/sector
* 128 sectors/track
* 15 tracks/cylinder
* 1920 sectors/cylinder
* 36824 cylinders
* 36822 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 263040 263039
1 3 01 263040 263040 526079
2 5 01 0 70698240 70698239
6 4 00 526080 70172160 70698239
The custom partition table can now be restored, but if the file containing the prtvtoc output contains information for slice 2, the fmthard command will fail:
# fmthard -s /vtoc_output/c3t0d61.part /dev/rdsk/c3t0d61s2
fmthard: Partition 2 specifies the full disk and is not equal
full size of disk. The full disk capacity is 70698240 sectors.
Modify th file which is having prtvtoc output and remove the line related to the slice after that issuing fmthard command will rewrite the partition table:
* /dev/dsk/c3t0d61s2 partition map
*
* Dimensions:
* 512 bytes/sector
* 128 sectors/track
* 15 tracks/cylinder
* 1920 sectors/cylinder
* 27618 cylinders
* 27616 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 263040 263039
1 3 01 263040 263040 526079
<notice that entry for slice 2 was removed>
3 0 00 526080 13123200 13649279 /data3
4 0 00 13649280 13123200 26772479 /data4
5 0 00 26772480 13123200 39895679 /data5
6 4 00 39895680 3840 39899519
7 0 00 39899520 13123200 53022719 /data7
# fmthard -s /vtoc_output/c3t0d61.part /dev/rdsk/c3t0d61s2
fmthard: New volume table of contents now in place.
# prtvtoc /dev/dsk/c3t0d61s2
* /dev/dsk/c3t0d61s2 partition map
*
* Dimensions:
* 512 bytes/sector
* 128 sectors/track
* 15 tracks/cylinder
* 1920 sectors/cylinder
* 36824 cylinders
* 36822 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* Unallocated space:
* First Sector Last
* Sector Count Sector
* 53022720 17675520 70698239
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 263040 263039
1 3 01 263040 263040 526079
2 5 01 0 70698240 70698239
3 0 00 526080 13123200 13649279
4 0 00 13649280 13123200 26772479
5 0 00 26772480 13123200 39895679
6 4 00 39895680 3840 39899519
7 0 00 39899520 13123200 53022719
partition> 7
Part Tag Flag Cylinders Size Blocks
7 unassigned wm 20781 – 27615 6.26GB (6835/0/0) 13123200
Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[20781]:
Enter partition size[13123200b, 6835c, 27615e, 6407.81mb, 6.26gb]: 30798720b
partition> label
Ready to label disk, continue? y
partition> print
Current partition table (unnamed):
Total disk cylinders available: 36822 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 0 – 136 128.44MB (137/0/0) 263040
1 swap wu 137 – 273 128.44MB (137/0/0) 263040
2 backup wu 0 – 36821 33.71GB (36822/0/0) 70698240
3 unassigned wm 274 – 7108 6.26GB (6835/0/0) 13123200
4 unassigned wm 7109 – 13943 6.26GB (6835/0/0) 13123200
5 unassigned wm 13944 – 20778 6.26GB (6835/0/0) 13123200
6 usr wm 20779 – 20780 1.88MB (2/0/0) 3840
7 unassigned wm 20781 – 36821 14.69GB (16041/0/0) 30798720
The file systems can be mounted, but the file system on slice 7 will not show the larger partition size until the file system is extended.
# mount /dev/dsk/c3t0d61s3 /data3
# mount /dev/dsk/c3t0d61s4 /data4
# mount /dev/dsk/c3t0d61s5 /data5
# mount /dev/dsk/c3t0d61s7 /data7
# df -k
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 32992541 3194170 29468446 10% /
/proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
fd 0 0 0 0% /dev/fd
swap 2241456 104 2241352 1% /var/run
dmpfs 2241352 0 2241352 0% /dev/vx/dmp
dmpfs 2241352 0 2241352 0% /dev/vx/rdmp
swap 3316896 1075544 2241352 33% /tmp
/dev/dsk/c3t0d61s3 6457709 131 6393001 1% /data3
/dev/dsk/c3t0d61s4 6457709 131 6393001 1% /data4
/dev/dsk/c3t0d61s5 6457709 131 6393001 1% /data5
/dev/dsk/c3t0d61s7 6457709 131 6393001 1% /data7
# /usr/lib/fs/ufs/mkfs -G -M /data7 /dev/rdsk/c3t0d61s7 30798720
/dev/rdsk/c3t0d61s7: 30798720 sectors in 16041 cylinders of 15 tracks, 128 sectors
15038.4MB in 315 cyl groups (51 c/g, 47.81MB/g, 6016 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98080, 196128, 294176, 392224, 490272, 588320, 686368, 784416, 882464,
Initializing cylinder groups:
……
super-block backups for last 10 cylinder groups at:
29865760, 29963808, 30061856, 30159904, 30257952, 30356000, 30454048,
30552096, 30650144, 30748192,
The file system has been extended and the data is preserved.
# df -k
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 32992541 3194170 29468446 10% /
/proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
fd 0 0 0 0% /dev/fd
swap 2241392 104 2241288 1% /var/run
dmpfs 2241288 0 2241288 0% /dev/vx/dmp
dmpfs 2241288 0 2241288 0% /dev/vx/rdmp
swap 3316832 1075544 2241288 33% /tmp
/dev/dsk/c3t0d61s3 6457709 131 6393001 1% /data3
/dev/dsk/c3t0d61s4 6457709 131 6393001 1% /data4
/dev/dsk/c3t0d61s5 6457709 131 6393001 1% /data5
/dev/dsk/c3t0d61s7 15157419 131 15092711 1% /data7
# ls /data7
arp.conf ip6.conf q3ip.conf udp.conf
audiocs.conf ipsecah.conf qla2300.conf udp6.conf
audioens.conf ipsecesp.conf ramdisk.conf usb_ac.conf
…
very nice. working very well
Hi,
I have doubts regarding LUN configuration on unix, if theLUN having data , how to mount file system without lost ?
Can any one guide me solutions.
Thanks
Jagadeesan