lossless growing of linear RAID (resizing)

From: M. V. Gandhimohan (a.k.a. G. M. Viswanathan) (gandhi_at_df.ufal.br)
Date: 08/17/05

  • Next message: Javier-Elias Vasquez-Vivas: "Re: lame not in the debian package repository?"
    Date: Wed, 17 Aug 2005 12:26:07 -0300
    To: debian-user@lists.debian.org
    
    

    I had great difficulty finding info. on how to convert from RAID-0 to
    linear and then grow the system.

    I have since found out, and am documenting the details here in case
    others have similar needs.

    My setup (for the compelte debian mirror at debian.fapeal.br) was 2 80
    Gb disks on separate controllers, running RAID-0. This gave me about
    150 Gb on /dev/md0 but the Debian mirror now needs more space. I
    bought one more disk of 120 Gb but I needed to switch from RAID-0 to
    linear, since with 3 disks raid-0 makes no sense if you have only 2
    controllers.

    This is what ended up working:

    1. copy the data from RAID-0 /dev/md0 to the new disk, on an ext2 fs.
       the disk cannot become 100% full, leave some empty space.

    2. then, destroy the old RAID-0 system by running mke2fs

    3. edit /etc/raidtab to remove the old md0 device

    4. edit raidtab to include a new raid linear device. The new disk should
       be the 1st disk, and the old (former RAID-0) disks can be 2 and 3.

    5. create a new raid linear device, with persistent superblock, using
       mkraid -f. You will have to use --really-force and you will get a nasty
       warning about your data being lost. Just sit tight and ignore the warning.

    6. The new raid device will have the full size of the 3 (or more) disks
       concatenated. However, the existing fs will still be in place, so that
       after fsck and mounting, df will show a total size only of the 1st disk.
       the full md device size will not be accessible. Your old data will still
       be there.

    7. so after runnign fsck, run resize2fs /dev/md0 (or other device)
       and the fs size will expand to include the full space. No data
       will be lost.

    I tested this and it works (and my mirror will be back online soon I
    hope).

    Of course, make backups, etc. (IN my case this was not possible due to
    the sheer size and my limited resources).

    There are other methods, like mke2fs -S, but of all the methods I
    tested, this one is the best method for growing a raid-linear device.

    -gandhi

    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Javier-Elias Vasquez-Vivas: "Re: lame not in the debian package repository?"

    Relevant Pages

    • Re: Pyramidable
      ... The PROVED decipherment, i.e. the "Proto-Ionic Solution" has shown ... That the Phaistos Disk would be "Minoan" is ALSO WRONG. ... If Linear B is Greek, ... > Linear A and even ealier cannot be in the Greek language. ...
      (sci.archaeology)
    • Re: [patch 0/4] [RFC] Another proportional weight IO controller
      ... Linear volumes may well be the most common ones. ... You loose all your data when one disk dies, ... striping, or redundancy from raid. ... but each disk in a stripe ...
      (Linux-Kernel)
    • RAID and NFS exports
      ... disk in the RAID-0 configuration failed. ... HPT374 controller about the first disk in the RAID-0 array being bad. ...
      (freebsd-questions)
    • Re: Raid 1 recovery from HD failure
      ... each disk are read at the same time, ... but I know how RAID-0 works. ... see how the file access could be done the same way with each type. ... effective performance can actually be greater than RAID-0's (in the more ...
      (microsoft.public.windows.server.general)
    • Re: MATLAB and RAID
      ... use the second disk as a storage facility. ... in MATLAB (primarily floating point computations). ... neither RAID-0 nor RAID-1 involve any computations. ... data across the drives, while RAID-1 simply puts the same ...
      (comp.soft-sys.matlab)

    Loading