Tags:
create new tag
view all tags

Solaris UFS partitioning and RAID mirroring for the X4500

My first try at getting a Solaris partitioning (most of this is taken from an excellent howto by www.gravity.phy.syr.edu):

fdisk types

  • EFI: Extensible Firmware Interface. Used when a whole disk is added to ZFS
  • SMI: Sun Microsystems Inc. This is the legacy disk type. Use this to make a bootable classical UFS setup (?)

See this article (Solaris 9) for a description of features and limitations of the two fdisk types.

Make sure that the disks are of the correct fdisk types. This can be checked by e.g. using the hd -a command:

hd -a
                                                                   fdisk
Device    Serial        Vendor   Model             Rev  Temperature Type
------    ------        ------   -----             ---- ----------- ----

...
c6t0d0p0  F402P6G3N3EF  ATA      HITACHI HUA7250S  A90A None      Solaris2
....
c6t4d0p0  F402P6G3N3TF  ATA      HITACHI HUA7250S  A90A None      EFI

The fdisk type can be changed by using the -e (extended) option to the fdisk command.

format -e
Searching for disks...done


AVAILABLE DISK SELECTIONS:
...
      28. c6t4d0 
          /pci@1,0/pci1022,7458@4/pci11ab,11ab@1/disk@4,0
...

Specify disk (enter its number): 28
selecting c6t4d0
[disk formatted]

format> current
Current Disk = c6t4d0

/pci@1,0/pci1022,7458@4/pci11ab,11ab@1/disk@4,0

format> label
[0] SMI Label
[1] EFI Label
Specify Label type[1]: 0
Warning: This disk has an EFI label. Changing to SMI label will erase all
current partitions.
Continue? y
Auto configuration via format.dat[no]?
Auto configuration via generic SCSI-2[no]?

The current rpm value 0 is invalid, adjusting it to 3600
You must use fdisk to delete the current EFI partition and create a new
Solaris partition before you can convert the label.

 I then used fdisk to delete partition 1 and recreate a "Solaris2" partition.

Solaris UFS partitioning for the X4500

In the Solaris10 DVD installation, I used the following manual layout for the boot and system disk:

Customize Disk: c6t0d0
Boot Disk: c6t0d0

  Entry:                            Recommended:      Cyls   Minimum:      Cyls
================================================================================
  Slice  Mount Point               Size (Cyls)  Start Cyl     End Cyl
     0   /                               59793       1005       60797
     1   swap                             1000          1        1000
     2   overlap                         60798          0       60797     (look at comment below)
     3                                       2       1001        1002           (for meta DB)
     4                                       2       1003        1004           (for meta DB)
     5                                       0          0           0
     6                                       0          0           0
     7                                       0          0           0
================================================================================
           Solaris Partition Size:       60800 Cyls
                      OS Overhead:           3 Cyls

                  Usable Capacity:       60797 Cyls
                        Allocated:       60797 Cyls
                             Free:           0 Cyls

overlap: This partition or Solaris slice is some Solaris internal thing and covers the whole of the disk. The other partitions seem to live inside it. Just ignore it and leave the values as they are.

In MB this amounts to:

  Slice  Mount Point                 Size (MB)
     0   /                              469030
     1   swap                             7844
     2   overlap                        476913
     3                                      15
     4                                      15

Setting up RAID mirroring

We'll set up the RAID mirror on the second disk that can be used as a boot disk. Using the hd command, we can identify this disk as c6t4.

The prtvtoc command can be used to print the partition table of a disk (Note that for the disk name, the special slice s2 is used, i.e. the one named overlap that contains all the others):

Create partition layout on the mirror disk

prtvtoc /dev/dsk/c6t0d0s2
* /dev/dsk/c6t0d0s2 partition map
*
* Dimensions:
*     512 bytes/sector
*      63 sectors/track
*     255 tracks/cylinder
*   16065 sectors/cylinder
*   60800 cylinders
*   60798 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00   16145325 960574545 976719869   /
       1      3    01      16065  16065000  16081064
       2      5    00          0 976719870 976719869
       3      0    00   16081065     32130  16113194
       4      0    00   16113195     32130  16145324
       8      1    01          0     16065     16064

The information from the prtvtoc output can be piped into the fmthard command to create the same layout on another disk. We use this for the intended mirror disk.

 
prtvtoc /dev/dsk/c6t0d0s2 | fmthard -s - /dev/rdsk/c6t4d0s2

fmthard:  New volume table of contents now in place.

Initialize the Solaris RAID metadata table on the unassigned slices

metadb -af -c 2 /dev/dsk/c6t0d0s3 /dev/dsk/c6t0d0s4
metadb -af -c 2 /dev/dsk/c6t4d0s3 /dev/dsk/c6t4d0s4

The metadb command should report the following

metadb
        flags           first blk       block count
     a        u         16              8192            /dev/dsk/c6t0d0s3
     a        u         8208            8192            /dev/dsk/c6t0d0s3
     a        u         16              8192            /dev/dsk/c6t0d0s4
     a        u         8208            8192            /dev/dsk/c6t0d0s4
     a        u         16              8192            /dev/dsk/c6t4d0s3
     a        u         8208            8192            /dev/dsk/c6t4d0s3
     a        u         16              8192            /dev/dsk/c6t4d0s4
     a        u         8208            8192            /dev/dsk/c6t4d0s4

