Disk Replacement - NAS 540

Options
Hi, 
I changed the drive in the NAS. The new drive works, there are no problems, but in the NAS it is incorrectly recognized when it comes to capacity. The new one has 8TB. 
How to resolve the issue of incorrect display of disk size?


«1

All Replies

  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options
    Can you enable the ssh server on the box, login over ssh, and post the output of
    cat /proc/partitions
    df
  • MickBB
    MickBB Posts: 12
    10 Comments
    Options

  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options
    The data partition (sda3) of your 8TB disk (sda) is no bigger than 2.9TB, and has exactly the same size as the data partition of your 3TB disk (sdb). Have they been a raid1 array together?
    Anyway, when the webinterface doesn't give you the possibility to enlarge that partition (which it does for raid1/5 arrays where all disks are exchanged one by one for bigger ones), then the only way I see is to do it manually. Are you comfortable with the command line?
  • MickBB
    MickBB Posts: 12
    10 Comments
    edited October 2022
    Options
    I clone old 3TB disk using dock station. All data is in new one. This is no RAID, all disks stand alone. 
    Regarding to command line, if you gave me commands I think I can do it. What about data I won't lose it?
  • MickBB
    MickBB Posts: 12
    10 Comments
    Options

  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options
    What about data I won't lose it?

    Not necessarily. Enlarging the filesystem can be done without loosing data. But it's profound surgery. If you do it wrong, or if you get a power failure during the operation, you'll possibly loose the data.

    Having said that, in your case it's 3 stages:

    • Enlarge the partition
    • Enlarge the raid container (On a ZyXEL every data volume is always in a raid container. In your case a single disk raid1, I think)
    • Enlarge the filesystem

    Unfortunately the NAS doesn't have a partition editor which can be used to enlarge a partition. So basically you'll have to delete the partition, and create it again, having the same start and a new end. That doesn't hurt the data. It's like moving the fence around your yard. The tree in your garden doesn't notice.

    The partition editor on the NAS is called fdisk. To launch it execute

    su

    fdisk /dev/sda

    It will show you how to read the help ('m', when I'm not mistaken). Then press 'l' to show the current partitions. 'd 3' will delete the 3th partition. And 'n <enter> <enter>' will create a new one, with default start and size, which is OK, I think. Of course I can be mistaken, it's an interactive process. Unless you press 'w' nothing will be written, and you can simply kill fdisk (by closing the shell). When you have enlarged the partition, execute 'cat /proc/partitions' again to see if sda3 is bigger now. If not, reboot first.

    Then enlarging the raid container. The container is either md3 or md4, according to their sizes. To see which one it is, execute 'cat /proc/mdstat', and see which one uses sda3. The command to enlarge it is

    su

    mdadm --grow --size=max /dev/md3

    (It doesn't hurt when you apply it to the wrong container. All other containers are on max size, and so it will do nothing). By executing 'cat /proc/partitions' again you should see the raid container have a new size, a few kB smaller than sda3.

    Finally you'll have to grow the filesystem:

    resize2fs /dev/md3

    This is the only command which takes a measurable amount of time. The other two were just editing a number in a configuration header, this one will actually do something.

    It is possible that you will get error messages from mdadm and/or resize2fs. I'm not sure if either command can be executed on a 'live' system. In that case come back. (And, after each step you are left with a still working data volume)

    Having said all that, of course it's easier (and less error prone) when you can connect the disk to another system, and use a graphical partition manager. Gparted should be able to do the job. You should not touch the first two partitions, only move the end of partition 2. I think gparted will also take care of the raid container and file system.


  • MickBB
    MickBB Posts: 12
    10 Comments
    Options
    Hi, 
    I need help.  :/. What a mess. 
    I try to reverse whole operations. Finally I have a new 8TB disk with a partition of an old 3TB drive, which is invisible neither from Windows nor in the NAS540. The data is there but not available. In the Pargon Hard Disk Manager I have info, which probably solves the problem (screen in attach). However, I do not have the ability to make it form LInux because I do not have this system on my computer. What commands do I need to give to make the partition in the NAS visible again.


  • MickBB
    MickBB Posts: 12
    10 Comments
    Options

  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options
    Can you post the output of


    su
    fdisk -l /dev/sda
    fdisk -l /dev/sdb
    mdadm --examine /dev/sda3
  • MickBB
    MickBB Posts: 12
    10 Comments
    Options

Consumer Product Help Center