Koozali.org: home of the SME Server

help sms 9

Offline mgb

  • ****
  • 558
  • +0/-0
help sms 9
« on: September 11, 2017, 03:15:18 PM »
boot 
Thanks all for helping
Skype yosii2009

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: help sms 9
« Reply #1 on: September 11, 2017, 04:08:22 PM »
Your HD SDA is gone
Please, give us more details

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: help sms 9
« Reply #2 on: September 11, 2017, 09:20:45 PM »
indeed you sda drive seems dead, or at best you have an issue with your sata cable (seen that once)

do you have any raid ?
do you have fresh backup ?


I hope yes to at least the second one. then buy new disk and restore.

if not, do  not power on your hard drive unecessarely.
check for professional data recovery
alternatively buy an indetical drive or bigger and use ddrescue from a rescue dvd / thumb drive to copy physicaly content fron old disk to new.


Offline mgb

  • ****
  • 558
  • +0/-0
Re: help sms 9
« Reply #3 on: September 12, 2017, 08:18:07 AM »
Thank you for you'r response.
I dont have a backup for restore the data.
I tried to use to rescue dvd but it didnt found linux.
I installed the programm with raid but i have only one disk.
What programm do you recommend to use for restore data?
Thanks all for helping
Skype yosii2009

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: help sms 9
« Reply #4 on: September 12, 2017, 01:32:48 PM »
you need an HD at least twice in size compared to the one you're using and formatted in EXT3, then:

1) connect your empty disk to another sata channel (or to an usb port)
2) boot your server from SME's cd, and from the boot menu, choose "Tools" -> "Rescue installed system"
3) wait for the system to boot.. you don't need network nor try to mount the existing partitions.. just wait to have the prompt (choose the "shell" item in the last screen)
4) now give
Code: [Select]
fdisk -l
to identify your hd.. theorically speaking, your original hd will be sda and the new one sdb or something else.. be SURE to identify clearly your hd
5) mount your new hd in a mount point
Code: [Select]
mkdir -p /mnt/recovery
mount /dev/sdX1 /mnt/recovery

adapt sdX to your case.. this is your new disk, not the one where SME is installed
6) now
Code: [Select]
cd /mnt/recovery
dd if=/dev/sda of=./sda.img bs=64K conv=noerror,sync
it will take time.. a long time.. feel free to have a break.. and some cigarettes...
ignore all the messages you'll see

7) when the cloning is finished, create a copy of your image
Code: [Select]
cd /mnt/recovery
cp sda.img sda.img.good
this will avoind you to loose all your work if something will go wrong

at this point you'll have a full clone of your original hd (in 2 copies)
follow this page howto to mount your image as a loop device.. once you're done, you can access all your data

please, be aware that your original content may be corrupted.. you'd optionally run a fsck on the image to try to fix it (you have a second copy...)

it's easier than it seems, in any case, good luck

Offline mgb

  • ****
  • 558
  • +0/-0
Re: help sms 9
« Reply #5 on: September 12, 2017, 03:06:45 PM »
help sms 9
Thanks all for helping
Skype yosii2009

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: help sms 9
« Reply #6 on: September 12, 2017, 03:28:40 PM »
you used a wrong sdb disk

you have to format it in EXT3 and with a single partition
see https://wiki.contribs.org/USBDisks#Formatting_your_USB_drive and adapt it to your sdb disk

NOTE you've to use full disk, i.e. destroy everything is on your sdb disk

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: help sms 9
« Reply #7 on: September 12, 2017, 03:48:07 PM »
dd will not work with a failing drive, as it will just block onthe first error.

do not try to mount any partition of a failing drive as you will end up with doing more mess

do not try to fix filesystem ona failing drive as you will lose more data.

do not do anything before you are really sure you are doing it on the intended drive as it is easy to format the drive you want to save or dd / ddrescue the wrong way !!!!

As I said use ddrescue

buy a new hard drive same size or geater install it, this will help to transferthe data to it (beware same size or greater, ie some X tb size drive some will be few octets smaller than other, if the new one is a little smaller it will fail).
note serial number of old drive and new drive from their afixed label
find ausb key you could mount to save the log

boot with a rescue cd containing ddrescue, do not choose to mount partition automatically

first check which drive is which
Code: [Select]
smartctl -a /dev/sda
smartctl -a /dev/sdb
smartctl -a /dev/sdc
from there I assume
sda is old drive
sdb is new drive
sdc is usb stick

you will have to adapt for your situation ...

mount usb drive

Code: [Select]
mkdir -p  /media/usb
mount /dev/sdc1 /media/usb
cd /media/usb

launch backup at low level ; without retrying errors, so you will save all what is still good before it fails more.
this could take few days to run
Code: [Select]
ddrescue -f -n /dev/sda /dev/sdb /media/usb/rescue.log



then when it finish you could try to scrap more the dead zone or decide you are happy with that
trying more (try 3 times on skipped block and tag them as bad after 3 trials).
it could take more days to scrap a few 16 MB of failed data....
Code: [Select]
ddrescue -f -r3 /dev/sda /dev/sdb /media/usb/rescue.log

then simply remove old drive and try booting on new, simply mount the new drive partition and get your files.

store the old drive and do not touch it anymore untill you are happy with all important files restored.

as suggested by Stefano it would be good practice to clone this second drive to a tird before trying to repair to keep the original dat in case trying to repair make more mess.

depending on the result you could just copy the files and reinstall on a new drive, or just run the new drive after quick fschck

advanced users will use the ddrecue log file to detect which files are wrong... will need some advanced scripting and might depends on filesystems on partitions.


manual :
https://www.gnu.org/software/ddrescue/


some reference trying to know which files are corrupts depending on sectors failed (there are few other methodyou can find on the internet) :
https://tim.purewhite.id.au/2011/04/disk-recovery-which-files-are-damaged/


EDIT: as showed by Stefano with dd, you can use a bigger drive and output in a fileblock instead of directly on the drive. you can also ddrecue one partition at a time to fileblock... see the documentation of ddrescue
« Last Edit: September 12, 2017, 03:57:42 PM by Jean-Philippe Pialasse »

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: help sms 9
« Reply #8 on: September 12, 2017, 03:50:29 PM »
dd will not work with a failing drive, as it will just block onthe first error.

no, with the flags I gave.. believe me, I used it almost 20 times, with every kind of underlying F.S. :wink:


Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: help sms 9
« Reply #9 on: September 12, 2017, 04:01:03 PM »
no, with the flags I gave.. believe me, I used it almost 20 times, with every kind of underlying F.S. :wink:

still it will take more time on slow and damaged sectors letting more good data to be lost, instead of first save easy to get data and then salvage more the drive on difficult parts.

when a disk fails you do not know what is failing, is it the head, the surface, the electronic, you do not want to lose time trying to save 2 Mo for 3 hours and getting the drive unresponsive  when you could have saved 500Go

ddrescue is also able to resume from its log, to allow you to coold down the drive

ddrescue will also leave you with a human readable map of what has been saved and where are the errors so you can, with some work, get a list of files that are lost or corrupted
« Last Edit: September 12, 2017, 04:08:39 PM by Jean-Philippe Pialasse »