[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1324263142.5056.YahooMailClassic@web113204.mail.gq1.yahoo.com>
Date: Sun, 18 Dec 2011 18:52:22 -0800 (PST)
From: John <jhnlmn@...oo.com>
To: linux-kernel@...r.kernel.org
Subject: How 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists