Thursday, June 19, 2014

http://askubuntu.com/questions/352836/how-can-i-tell-linux-kernel-to-completely-ignore-a-disk-as-if-it-was-not-even-co
How to prevent 
Two solutions here: one is fast to apply, although solves the problem only partially, the other one is the complete one but requires you to compile your own kernel.

The correct answer is a kernel patch.

Robin H. Johnson wrote a patch for the SATA kernel driver (find it in Unix/Linux stack exchange site) which hides completely the drive.
Update 1 The patch is now upstream (at least in 3.12.7 stable kernel), see the git repository. I asked forbackport in the Ubuntu launchpad.
Update 2 The patch is in the standard kernel for Ubuntu Trusty Thar 14.04; so now only the following addition to boot parameter is needed.
Once the patch is installed, adding
 libata.force=2.00:disable
to the kernel boot parameters will hide the disk from the Linux kernel. Double check that the number is correct; searching for the device name can help:
(0)samsung-romano:~% dmesg | grep iSSD
[    1.493279] ata2.00: ATA-8: SanDisk iSSD P4 8GB, SSD 9.14, max UDMA/133
[    1.494236] scsi 1:0:0:0: Direct-Access     ATA      SanDisk iSSD P4  SSD  PQ: 0 ANSI: 5

Workaround

At least the problem of enabling suspend-resume has been solved by by Unix StackExchange user Emmanuel in http://unix.stackexchange.com/a/103742/52205. As root, issue the command:
echo 1 > /sys/block/sdb/device/delete
before suspend.
To make it permanent, add the following file in /etc/pm/sleep.d/ and make it executable:
-rwxr-xr-x 1 root root 204 Dec  6 16:03 99_delete_sdb
with content:
#!/bin/sh

# Delete the failing disk so that it will not block suspend

case "$1" in
    suspend|hibernate)
        if [ -d /sys/block/sdb ]; then
            echo 1 > /sys/block/sdb/device/delete       
        fi
        ;;
esac
...and now the system suspends (and resume) correctly.

No comments:

Post a Comment