Resize Solaris Partition

I have a laptop running OpenSolaris Nevada Build 65 and today I decided I wanted to play with ZFS on my laptop. But first, I decided that I needed to repartition my current Solaris partition table so that I could use my slices as if they were like separate disks so I could do mirroring, add and delete storage devices to my zpool etc... The following steps are what I did to repartition my Solaris partition table on my laptop.

My current partitions:
s0 /
s1 /swap
s3 /NV
s7 /export/home

slice 0 is for the root filesystem, slice1 is swap, slice3 is my alternate boot environment so I can use Live Upgrade and slice7 is my data.

This is not a problem, I’ll just steal cylinders from Slice7, because this is a lot simpler than reinstalling. First let’s back up my data on Slice7 and then drop into single user mode by rebooting ("# reboot") and in the grub menu booted the system in "Solaris Failsafe".

Then you get the question similar to this,

Solaris Nevada snv_65 was found on /dev/dsk/c0d0s0.
Do you wish to have it mounted-read-write on /a? [y,n]"

Answer no, so you can resize Slice7 (I actually divided the number of slice7 cylinders by 4 so I could create four equal slices.

# Do you wish to have it mounted-read-write on /a? [y,n] n

Starting Shell.

#

# format

Searching for disks…done

 

AVAILABLE DISK SELECTIONS:

0. c0d0 <DEFAULT cyl 14565 alt 2 hd 255 sec 63>

/pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0>

Specify disk (enter its number): 0

selecting c0d0

[disk formatted, defect list found]

format> par

partition> 7

Part Tag Flag Cylinders Size Blocks

7 unassigned wu 3076 - 14564 88.00GB

 

Enter partition id tag[unassigned]:

Enter partition permission flags[wm]:

Enter new starting cyl[3076]:

Enter partition size[2026160b, 430c, 429e, 989.34mb, 0.97gb]: 2872c

partition> 7

Part Tag Flag Cylinders Size Blocks

7 unassigned wm 3076 - 5947 22.00GB (2872/0/0) 46138680



I basically repeated the same thing for slices 6, 5 & 4; I made all four slices 22GB and then did label command with in partition menu to write map out to disk.

I then rebooted and now I had 4 new slice I could play with using ZFS.

My NEW partitions:
s0 /
s1 /swap
s3 /NV
s4 zfs
s5 zfs2
s6 zfs3
s7 zfs4


Comments:

I just follow your suggest and grow the partition. There is a little different in growing the partition.

It doesn't need booted the system into "Solaris Failsafe" mode. Just su to root and change the partition size.

I changed the last partition and grow it(which is /dev/rdsk/c2d0s7 and mount in /export).

Then it needs run the growfs command,
#growfs -M /export /dev/rdsk/c2d0s7

That's it.

Posted by Mike Cheng on June 10, 2009 at 03:15 AM CDT #

I too wish to setup ZFS pool without re-install, and after resizing s7 /export/home as suggested, how do you get around the warning at startup for '/export/home' (in /etc/vsftab) needing fsck?

Running fsck as sugguested produced I/O errors and unrepairable problems, only resolved by adding space back and running 'fsck -y' a few times.

Posted by Ross Lindell on July 20, 2009 at 07:41 PM CDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Wences is interested in data center technologies including Web 2.0, Cloud Computing, Eco Computing, Solaris 10, OpenSolaris, Information Security and Server Virtualization.

Search

Archives
« August 2015
SunMonTueWedThuFriSat
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
     
Today