Remove an internal HDD of a NAS540 and install it on a external USB case

MarkusDesk
MarkusDesk Posts: 31  Freshman Member
First Anniversary 10 Comments
edited June 2022 in Personal Cloud Storage
Hello, if I remove a basic volume HDD from a NAS540 and put it on a external USB enclosure and connect it to another NAS540, how can I mount it to copy the files?

All Replies

  • Mijzelf
    Mijzelf Posts: 2,600  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Find out which device node is used. Probably 'cat /proc/partitions' can tell you.
    Assuming the disk is sdd, you can mount it:
    mdadm --assemble /dev/md4 /dev/sdd3 --run
    mount /dev/md4 /path/to/mountpoint

    When /dev/md4 is already in use (/proc/partitions or /proc/mdstat will tell you) choose a higher number.

    A warning: some (maybe most) USB to Sata converters do a logical sector size translation on disks >2TiB. If your enclosure is one of them, this will not work, as changing the sector size renders the partition table incompatible. You can see if this is the case with 'fdisk -l /dev/sdd'. It shows the logical sector size, which should be 512 bytes.
    On modern kernels it is possible to create a loopdevice with a deviating sector size:
    losetup --sector-size=512 --show -f /dev/sdd
    now you can treat /dev/loopXp3 as /dev/sdd3. But I doubt if either the kernel of the NAS5xx or the (busybox) implementation of losetup supports this.
  • ybaumbach
    ybaumbach Posts: 1
    edited June 2022
    Mijzelf said: 
    Find out which device node is used. Probably 'cat /proc/partitions' can tell you.
    Assuming the disk is sdd, you can mount it:
    mdadm --assemble /dev/md4 /dev/sdd3 --run
    mount /dev/md4 /path/to/mountpoint

    When /dev/md4 is already in use (/proc/partitions or /proc/mdstat will tell you) choose a higher number.

    A warning: some (maybe most) USB to Sata converters do a logical sector size translation on disks >2TiB. If your enclosure is one of them, this will not work, as changing the sector size renders the partition table incompatible. You can see if this is the case with 'fdisk -l /dev/sdd'. It shows the logical sector size, which should be 512 bytes.
    On modern kernels it is possible to create a loopdevice with a deviating sector size:cookie clicker
    losetup --sector-size=512 --show -f /dev/sdd
    now you can treat /dev/loopXp3 as /dev/sdd3. But I doubt if either the kernel of the NAS5xx or the (busybox) implementation of losetup supports this.
    how to find out which device node is use? I'm quite blind about this stuff
  • MarkusDesk
    MarkusDesk Posts: 31  Freshman Member
    First Anniversary 10 Comments
    edited June 2022
    Hello, thanks for replying.

    With the command cat /proc/partitions, I get:

       8       32 7814026583 sdc
       8       33 7814025543 sdc1


    With the HDD connected on the USB enclosure and with the fdisk -l command, I get:

    Disk /dev/sdc: 7.3 TiB, 8001563221504 bytes, 15628053167 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes

    Device     Start         End     Sectors  Size Type
    /dev/sdc1   2048 15628053134 15628051087  7.3T Linux filesystem

    So it seems to be 512 bytes, correct?

    Before I try the command mdadm, I want to make sure I don't mess with anything. After the mdadm and mount command, can I just umount it and remove the USB drive or do I need to issue another command?









  • Mijzelf
    Mijzelf Posts: 2,600  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    @ybaumbach : 'cat /proc/partitions' shows you the disks, their partitions and sizes. If that is not enough to distinguish the USB disk, you could look at the difference without and with the disk plugged.

    @MarkusDesk : There is something wrong. If that disk contains a volume created in a NAS5xx, it should have 3 partitions, not just one.
    But yes, the sectorsize is correct. (Although I doubt the optimal I/O size is 512 bytes, but that won't affect the basic functioning)

    After umounting you can stop the array:
    mdadm --stop /dev/md4
    I don't think it actually matters, but it won't do any harm, and it look symmetric.

Consumer Product Help Center