how to grow root file system in ldom
Friends ,It is quite possible you have faced similar kind of scenario in your solaris administration journey.In case if you have systems running over the years. At the time of server build you might have less space in root file system or var file system. Servers gets patched with all cycles of patches released from OEM vendors from time to time and root file system and mostly var file system gets full over the times.Since we are discussing here about LDOM so it,s Solaris. You may know all patched gets copied to /var/sadm which tends to full var FS and may leave you in scenario where you can not apply any patch or update from OEM vendors like Oracle or Veritas etc.In that scenario how to grow root file system in ldom in Solaris going to help.
Let me share my similar kind of experience and solution adopted by me to mitigate the requirement and complete my work to correlate with the requirement .I was working on updating latest Solaris 10 using tools or procedure available in my customer environment.It went absolutely fine but i left with very little space in var FS. I was supposed to update veritas as well on my Solaris 10 LDOM from 6.2.0.000 to 220.127.116.110. When i started to update veritas patches for solaris using method provided by veritas or procedure we have in our customer environment i got below error which is very much clear that we need more space in var file system on solaris 10 ldom for veritas upgrade to work.
"CPI ERROR V-9-0-0 671 MB is required in the /var volume and only 324 MB is available on dev001. 348 MB needs to be freed up in the /var volume."
1. Validation of issue is more important than solution to understand the problem and then apply resolution keeping all the awareness what you are doing and what may be the impact.Taking some snaps which will help if you need to revert back the solution.Since i was already working on server i have checked file system status and found as below.
# df -h /var Filesystem size used avail capacity Mounted on /dev/dsk/c0d0s5 7.9G 7.5G 324M 96% /var # cat /etc/vfstab #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options fd - /dev/fd fd - no - /proc - /proc proc - no - /dev/dsk/c0d0s1 - - swap - no - /dev/dsk/c0d0s0 /dev/rdsk/c0d0s0 / ufs 1 no - /dev/dsk/c0d0s5 /dev/rdsk/c0d0s5 /var ufs 1 no - /devices - /devices devfs - no - ctfs - /system/contract ctfs - no - objfs - /system/object objfs - no - swap - /tmp tmpfs - yes - sharefs - /etc/dfs/sharetab sharefs - no -
2. Secondly i have seen if i can remove some logs or just to know what folder or directory has eaten more space to look into it to re-mediate the situation and find like below.As i stated earlier sadm directory was eating most of the space.This is OEM Solaris (Oracle/Sun) patch directory and not advised to touch to keep integrity of OS intact as OS may start misbehaving in case if it is removed and there was no such folder which we can truncate to get more space.
Need to run this command being in /var directory to get all folders space consumption in MB and GB. # du -sh *|egrep "M|G" 56M adm 2.6M apache 1.0M cache 58M centrifydc 40M cron 16M log 193M opt 208M pca 77M preserve 6.7G sadm 21M sol 30M spool 2.7M svc 41M tmp 2.2M tomcat8 62M vx
3.So now we have need to increase file system. Step how to increase root file system in LDOM . For instance in my scenario my /var was of 8GB and i have decided to add another 4 GB.
4.I ran format command to see the available disk configuration in LDOM. Please see high lighted text it clearly shows what partition is in use and there corresponding mount points.You can see the disk size as well.In this case it was 36GB disk used as boot device from Control Domain (CDOM) .
If you navigate further you can note down start and end cylinder number for each partition.Please make sure you note it down some where.This task is intrusive in nature as we are editing partition of solaris itself so please pay attention while work and keep yourself without distraction.
# format Searching for disks...done AVAILABLE DISK SELECTIONS: c0d0 <SUN-DiskImage-36GB cyl 65533 alt 2 hd 1 sec 1152>
/[email protected]/[email protected]/[email protected] Specify disk (enter its number): 0 selecting c0d0 [disk formatted, no defect list found] Warning: Current Disk has mounted partitions. /dev/dsk/c0d0s0 is currently mounted on /. Please see umount(1M). /dev/dsk/c0d0s1 is currently used by swap. Please see swap(1M). /dev/dsk/c0d0s5 is currently mounted on /var. Please see umount(1M). 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 show - translate a disk address 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 volname - set 8-character volume name !<cmd> - execute <cmd>, then return quit format> partition> p Current partition table (original): Total disk cylinders available: 65533 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 root wm 7282 - 25486 10.00GB (18205/0/0) 20972160 1 swap wu 0 - 7281 4.00GB (7282/0/0) 8388864 2 backup wm 0 - 65532 36.00GB (65533/0/0) 75494016 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 0 0 (0/0/0) 0 5 var wm 25487 - 40050 8.00GB (14564/0/0) 16777728 6 unassigned wm 0 0 (0/0/0) 0 7 unassigned wm 0 0 (0/0/0) 0
This is the solution step please be careful.Continued from step 4.Till now we know what is the partition details and starting and ending cylinder number for var file system.So lets edit the partition table for var to make it 12 GB.Select the partition number 5 in this case from format menu and answer query like below example.In case of any sector/cylinder wrongly configured overlapping here may lead to data loss.Just for safer side have last backup ready to restore data if required.
partition> 5 >>>Attention here see partition 5 is selected here for edit.<<< Part Tag Flag Cylinders Size Blocks 5 var wm 25487 - 40050 8.00GB (14564/0/0) 16777728 Enter partition id tag[var]: var Enter partition permission flags[wm]: wm Enter new starting cyl: 25487 >>>Keep the starting cylider number same<<< Enter partition size[16777728b, 14564c, 40050e, 8192.25mb, 8.00gb]: 12gb >>>Required size entered here<<< partition> label >>> DO NOT FORGET LABELING IT <<< Ready to label disk, continue? y
6.Now grow var file system using growfs command as below.
# growfs -M /var /dev/rdsk/c0d0s5 Warning: inode blocks/cyl group (95) >= data blocks (48) in last cylinder group. This implies 768 sector(s) cannot be allocated. /dev/rdsk/c0d0s5: 25165824 sectors in 4096 cylinders of 48 tracks, 128 sectors 12288.0MB in 256 cyl groups (16 c/g, 48.00MB/g, 5824 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,24189728, 24288160, 24386592, 24485024, 24583456, 24681888, 24780320, 24878752, 24977184, 25075616
That,s it about How to increase root file system in LDOM. You are done.From Below you can see var file system is now of 12 GB.I continued by veritas upgrade successfully and work accomplished.Keep learning as much as you can and extend your knowledge in subject and excel.See all other topics.
After the work.Please check var is of 12 GB size.
# df -h /var Filesystem size used avail capacity Mounted on /dev/dsk/c0d0s5 12G 7.5G 4.3G 64% /var
Note : All action performed here required root level access on server.
We are sharing our practical experiences related to specific task .How an system administrator can perform specific task like How to increase root file system in LDOM. Most of our posts are almost related to how too,s with goal to share real world practical experiences.If you think it is having worth to share with those who needs it ,We will really appreciate .Our expectation is that it can be shared on all social media like Facebook, twitter, Instagram, Pinterest etc as much as possible to maximize it,s reach to intended persons to achieve it,s real meaning and it can help many communities people..
You can subscribe to our news letter to get latest updates or you can use RSS to get regular feed .There is absolutely no bullish marketing mails or spam kind of mails.Use our contact form to reach us in case of any query doubt or for any thing,we will be able to assist asap.