[linux] nas hdd crash
Frans van Berckel
fberckel op xs4all.nl
Ma Sep 19 10:36:34 CEST 2016
Fred,
On Mon, 2016-09-19 at 08:30 +0200, Fred wrote:
> Hoi Frans,
>
> De ds209 heeft DSM 4.2-3256
> en de ds216 heeft DSM 6.0.2-8451 Update 1
>
> Fred
Mijn vermoeden is dat wat ik hier laat zien voor zowel de ds209
als ds216 werkt. Ik hou het even bij de ds216.
Check voor downloads: https://dedl.synology.com/download/
# su -
# mkdir -p /home/root/firmware/synology/ds216play/release/6.0.2/extract
# cd /home/root/firmware/synology/ds216play/release/6.0.2
# wget http://tinyurl.com/gug2p2g
# file DSM_DS216play_8451.pat
DSM_DS216play_8451.pat: POSIX tar archive (GNU)
# cd extract
# tar -xf ../DSM_DS216play_8451.pat
# ls -l
-rw-r--r-- 1 root root 1959 Aug 17 00:28 checksum.syno
-rw-r--r-- 1 root root 168349164 Aug 17 00:28 hda1.tgz
-rw-r--r-- 1 root root 13084300 Aug 17 00:28 indexdb.txz
drwxr-xr-x 2 root root 4096 Sep 19 09:22 packages
-rw-r--r-- 1 root root 4022087 Aug 17 00:28 rd.bin
-rw-r--r-- 1 root root 16934484 Aug 17 00:28 synohdpack_img.txz
drwxr-xr-x 22 root root 4096 Sep 19 09:22 texts
-rw-r--r-- 1 root root 169 Aug 17 00:28 uboot_do_upd.sh
-rw-r--r-- 1 root root 786432 Aug 17 00:28 uboot_DS216play.bin
-rwxr-xr-x 1 root root 1266933 Aug 17 00:28 updater
-rwxr-xr-x 1 root root 295 Aug 17 00:28 VERSION
-rw-r--r-- 1 root root 2666400 Aug 17 00:28 zImage
# file zImage rd.bin hda1.tgz
zImage: u-boot legacy uImage, Linux-3.10.77, Linux/ARM, OS Kernel
Image (Not compressed), 2666336 bytes, Tue Aug 16 21:11:38 2016, Load
Address: 0x43008000, Entry Point: 0x43008000, Header CRC: 0x262C2450,
Data CRC: 0x5519F1B2
rd.bin: u-boot legacy uImage, synology_monaco_ds216play 8451,
Linux/ARM, RAMDisk Image (Not compressed), 4022023 bytes, Tue Aug 16
22:28:38 2016, Load Address: 0x44000000, Entry Point: 0x44000000,
Header CRC: 0xC54FAB94, Data CRC: 0x09B20CC1
hda1.tgz: XZ compressed data
# mkdir initrd rootfs
# cd initrd
# cp ../rd.bin .
Eerst even zijn u-boot kopje eraf halen.
# dd if=rd.bin of=initrd.lzma bs=64 skip=1
62844+1 records in
62844+1 records out
4022023 bytes (4.0 MB, 3.8 MiB) copied, 0.156401 s, 25.7 MB/s
# rm rd.bin
# file initrd.lzma
initrd.lzma: LZMA compressed data, streamed
# lzma -d initrd.lzma
# file initrd
initrd: ASCII cpio archive (SVR4 with no CRC)
Stel he, dat je de alle eerste commando hebt overgeslagen. En je
afvraagt waarom heb je dit eigenlijk in een folder neergezet waar root
eigenaar van is? Dan kom je daar nu achter
# cpio -id < initrd
# rm initrd
# ls -l
lrwxrwxrwx 1 root root 7 Sep 19 09:39 bin -> usr/bin
drwxr-xr-x 3 root root 4096 Sep 19 09:39 dev
drwxr-xr-x 7 root root 4096 Sep 19 09:39 etc
lrwxrwxrwx 1 root root 3 Sep 19 09:39 etc.defaults -> etc
lrwxrwxrwx 1 root root 11 Sep 19 09:39 init -> bin/busybox
lrwxrwxrwx 1 root root 7 Sep 19 09:39 lib -> usr/lib
lrwxrwxrwx 1 root root 11 Sep 19 09:39 linuxrc -> bin/busybox
-rwxr-xr-x 1 root root 12002 Sep 19 09:39 linuxrc.syno
drwxr-xr-x 2 root root 4096 Sep 19 09:39 mnt
drwxr-xr-x 2 root root 4096 Sep 19 09:39 proc
drwx------ 2 root root 4096 Sep 19 09:39 root
drwxr-xr-x 3 root root 4096 Sep 19 09:39 run
lrwxrwxrwx 1 root root 8 Sep 19 09:39 sbin -> usr/sbin
dr-xr-xr-x 2 root root 4096 Sep 19 09:39 sys
drwxrwxrwt 2 root root 4096 Sep 19 09:39 tmp
drwxr-xr-x 8 root root 4096 Sep 19 09:39 usr
drwxr-xr-x 10 root root 4096 Sep 19 09:39 var
drwxrwxrwx 2 root root 4096 Sep 19 09:39 volume1
# find ./ -name "ssh*"
# find ./ -name "dropbear*"
Hmm geen ssh daemon.
# find ./ -name "telnet*"
./usr/sbin/telnetd
Maar wel telnet daemon. Maar dit is in het initramfs.
# cat etc/fstab
/dev/root / ext3 defaults 1 1
none /proc proc defaults 0 0
none /proc/bus/usb usbdevfs defaults 0 0
none /sys sysfs default 0 0
/dev/hda3 /volume1 ext3 defaults 0 0
Daarna mount hij het rootfs. Misschien gaat daarin zoeken beter?
# cd ../rootfs
# cp ../hda1.tgz .
# tar xf hda1.tgz
# rm hda1.tgz
# ls -l
total 164460
lrwxrwxrwx 1 root root 7 Aug 17 00:27 bin -> usr/bin
drwxr-xr-x 3 root root 4096 Aug 17 00:28 dev
drwxr-xr-x 2 root root 4096 Aug 17 00:28 etc
drwxr-xr-x 40 root root 4096 Aug 17 00:28 etc.defaults
drwxr-xr-x 2 root root 4096 Aug 17 00:27 initrd
lrwxrwxrwx 1 root root 7 Aug 17 00:27 lib -> usr/lib
drwx------ 2 root root 4096 Aug 17 00:27 lost+found
drwxr-xr-x 2 root root 4096 Aug 17 00:27 mnt
drwxr-xr-x 2 root root 4096 Aug 17 00:27 proc
drwx------ 2 root root 4096 Aug 17 00:28 root
drwxr-xr-x 6 root root 4096 Aug 17 00:28 run
lrwxrwxrwx 1 root root 8 Aug 17 00:27 sbin -> usr/sbin
dr-xr-xr-x 2 root root 4096 Aug 17 00:27 sys
drwxrwxrwt 2 root root 4096 Aug 17 00:27 tmp
drwxr-xr-x 9 root root 4096 Aug 17 00:27 usr
drwxr-xr-x 14 root root 4096 Aug 17 00:28 var.defaults
drwxrwxrwx 2 root root 4096 Aug 17 00:27 volume1
find ./ -name "ssh*"
./usr/bin/ssh-keygen
./usr/bin/sshd
./usr/bin/ssh
./usr/share/init/ssh-sftp.conf
./usr/share/init/sshd.conf
./usr/share/init/ssh-shell.conf
./usr/syno/etc.defaults/synoservice.d/ssh-shell.cfg
./var.defaults/dynlib/securityscan/ruleDB/Terminal/SSH/sshPortCheck.py
./etc.defaults/pam.d/sshd
./etc.defaults/ssh
./etc.defaults/ssh/sshd_config
Okay, er zit dus een ssh daemon in deze kastjes. Kijk maar eens goed in
de webgui waar precies de ssh aan moet zetten. Ik gok een vinkje.
Kijk goed uit wat je met onderstaande commando doet.
# cd /home/root
# rm -R firmware
Van 08:30 vs 10:30, twee uurjes werk.
# ssh ip-van-diskstation
Met vriendelijke groet,
Frans van Berckel
More information about the Linux
mailing list