meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
hw:qnap_ts-228 [2023/02/21 07:44] niziakhw:qnap_ts-228 [2023/03/16 13:19] (current) niziak
Line 65: Line 65:
 </code> </code>
  
-  * /dev/md9    - ext4 - 517,62 MiB (157,61 MiB used)+  * /dev/md9    - ext4 - 517,62 MiB (157,61 MiB used)  - /mnt/HDA_ROOT
   * /dev/md256  - linux-swap - 517,69 MiB   * /dev/md256  - linux-swap - 517,69 MiB
   * /dev/md1    - LVM2   * /dev/md1    - LVM2
     * '/dev/vg1/lv544' [<18,54 GiB]  - zeros!     * '/dev/vg1/lv544' [<18,54 GiB]  - zeros!
     * '/dev/vg1/lv1' [1,79 TiB] - LUKS aes cbc-plain sha1     * '/dev/vg1/lv1' [1,79 TiB] - LUKS aes cbc-plain sha1
-  * /dev/md13   - ext3 - 448,14MiB (324,98 MiB used)+  * /dev/md13   - ext3 - 448,14MiB (324,98 MiB used)   - /mnt/ext
   * /dev/md322  - linux-swap - 6,90 GiB   * /dev/md322  - linux-swap - 6,90 GiB
  
Line 165: Line 165:
 </code> </code>
  
 +===== /dev/vg1/lv1 encrypted =====
  
 +Volume is encrypted. It contains standard LUKS header.
 +Google says encryption password is derived from user supplied password using not know algo.
 +It points to NAS local utility:
  
 +<code bash>
 +/sbin/storage_util --encrypt_pwd pwd=YOUR_PASSWORD
 +Encrypted passwd is: …………………………………..
 +</code>
  
 +Reference: 
 +  * [[https://unix.stackexchange.com/questions/685821/how-to-mount-on-linux-a-qnap-external-drive-with-luks-partition]]
 +  * [[https://www.linux-howto.info/mount-qnap-encrypted-volume/]]
  
-cryptsetup +==== Try to run x86 QTS in Proxmox VM ====
  
 +Set VGA to ''none''. Add serial port for console - Proxmox console will automatically switch console to serial port.
 +Import raw image as VM disk: <code bash>qm importdisk 304 F_TS-X85_20170210-1.3.0_512M.img local-lvm --format raw</code>
  
 +Problem: cannot stop at GRUB, it boots kernel, loads initrd and then stuck. Probably some HW dependencies are not met (emmc disk?).
 +Switched to simpler solution with Docker (see below).
 +
 +==== storage_util docker ====
 +
 +Based on files from ''F_TS-X85_20170210-1.3.0_512M'' I've created root filesystem with ''storage_util'' and minimum required libraries.
 +
 +And it works. Generated password opens LUKS storage.
 +
 +==== mkpasswd ====
 +
 +After making Docker image, I found post on QNAP forum that the password can be generated using simple MD5 hash:
 +<code bash>
 +mkpasswd -m md5 -S YCCaQNAP
 +</code>
 +
 +
 +<code bash>
 cryptsetup luksOpen /dev/vg1/lv1 nas cryptsetup luksOpen /dev/vg1/lv1 nas
 +mount /dev/mapper/nas /mnt/nas
 +</code>
  
  
 +===== Recovery =====
 +
 +<code bash>
 apt install testdisk apt install testdisk
 +photorec /dev/mapper/nas
 +</code>
  
-photorec /dev/md256 
  
 +===== unmount and shutdown =====
  
 +<code bash>
 +umount /dev/mapper/nas
 +cryptsetup luksClose nas
 +dmsetup remove vg1-lv544
 +dmsetup remove vg1-lv1
 +mdadm --stop /dev/md1
 +
 +mdadm --stop /dev/md256
 +mdadm --stop /dev/md9
 +mdadm --stop /dev/md322
 +mdadm --stop /dev/md13
 +</code>