3 replies Latest Post - ‏2008-06-02T14:30:56Z by SystemAdmin
4779 Posts

Pinned topic Resize Logical Drive

‏2008-06-02T11:48:39Z |
I have a DS3200 with one dual connected x3550.

I Resized a logical drive using the following command:

set logiscalDrive addCapacity=42949672960;

The command completed successfully.

On my Server (Linux) I unmount the logical drive and try to resize the filesystem yet it does not recognize the increased size. df reports it as 294G while the Storage Manager reports the drive as 333.687 GB.

I have tried running the hot_add utility which completed sucessfully but did not produce a change in the behavior of my resize command.

How to I inform my server that the partition/logical drive has increased? Is a reboot my only answer? (not a good one!)
Updated on 2008-06-02T14:30:56Z at 2008-06-02T14:30:56Z by SystemAdmin
  • SystemAdmin
    4779 Posts

    Re: Resize Logical Drive

    ‏2008-06-02T13:09:36Z  in response to SystemAdmin
    You need to use a partition manager to increase the partition size; after that you can increase the filesystem size.

    Using fdisk is one way. Rather scarily, you have to delete the partition first and then recreate it. However, you do this within a single session and the changes are not written to the partition table until you exit fdisk.

    For instance, you would run fdisk -l

    Disk /dev/sda: 36.4 GB, 36401315840 bytes
    254 heads, 63 sectors/track, 4442 cylinders
    Units = cylinders of 16002 * 512 = 8193024 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 13 103981+ 83 Linux
    /dev/sda2 14 4442 35436429 8e Linux LVM

    Disk /dev/sdb: 109.2 GB, 109203947520 bytes
    255 heads, 63 sectors/track, 13276 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sdb1 * 1 13276 106639438+ 8e Linux LVM

    Then, fdisk /dev/sda (for the sake of argument)

    Having noted the Start of /dev/sda2, you can delete it and then recreate it with the same Start, but a higher End. Make sure the Id is correct.

    Alternatively, use a more advanced partition manager that will hide this from you and just allow you to 'increase partition size'
    • SystemAdmin
      4779 Posts

      Re: Resize Logical Drive

      ‏2008-06-02T14:00:30Z  in response to SystemAdmin
      Thanks for your help, I am already on an advanced file system and deleting a partition of this size and recreating it is an unacceptable solution in a long term sense. I am surprised how hard it is to grow a logical drive in the first place as it seems to be a need other storage systems can accomplish.

      I use Reiserfs and the command to resize a partition is resize_reiserfs as seen here:

      the commands I ran and the responses are:
      resize_reiserfs -v /dev/sdf

      /dev/sdf already is of the needed size. Nothing to be done

      resize_reiserfs -s +30G -v /dev/sdf

      /dev/sdf is of 76988160 blocks size only with reiserfs of 76988160 blocks
      size on it. You are trying to expand reiserfs up to 84852480 blocks size.
      You probably forgot to expand your partition size.

      The Capacity listed for this Logical Drive (from storage manager) is 333.687 GB (358,293,176,320 Bytes)
      The command df for /dev/sdf gives 307943236 (1K blocks) or 294 GB
      • SystemAdmin
        4779 Posts

        Re: Resize Logical Drive

        ‏2008-06-02T14:30:56Z  in response to SystemAdmin
        Actually, this is not a function of the storage system at all; you'd be facing this if you were on DS8300 or SVC storage also.

        So, I think there's a little confusion about partitions and filesystems.

        A filesystem cannot change the size of your partition. The filesystem is simply a method of organising files.

        A partition is a region of blocks on a storage device.

        Thus, the normal flow is to take a storage device, create a partition on it and then format that partition to support a specific filesystem type.
        In order to increase the size of the filesystem, you need to increase the size of the partition. These are two separate activities.

        This is outlined in paragraph 2 of the link you provided:

        <cite>The resize_reiserfs program does not manipulate the size of the device. If you wish to enlarge a filesystem, you must make sure you expand the underlying device first. This can be done using cfdisk(8) for partitions, by deleting the partition and recreating it with a larger size (assuming there is free space after the partition in question). Make sure you re-create it with the same starting disk cylinder as before! Otherwise, the resize operation will certainly not work, and you may lose your entire filesystem.</cite>

        I didn't explain the process of increasing a partition's size very well. You do not need to delete the partition and all of its contents and then recreate them from scratch.

        What you do need to do is to delete the current partition's definition from the partition table and provide a new definition, in order to access the additional storage. The data itself is not touched, but the definition of the partition is changed.

        It's the filesystem that remembers which LBA contains which file, so modifying the partition will not alter that.

        Here's a metaphor that may help.

        You run a company which is situated on floors 2 and 3 of a 100 storey building. In the lobby, there is a sign which lists all of the companies and which floors they are on.
        You have a few good years and grow in size so that you now occupy floors 2-5 (nice work!).
        The sign in the lobby needs to be changed. However, when they take down the old one, your office drones are still working away on floors 2 and 3. It's just that, when they put up the new sign, visitors to the building can now see that your a 4 floor company, not a 2 floor company.

        The sign in the lobby (if you hadn't guessed) is your partition table. So long as the partition table has the correct Start and Finish values in it, you will be able to access your data.

        That said, using fdisk can be a little hairy for the uninitiated. Depending on your distribution of Linux, there is probably a friendlier partition manager that you can use. RHEL's is called 'parted'. However, unless I'm mistaking, they're all gonna be doing the same thing as I said above.

        Hope that helps.
        Updated on 2008-06-02T14:30:56Z at 2008-06-02T14:30:56Z by SystemAdmin