zyxel 325v2 migration fail

13»

All Replies

  • kaNe
    kaNe Posts: 9  Freshman Member
    edited October 2019
    Ok, i have both disks in, the new 4 TB-Disk is in Slot 1 and the old 3 TB-Disk is in slot 2. 

    Next i checked the Name and if there was a MD-Device. 
    ~ # cat /proc/partitions                                              
    major minor  #blocks  name
    7        0     143360 loop0                                           
    8        0 3907018584 sda                                             
    8        1     498688 sda1                                            
    8        2 3906518016 sda2                                           
    31        0       1024 mtdblock0                                       
    8       16 2930266584 sdb                                             
    8       17     498688 sdb1                                            
    8       18 2929766400 sdb2                                           
    31        1        512 mtdblock1                                      
    31        2        512 mtdblock2                                      
    31        3        512 mtdblock3                                      
    31        4      10240 mtdblock4                                      
    31        5      10240 mtdblock5                                      
    31        6      48896 mtdblock6                                      
    31        7      10240 mtdblock7                                      
    31        8      48896 mtdblock8                                       
    9        0 3906516992 md0                                             
    9        1 2929765240 md1                                          
    ~ # cat /proc/mdstat                                                  
    Personalities : [linear] [raid0] [raid1]                             
    md1 : active raid1 sdb2[0] 
    2929765240 blocks super 1.2 [2/1] [U_] 
    md0 : active linear sda2[0]   
    3906516992 blocks super 1.2 0k rounding
    unused devices: <none>

    So the old disk is md1. The md-Device is stopped:

    ~ # mdadm --stop /dev/md1                                             
    mdadm: stopped /dev/md1  
    Next i want to build the loop-Device on the old disk!?!
    ~ # losetup -o 1048576 /dev/loop1 /dev/<b>sdb2</b>
    When i enter this Code, nothing happens. I do not get any info, no errors, i can just keep on entering commands. So i entered the command to mount the loopdevice:

    ~ # losetup -o 1048576 /dev/loop1 /dev/sdb2                           
    ~ # mkdir /mnt/mountpointmount -o ro /dev/loop1 /mnt/mountpoint       
    mkdir: invalid option -- 'o'                                          
    BusyBox v1.17.2 (2017-06-23 10:40:08 CST) multi-call binary.
    Usage: mkdir [OPTIONS] DIRECTORY...

    Am i using the wrong comment with:
    ~ # losetup -o 1048576 /dev/loop1 /dev/sdb2 

    And just for my understanding: I want to create the loopdevice on the old device (with all my data on it) and then find the mountpoint of the NEW device md0 with:
    cat /proc/mounts | grep /dev/md<b>0</b>

    In the last step, when i enter a share, will this copy all data from the old drive?
    And is it "admin" or could it be something else on my device?

    Again, i don't know how to thank you enough!

  • Mijzelf
    Mijzelf Posts: 2,598  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    mkdir /mnt/mountpointmount -o ro /dev/loop1 /mnt/mountpoint       
    mkdir: invalid option -- 'o'                
    It's this marvelous forumsoftware which glued the lines together. I edited my post.

    And just for my understanding: I want to create the loopdevice on the old device (with all my data on it) and then find the mountpoint of the NEW device md0 with:
    Yes. grep searches for patterns, so without that 0 it will show both.

    In the last step, when i enter a share, will this copy all data from the old drive?
    And is it "admin" or could it be something else on my device?
    Yes. 'cp -a' is a sort of clone command. The 'v' makes it verbose, so you can see all files copied. You can use any directory on your new disk, I used admin because I know that exists.
  • kaNe
    kaNe Posts: 9  Freshman Member
    edited October 2019
    ~ # mdadm --stop /dev/md1                                             
    mdadm: stopped /dev/md1                                                                                    
    ~ # losetup -o 1048576 /dev/loop1 /dev/sdb2                           
    ~ # mkdir /mnt/mountpoint                                             
    ~ # mount -o ro /dev/loop1 /mnt/mountpoint
    ~ #                                                                   
    ~ #  cat /proc/mounts | grep /dev/md0
    /dev/md0 /i-data/d765169d ext4 rw,noatime,barrier=0,data=writeback,usrquota 0 0                                                             
    /dev/md0 /usr/local/zy-pkgs ext4 rw,noatime,barrier=0,data=writeback,usrquota 0 0                                                           
    /dev/md0 /etc/zyxel/zy-pkgs ext4 rw,noatime,barrier=0,data=writeback,usrquota 0 0                                                           
    /dev/md0 /usr/local/apache/htdocs/adv,/pkg ext4 rw,noatime,barrier=0,data=writeback,usrquota 0 0                                            
    /dev/md0 /usr/local/apache/web_framework/data/cache ext4 rw,noatime,barrier=0,data=writeback,usrquota 0 0                                   
    /dev/md0 /usr/local/apache/htdocs/adv,/res/imdb_poster ext4 rw,noatime,barrier=0,data=writeback,usrquota 0 0                                
    ~ # cd /i-data/d765169d/admin/                                        
    /i-data/d765169d/admin #                                              
    /i-data/d765169d/admin # cp -av /mnt/mountpoint/*                     
    cp: can't create directory '/mnt/mountpoint/video/Filme': Read-only file system
    cp: can't create directory '/mnt/mountpoint/video/Test': Read-only file system
    cp: can't create directory '/mnt/mountpoint/video/Vollkornbrot': Read-only file system 
    cp: can't create directory '/mnt/mountpoint/video/admin': Read-only file system
    cp: can't create '/mnt/mountpoint/video/aquota.user': Read-only file system
    cp: can't create directory '/mnt/mountpoint/video/lost+found': Read-only file system
    cp: can't create directory '/mnt/mountpoint/video/music': Read-only file system
    cp: can't create directory '/mnt/mountpoint/video/photo': Read-only file system
    cp: can't create directory '/mnt/mountpoint/video/public': Read-only file system                                                            
    /i-data/d765169d/admin #
    

    So this is the output. 
    Do these following commands do anything? Should i wait some time before executing the next command? 
    ~ # losetup -o 1048576 /dev/loop1 /dev/sdb2                           
    ~ # mkdir /mnt/mountpoint                                             
    ~ # mount -o ro /dev/loop1 /mnt/mountpoint   
    I get no output for that.
  • Mijzelf
    Mijzelf Posts: 2,598  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    /i-data/d765169d/admin # cp -av /mnt/mountpoint/*   
    <pre class="CodeBlock"><code>cp -av /mnt/mountpoint/* .
    You missed the subtile dot at the end. That means 'copy to current directory. Now the last directory on the source is used for that. (And fails, as, for safety, the device is mounted readonly.

    I get no output for that.
    That is normal in Linux world. A succeeded command doesn't give any output, unless the output is a desired result.

  • kaNe
    kaNe Posts: 9  Freshman Member
    Ok, i executed all the commands and it sounds like the HDDs are working. 
    I should get some info in the Command-Window at some point?
    Will it tell me, when it is finished? 

  • Mijzelf
    Mijzelf Posts: 2,598  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    ? 'cp -av' is supposed to list all files it's copying. When done, you will get back on the prompt.

    Meanwhile you should be able to see your files appearing in the admin share.
     
  • kaNe
    kaNe Posts: 9  Freshman Member
    I did not get any info about the files being copied, but the Disk got fuller and fuller in the WEB-UI. I have all the data back, tomorrow i am picking up a external HDD to have a Backup!
    Thank you soo much for your help!!!!

    Do you work for Zyxel or get any compensation for your work here?
  • Mijzelf
    Mijzelf Posts: 2,598  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Thank you soo much for your help!!!!
    You're welcome.
    Do you work for Zyxel or get any compensation for your work here?

    No and no.

Consumer Product Help Center