How to replace disk and migrate data in NAS326?

Options
Hello,

In my NAS326 there are a 300GB (Volume1) and a 2TB (Volume2) disk. Volume2 is almost full. I've just bought a 4TB replacement disk and I want to migrate all data from 2TB to 4TB disk.
Question1: Is there any option to do the Volume2 migration to the bigger disk if I temporarily replace Volume1 disk with the new 4TB? How can I do it?

Question2: After that can I access data on Volume1 without any data loss if I replace the old 2TB disk with the temporarily removed Volume1?

Thank You!

Best Answers

  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Answer ✓
    Options
    1) Do you have any command line experience? The fastest way to copy the data over is to create a new volume on the 4TB disk, and then copy everything over (as root) with

    cp -a /i-data/<DISK2TB>/* /i-data/<DISK4TB>/ 2>&1 >/dev/null &

    This will take around 8 hours. Meanwhile you can close your session as the copy command is backgrounded. Problem is that <DISK2TB> and <DISK4TB> have names which are unique for your box. So you'll have to find out.

    2) Yes, more or less. It is possible that you loose all your installed packages and their settings. And in case of MySQL the contents of the database. (Which you can backup first, of course). All packages are installed on the system volume, which is in most cases the first volume you created. When the system volume is gone, another volume will become system volume, and that won't revert if you put the original disk back.
    Further you'll have to re-enable any shares on a disk which has been out of the box.
  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Answer ✓
    Options
    Except that /a-data/ should be /i-data/, yes, wouldn't know why not.
  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Answer ✓
    Options
    The last & means put in background. The process is detached from the terminal it's running in, so you can close it, and leave the NAS alone.
    >/dev/null is redirect the stdout of the process to /dev/null, the universal recycle bin. As the process will be detached from terminal, we'll have to redirect the output.
    2>&1 is redirect stderr to stdout. A Linux process has 2 output pipes, stdout and stderr. Both have to be redirected before detaching. I could also have written
    process 2>/dev/null >/dev/null
    or
    process 2>/dev/null 1>/dev/null

  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Answer ✓
    Options
    It's some time ago. When I remember well you can see the directories on the 4TB disk in the shares menu, where you can enable them as share. Complicating is that each share name can be used only once, so the directories in the 4TB disk will get shares like <share>2.
    If you don't want that, remove the disk for security, and delete the lost shares. Then plugin the disk and share the directories.

All Replies

  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Answer ✓
    Options
    1) Do you have any command line experience? The fastest way to copy the data over is to create a new volume on the 4TB disk, and then copy everything over (as root) with

    cp -a /i-data/<DISK2TB>/* /i-data/<DISK4TB>/ 2>&1 >/dev/null &

    This will take around 8 hours. Meanwhile you can close your session as the copy command is backgrounded. Problem is that <DISK2TB> and <DISK4TB> have names which are unique for your box. So you'll have to find out.

    2) Yes, more or less. It is possible that you loose all your installed packages and their settings. And in case of MySQL the contents of the database. (Which you can backup first, of course). All packages are installed on the system volume, which is in most cases the first volume you created. When the system volume is gone, another volume will become system volume, and that won't revert if you put the original disk back.
    Further you'll have to re-enable any shares on a disk which has been out of the box.
  • zsbiro
    zsbiro Posts: 4
    First Anniversary First Comment
    edited February 2021
    Options
    Hello Mijzelf,

    Thank you for your answer!
    I logged into my NAS via an SSH session and listed /i-data directory. This is the content of it:
    42018f41  c6c3a8f9  sysvol
    I checked the content of 42018f41  and c6c3a8f9 and realized that 42018f41 = Volume1 c6c3a8f9 = Volume2.
    So I'm going to do the following:
    1. Perform backup of Volume1 to a local drive. Not painful, there is only about 200 GB.
    2. Shut down NAS326.
    3. Remove disk of Volume1 and install the new one.
    4. Switch the box on.
    5. Create new volume.
    6. Login via SSH
    7. Check content of /i-data and figure out which directory is my new volume.
    8. Perform copy with cp command as you wrote above.
    8. Shut down.
    10. Remove 2TB disk.
    11. Switch it on.
    12. Check content of Volume2.
    13. Shut down.
    14. Install Volume1 disk
    15. Switch on.
    16. Check content of Volume1 and restore data if necessary.

    How do you see, will it work?
    Thank You!

  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Answer ✓
    Options
    Except that /a-data/ should be /i-data/, yes, wouldn't know why not.
  • zsbiro
    Options
    Yes, /i-data/...

    One thing: what do 2>&1 >/dev/null & options mean at the of the cp command?

  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Answer ✓
    Options
    The last & means put in background. The process is detached from the terminal it's running in, so you can close it, and leave the NAS alone.
    >/dev/null is redirect the stdout of the process to /dev/null, the universal recycle bin. As the process will be detached from terminal, we'll have to redirect the output.
    2>&1 is redirect stderr to stdout. A Linux process has 2 output pipes, stdout and stderr. Both have to be redirected before detaching. I could also have written
    process 2>/dev/null >/dev/null
    or
    process 2>/dev/null 1>/dev/null

  • zsbiro
    Options
    Copy process finished. After shutdown I removed the old 2TB drive from NAS and switch the box on.
    Now I can see the status of the particular share is Lost in 'Control Panel / Shared Folders'.
    How can I re-enable the share without data loss?
  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Answer ✓
    Options
    It's some time ago. When I remember well you can see the directories on the 4TB disk in the shares menu, where you can enable them as share. Complicating is that each share name can be used only once, so the directories in the 4TB disk will get shares like <share>2.
    If you don't want that, remove the disk for security, and delete the lost shares. Then plugin the disk and share the directories.

Consumer Product Help Center