Set up the meta devices

The metainit command is used to set up the meta devices
  • -f forces the metainit command to continue even if one of the slices contains a mounted file system or is being used as swap, or if the stripe being created is smaller in size than the underlying soft partition. This option is required when configuring mirrors on root (/), swap, and /usr.
  • d10 (concat/stripe): the name we assign to the metadevice
  • 1 (numstripes): For a simple stripe numstripes is always 1 (q.v. man page)
  • 1 (width): Specifies the number of slices that make up a stripe. When width is greater than 1, the slices are striped.
  • /dev/dsk/c6t0d0s0 (component): The logical name for the physical slice (partition) on a disk drive
metainit -f d10 1 1 /dev/dsk/c6t0d0s0
  d10: Concat/Stripe is setup

metainit -f d11 1 1 /dev/dsk/c6t4d0s0
 d11: Concat/Stripe is setup

Add disks and configure root metadevice

We now create a mirror set (-m flag) with name d1 and add the first drive to it
metainit d1 -m d10
 d1: Mirror is setup

The metaroot command sets up the files for a root filesystem metadevice.

metaroot -n d1  # -n flag just lists what would be done. This command changes many config files

metaroot d1

Create mirror for the swap partition

Disable the swap device and check with the swap -l command whether No swap devices configured is reported back.

swap -d /dev/dsk/c6t0d0s1
 /dev/dsk/c6t0d0s1 was dump device --
 invoking dumpadm(1M) -d swap to select new dump device
 dumpadm: no swap devices are available

swap -l
 No swap devices configured

Set up the partitions to use for the swap disk mirror with

metainit d20 1 1 c6t0d0s1
metainit d21 1 1 c6t4d0s1
metainit d2 -m d20
metattach d2 d21

metainit d20 1 1 c6t0d0s1
 d20: Concat/Stripe is setup

metainit d21 1 1 c6t4d0s1
 d21: Concat/Stripe is setup

metainit d2 -m d20
 d2: Mirror is setup

metattach d2 d21
 d2: submirror d21 is attached

Edit the file /etc/vfstab and change the line

/dev/dsk/c6t0d0s1  -       -       swap    -       no      -
to
/dev/md/dsk/d2  -       -       swap    -       no      -

Reboot and attach the the second mirror disk

Reboot the machine

init 6

Attach the second root sub-mirror to the RAID with

metattach d1 d11
 d1: submirror d11 is attached

Copy the boot loader files

installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c6t4d0s0

 Solaris boot partition inactive.
 stage1 written to partition 0 sector 0 (abs 16065)
 stage2 written to partition 0, 265 sectors starting at 50 (abs 16115)

Check setup

The metastat command will now show the following summary for the created meta devices. Note, that it also reports on the state of the synchronization for the mirror devices.

metastat

d2: Mirror
    Submirror 0: d20
      State: Okay
    Submirror 1: d21
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 16065000 blocks (7.7 GB)

d20: Submirror of d2
    State: Okay
    Size: 16065000 blocks (7.7 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c6t0d0s1          0     No            Okay   Yes


d21: Submirror of d2
    State: Okay
    Size: 16065000 blocks (7.7 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c6t4d0s1          0     No            Okay   Yes


d1: Mirror
    Submirror 0: d10
      State: Okay
    Submirror 1: d11
      State: Resyncing
    Resync in progress: 1 % done
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 960574545 blocks (458 GB)

d10: Submirror of d1
    State: Okay
    Size: 960574545 blocks (458 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c6t0d0s0          0     No            Okay   Yes


d11: Submirror of d1
    State: Resyncing
    Size: 960574545 blocks (458 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c6t4d0s0          0     No            Okay   Yes


Device Relocation Information:
Device   Reloc  Device ID
c6t4d0   Yes    id1,sd@SATA_____HITACHI_HUA7250S______GTA460P6G45WXF
c6t0d0   Yes    id1,sd@SATA_____HITACHI_HUA7250S______GTA460P6G45U0F

More Information

Partitioning troubles

Note: I guess this was due to non-matching fdisk types (see above). Probably could have been solved that way

On an older X4500 (t3fs06) I was not able to create a root partition with more than 1023 cylinders of size.

The root (/) file system must lie entirely within the first 1023
        cylinders of the disk drive which contains it.

Customize Disk: c6t0d0
Boot Disk: c6t0d0

  Entry:                            Recommended:      Cyls   Minimum:      Cyls
================================================================================
  Slice  Mount Point               Size (Cyls)  Start Cyl     End Cyl
     0   /                                1010          1        1010
     1   swap                             1000       1011        2010
     2   overlap                         60798          0       60797
     3                                       2       2011        2012
     4                                       2       2013        2014
     5   /usr                             1000       2015        3014
     6   /var                             1012       3015        4026
     7   /opt                            56771       4027       60797
================================================================================
           Solaris Partition Size:       60800 Cyls
                      OS Overhead:           3 Cyls

                  Usable Capacity:       60797 Cyls
                        Allocated:       60797 Cyls
                             Free:           0 Cyls

-- DerekFeichtinger - 08 Jan 2009

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2009-07-27 - DerekFeichtinger
 
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback