lkml.org 
[lkml]   [2011]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectHow to keep OS running after hard drive removal?
Hi,
I am working on an embedded Linux device with a USB hard drive. There is a swap file on this drive. The hard drive may be powered down at any moment before being powered back on few seconds later. This leads to various error messages, such as:
"Write-error on swap-device"
"Kernel panic - not syncing: Attempted to kill init!"
or exceptions in various applications, which is understandable since some page in/out requests failed.
My goal is to somehow prevent this from happening and recover the system without rebooting the OS.
I can postpone the crash by calling scsi_block_requests, but I cannot keep them blocked forever.
I tried to kill some user mode tasks (using send_sig_info) in response to USB_DEVICE_REMOVE notification, but still keep getting exceptions.
I am also thinking whether it is possible to prevent SCSI device from being destroyed when USB device is removed, but keep it around and then somehow reconnect it to the new USB device, which will be created few seconds later when USB device is powered again. Since this is the same disk, then, may be, I can resume all pending requests without re-mounting the disk.
What is your opinion? Can something like that be done? Or is it impossible to cleanly recover OS after hard drive removal?

Thank you
John




\
 
 \ /
  Last update: 2011-12-19 03:55    [W:0.037 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site