Results 1 to 6 of 6

Thread: Expand/resize single disk

Hybrid View

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    2

    Expand/resize single disk

    Expand/resize a single disk.

    In this tutorial the FreeNAS machine is running on VMware ESXi (the VMware VMFS volumes are configured on RAID-disks, so the FreeNAS does not need to be configured for RAID anymore).

    After you have setup a FreeNAS machine with a single-data-disk and want to expand/resize it later on, this is how I managed it.
    I have an 20GB disk resized to 40GB.

    Shut down the FreeNAS-guest and resize the data-disk with in VMware.
    Screen shot 2011-08-16 at 12.18.51.png

    After booting up the FreeNAS-guest, open a console session.

    # zpool list sataC_1
    NAME SIZE USED AVAIL CAP HEALTH ALTROOT
    sataC_1 17.9G 4.64G 13.2G 25% ONLINE -

    # zpool status sataC_1
    pool: sataC_1
    state: ONLINE
    scrub: scrub completed after 0h0m with 0 errors on Tue Aug 16 10:50:18 2011
    config:

    NAME STATE READ WRITE CKSUM
    sataC_1 ONLINE 0 0 0
    gpt/da1 ONLINE 0 0 0

    errors: No known data errors

    # camcontrol readcap da1 -h
    Device Size: 40 G, Block Length: 512 bytes

    # gpart show da1
    => 34 41942973 da1 GPT (40G) [CORRUPT]
    34 94 - free - (47K)
    128 4194304 1 freebsd-swap (2.0G)
    4194432 37748575 2 freebsd-zfs (18G)

    # zpool export sataC_1

    # gpart status da1
    Name Status Components
    da1p1 CORRUPT da1
    # gpart recover da1
    da1 recovered
    # gpart status da1
    Name Status Components
    da1p1 OK da1

    # gpart show da1
    => 34 83886013 da1 GPT (40G)
    34 94 - free - (47K)
    128 4194304 1 freebsd-swap (2.0G)
    4194432 37748575 2 freebsd-zfs (18G)
    41943007 41943040 - free - (20G)

    Resize the second partition (index 2)
    # gpart resize -i 2 da1
    da1p2 resized
    # gpart show da1
    => 34 83886013 da1 GPT (40G)
    34 94 - free - (47K)
    128 4194304 1 freebsd-swap (2.0G)
    4194432 79691615 2 freebsd-zfs (38G)

    # zpool import
    pool: sataC_1
    id: 699091794103901671
    state: ONLINE
    action: The pool can be imported using its name or numeric identifier.
    config:

    sataC_1 ONLINE
    gpt/da1 ONLINE

    # zpool import sataC_1
    # zpool list sataC_1
    NAME SIZE USED AVAIL CAP HEALTH ALTROOT
    sataC_1 17.9G 4.64G 13.2G 25% ONLINE -

    :-(

    #reboot

    # zpool list sataC_1
    NAME SIZE USED AVAIL CAP HEALTH ALTROOT
    sataC_1 37.9G 4.64G 33.2G 12% ONLINE -

    :-)

    This link gave me some directions and insight how to do it.
    http://forums.freebsd.org/showthread.php?t=17436

  2. #2
    Senior Member
    Join Date
    May 2011
    Posts
    566
    the version of ZFS that is used by FreeNAS does not support expansion of zfs vdevs.
    Last edited by matthewowen01; 08-16-2011 at 11:50 PM. Reason: changed pool to vdev

  3. #3
    Junior Member
    Join Date
    Aug 2011
    Posts
    2
    I understand that ZFS expansion (in this FreeNAS version) is not supported, but as you can see I managed to expand the disk. So it is expanded for me as an end-user.

    Or are these steps not 'the way to go' if I wanted to expand a FreeNAS data-disk?

  4. #4
    Senior Member
    Join Date
    May 2011
    Posts
    566
    Quote Originally Posted by Erik View Post
    I understand that ZFS expansion (in this FreeNAS version) is not supported, but as you can see I managed to expand the disk. So it is expanded for me as an end-user.

    Or are these steps not 'the way to go' if I wanted to expand a FreeNAS data-disk?
    well it looks like it worked, but i wouldn't trust it one bit.

    i did have to make a small change to my last post, pools can expand, vdevs cannot. it seems like you found a way too do it. that being said i doubt there has been enough testing to make sure what you did is bug free under all circumstances. if i get some free time later this week I'll mess around with this. I'd advice much caution to you and anyone reading this.

  5. #5
    FreeNAS 8.x Project Manager
    Join Date
    May 2011
    Location
    San Martin, CA
    Posts
    106
    ZFs was designed to grow in exactly this manner, and I'l note that I do it on production systems quite frequently. The PC-BSD build servers are ESXi VMs running ZFS and have been expanded this way twice, as are the Gnome, KDE, and QAT tinderboxes for the FreeBSD project, which have had one expansion each.

  6. #6
    Senior Member
    Join Date
    Sep 2011
    Posts
    416
    The problem with changing the partitions (as I discovered today when someone tried importing a pool from a Nexenta box, then replacing the disk on the fly via the GUI with the Replace button), is that unless things are consistent in terms of partition size, you can trigger bugs in FreeNAS that are difficult to unravel without database surgery and/or minor pulling out of hair.

    So, if at all possible I highly suggest avoiding command line modifications like this...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •