Non-destructively grow a ufs file system

Solaris Admin No Comments

Today i had the need to rearrange my root disks in my Solaris work station. I really hadn’t put much thought into the initial layout and was starting to suffer for it. I moved slice5 out the way which left slice4 with the potential to expand by more than 100gb.

Part Tag Flag Cylinders Size Blocks
0 root wm 61305 - 65532 15.00GB (4228/0/0) 31456320
1 swap wu 0 - 563 2.00GB (564/0/0) 4196160
2 backup wm 0 - 65532 232.49GB (65533/0/0) 487565520
3 var wm 60177 - 61304 4.00GB (1128/0/0) 8392320
4 unassigned wm 571 - 14664 50.00GB (14094/0/0) 104859360
5 home wm 14665 - 28758 50.00GB (14094/0/0) 104859360
6 unassigned wm 46084 - 60176 50.00GB (14093/0/0) 104851920
7 unassigned wm 564 - 570 25.43MB (7/0/0) 52080

Do some work:

Part Tag Flag Cylinders Size Blocks
0 root wm 61305 - 65532 15.00GB (4228/0/0) 31456320
1 swap wu 0 - 563 2.00GB (564/0/0) 4196160
2 backup wm 0 - 65532 232.49GB (65533/0/0) 487565520
3 var wm 60177 - 61304 4.00GB (1128/0/0) 8392320
4 unassigned wm 571 - 46083 161.47GB (45513/0/0) 338616720
5 unassigned wm 0 0 (0/0/0) 0
6 home wm 46084 - 60176 50.00GB (14093/0/0) 104851920
7 unassigned wm 564 - 570 25.43MB (7/0/0) 52080

/dev/dsk/c1t1d0s4 51635799 23594933 27524509 47% /mnt

df -k shows the change is not registered, and that’s where the growfs command enters.  I will umount this file system as it is only a data slice, and on the broken part of the mirror.

heineken:/ # growfs /dev/rdsk/c1t1d0s4
Warning: 3696 sector(s) in last cylinder unallocated
/dev/rdsk/c1t1d0s4: 338616720 sectors in 55114 cylinders of 48 tracks, 128 sectors
165340.2MB in 3445 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,
Initializing cylinder groups:
…………………………………………………………..
super-block backups for last 10 cylinder groups at:
337679776, 337778208, 337876640, 337975072, 338073504, 338171936, 338270368,
338368800, 338467232, 338565664

/dev/dsk/c1t1d0s4 166745210 23609269 141468489 15% /mnt

File systems are intact, no loss of data, no downtime. Of course this work was done on the broken mirror, in case of catastrophy my data would be intact on the other side. I will now commit this work to the other side and then mirror it back. As it is just a data slice this is possible - for root obviously downtime would be required. For that, you could look at Live Upgrade, which has more uses other than updating root safely. That will be for another time.

Rename and move a Solaris zone

Solaris Zones No Comments

I created a test zone which is to function as my webserver. Lo and behold it went so well there was no need to destroy and start again. The only problem is i am not happy with the name of the zone, which is webzone. I also didn’t like the location it was on the filesystem. So first to move it from /work/webzone to /work/zones/constantine:

charlemagne:/ # zoneadm -z webzone move /work/zones/constantine

Now to rename the zone itself:

charlemagne:/ # zonecfg -z webzone
zonecfg:webzone> set zonename=constantine
zonecfg:constantine> commit
zonecfg:constantine> exit

charlemagne:/ # zoneadm list -vc
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- constantine installed /work/zones/constantine native shared

The zone cannot be running to perform either task.

“client denied by server configuration” apache error

apache No Comments

I am trying a new version of apache on Solaris. I jumped from 2.058 to 2.2.9. The httpd.conf from the old to the new was no longer valid, so i started again. Made the classic mistake of trying to do everything before testing and the whole configuration was screwed up so i started again. There was an error in the browser i had not seen before:

Forbidden

You don’t have permission to access / on this server

So i looked at all the permission files, all ok. I had another look at the httpd.conf file and found the <Directory> directive has changed to “a very restrictive set of features”. I changed “Deny from all” to “Allow from all” and it is now working.

Add new Solaris release to jumpstart

Solaris Jumpstart No Comments

In a previous post i showed how to add a system to a jumpstart configuration. Now i will show how to add a new release of Solaris to the jumpstart.

# cd /cdrom/cdrom0/Solaris_10/Tools

# ./setup_install_server /work/install/sol10_0508

This will copy all the files from the dvd to the appropriate directories on your jumpstart server. Be patient, this may take a long time.

Don’t forget to edit /etc/bootparams for existing systems in your environment that will want to install the older image.

« Previous Entries