Archive for the ‘Sys Admin’ Category

HOWTO: Single ZFS Drive to Mirror

Posted on the July 9th, 2007 under HOWTOs,Sys Admin,Technology / Computing by jglemza

My original installation of NexentaCP just had a single drive being used for the system installation. This can be verified here:
root@ufuk:~# zpool status syspool

  pool: syspool
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        syspool     ONLINE       0     0     0
          c0d0s0    ONLINE       0     0     0

errors: No known data errors
I got my hands on another drive and I wanted to mirror this pool. To do this, issue the following command:
root@ufuk:~# zpool attach syspool mirror c0d0s0 c4d1s0
After a couple hours of resilvering, it’s all setup.
root@ufuk:~# zpool status syspool
  pool: syspool
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        syspool     ONLINE       0     0     0
          mirror    ONLINE       0     0     0
            c0d0s0  ONLINE       0     0     0
            c4d1s0  ONLINE       0     0     0

errors: No known data errors
Done. Loving ZFS.

HOWTO: Replace a ZFS Drive

Posted on the July 9th, 2007 under HOWTOs,Sys Admin,Technology / Computing by jglemza

The setup previously described was using 2 SATA drives and 1 IDE drive to complete my RAID-Z pool. However, I’ve just obtained a new SATA drive that I want to use to replace the IDE drive. This can be accomplished very easily. The current pool status is as follows:
root@ufuk:~# zpool status shet
  pool: shet
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        shet        ONLINE       0     0     0
          raidz1    ONLINE       0     0     0
            c1d0    ONLINE       0     0     0
            c2d0    ONLINE       0     0     0
            c4d0    ONLINE       0     0     0

errors: No known data errors
I need to replace c1d0 with c2d1. This is accomplished with the following command:
root@ufuk:~# zpool replace shet c1d0 c2d1
After a couple hours of resilvering, the new drive is up and running.
root@ufuk:~# zpool status shet
  pool: shet
 state: ONLINE
 scrub: scrub completed with 0 errors on Mon Jul  9 00:50:40 2007
config:

        NAME        STATE     READ WRITE CKSUM
        shet        ONLINE       0     0     0
          raidz1    ONLINE       0     0     0
            c2d1    ONLINE       0     0     0
            c2d0    ONLINE       0     0     0
            c4d0    ONLINE       0     0     0

errors: No known data errors
Once again, ZFS proves itself to be incredibly simple.

HOWTO: ZFS RAID-Z Up and Running on NexentaCP

Posted on the June 29th, 2007 under HOWTOs,Sys Admin,Technology / Computing by jglemza

This week I managed to create a RAID-Z pool of hard drives to begin using on the file server for the house. Here’s a quick howto on how I accomplished this:
  1. Install NexentaCP. (You can use any Solaris flavor you’d like though. I chose Nexenta for it’s apt-get repository.)
  2. Run the ‘format’ command to determine which drives you’re going to add to the pool.
    root@ufuk:~# format
    Searching for disks...done


    AVAILABLE DISK SELECTIONS:
           0. c0d0 <default cyl 4862 alt 2 hd 255 sec 63>
              /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0
           1. c1d0 <st350064-         3PM0FS6-0001-465.76GB>
              /pci@0,0/pci-ide@1f,1/ide@1/cmdk@0,0
           2. c1d1 <default cyl 24790 alt 2 hd 255 sec 63>
              /pci@0,0/pci-ide@1f,1/ide@1/cmdk@1,0
           3. c2d0 <maxtor S-         5QG01BG-0001-465.76GB>
              /pci@0,0/pci8086,244e@1e/pci-ide@3/ide@0/cmdk@0,0
           4. c4d0 <maxtor S-         5QG01BM-0001-465.76GB>
              /pci@0,0/pci8086,244e@1e/pci-ide@3/ide@1/cmdk@0,0
           5. c5d0 <st350063-         9QG0QH4-0001-465.76GB>
              /pci@0,0/pci8086,244e@1e/pci-ide@4/ide@0/cmdk@0,0
    Specify disk (enter its number):
    Do a Ctrl-C at ‘Specify disk’ to not actually use the ‘format’ command on a drive. The disks that I want to install on are c1d0, c2d0, and c4d0. This will give me ~1TB of storage.
  3. Create the pool by running, replace ‘shet’ with your name:
    root@ufuk:~# zpool create shet raidz c1d0 c2d0 c4d0
    Be sure to not include partitions/slices if you want to use the whole drive as part of the pool, write-caching will be disabled. Replace ‘raidz’ with ‘mirror’ if you prefer to mirror your drives.
  4. The pool is instantly mounted to ‘/shet’. You can check this by running:
    root@ufuk:~# zfs list
    NAME                     USED  AVAIL  REFER  MOUNTPOINT
    shet                     212G   703G   212G  /shet
    syspool                 2.73G  33.0G    24K  none
    syspool/rootfs          2.73G  33.0G  2.56G  legacy
    syspool/rootfs@default   178M      -   648M  -
    You can check the status of a pool by running:
    root@ufuk:~# zpool status
      pool: shet
     state: ONLINE
     scrub: none requested
    config:

            NAME        STATE     READ WRITE CKSUM
            shet        ONLINE       0     0     0
              raidz1    ONLINE       0     0     0
                c1d0    ONLINE       0     0     0
                c2d0    ONLINE       0     0     0
                c4d0    ONLINE       0     0     0

    errors: No known data errors

      pool: syspool
     state: ONLINE
     scrub: none requested
    config:

            NAME        STATE     READ WRITE CKSUM
            syspool     ONLINE       0     0     0
              c0d0s0    ONLINE       0     0     0

    errors: No known data errors
That’s it! You can now use it as is or create new filesystems. Since I’m just using this as a media dump, I just left it alone.