Tutorial: How to access DSM’s Data & System partitions

Автор: | 13.03.2017

If you can’t access your Xpenology box but you still wish to try and ‘fix’ some configuration files or perhaps your wish to finally make that backup that you should have done before fiddling with the root user, then you can access the content of the system partition and data partitions through a Live Ubuntu CD (or whatever unix flavoured OS you so desire). Here is how to:

1 — Make a Live Ubuntu USB drive. Ideally it is more convenient to make a persistent Live Ubuntu USB drive but that’s not required for this tutorial and it would just complicate things unnecessarily.

2 — Once you’re done burning Ubuntu on the USB flash drive, go plug it in your Xpenology box and boot from it.

3 — Once in Ubuntu, launch Terminal. You will then need to install mdadm and lvm2 by typing the following command in Terminal:

 	apt-get install mdadm lvm2

If you wish to mount the data partition alone then proceed with the following command.

4 — To mount the data partition, simply issue this command and you are done:

 	mdadm -Asf && vgchange -ay

If you also wish to mount the system partition then proceed with the following commands. (Adapt to your case accordingly)

5 — Then you need to check your raid array and partitioning of your drives:

 	fdisk -l | grep /dev/sd

In my case I see this. Note I only have 2 drives /dev/sda and /dev/sdb

System partitions are the ones labeled sda1, sdb1. If you have more drives in the aray, subsequent system partitions will probably be called sdc1, sdd1 so on and so forth. You get the point.

6 — Once you figured out all system partitions, then issue (this is for my case, with 2 drives):

 	mdadm -Ee0.swap /dev/sda1 /dev/sdb1

if you have 3 drives then you add /dev/sdc1. You get the idea.

7 — Finally, assemble the array and fix the byte order (this is for my case, with 2 drives):

 	mdadm -AU byteorder /dev/md0 /dev/sda1 /dev/sdb1

Same comment as previous command; add any additional system partitions that you may have. Beware of the /dev/md0. It’s normal, not a mistake.
Your system partition should now be mounted and you can navigate through the system files. Simply shutdown the machine when you are done. If for some reason you need to reboot and want to access the partition again then you will need to re-install mdadm and lvm2 because the Live Ubuntu USB is not persistent.

———
Reference:
https://www.synology.com/en-global/knowledgebase/DSM/tutorial/Storage/How_can_I_recover_data_from_my_DiskStation_using_a_PC
http://xpenology.com/forum/viewtopic.php?f=2&t=22100&p=83631&hilit=version#p83631
http://xpenology.com/forum/viewtopic.php?f=2&t=20216&p=74659&hilit=mdadm#p74659

Thanks to Jun

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *