Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have samsung laptop with 30GB ExpressCache SanDisk SSD soldered on mainbord. SSD died (gives tons of errors when i try to access it somehow), but it is still probed on kernel boot, i see it's partition, ubuntu's unity shows unmounted drive icon in app drawer, and worst of all I can't suspend laptop, because sending suspend command to ssd device fails. I tried to pass sdb=noprobe kernel parameter, but it looks like it is obsoleted long ago in 3.8.0 kernel (Ubuntu 13.04). How can I disable sata device in recent kernels?

share|improve this question
add comment

3 Answers

up vote 0 down vote accepted

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 The patch is now upstream (at least in 3.12.7 stable kernel), see the git repository. I asked for backport in the Ubuntu launchpad.

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

Answered by Unix StackExchange user Emmanuel in http://unix.stackexchange.com/a/103742/52205

You can at least solve the suspend problem by issuing the command

echo 1 > /sys/block/sdb/device/delete

before suspend.

To automate it, I added the following file: (note the flags, it must be executable)

-rwxr-xr-x 1 root root 204 Dec  6 16:03 99_delete_sdb

in the directory /etc/pm/sleep.d/

#!/bin/sh

# Tell grub that resume was successful

case "$1" in
    suspend|hibernate)
        if [ -d /sys/block/sdb ]; then
            echo Deleting device sdb 
            echo 1 > /sys/block/sdb/device/delete       
        fi
        ;;
esac

...and now the system suspends (and resume) correctly. I added the snippet

if [ -d /sys/block/sdb ]; then
      echo Deleting device sdb 
      echo 1 > /sys/block/sdb/device/delete     
fi

to /etc/rc.local too, for good measure.

share|improve this answer
    
Thanks @Rmano, echo stuff worked. But it is unclear, where should I place 99_delete_sdb executable file? In /etc/rc0.d/ maybe? –  Sergey Melekhin Dec 9 '13 at 0:44
    
Sorry --- added the relevant information. –  Rmano Dec 9 '13 at 2:48
add comment

I went and wrote a kernel patch for you that implements the ability to disable a single disk at boot time, so that you don't need to bother with disabling it in udev, or the waiting during the initial boot.

http://dev.gentoo.org/~robbat2/patches/3.13-libata-disable-disks-by-param.patch

Should apply to many kernels very easily (the line above it was added 2013-05-21/v3.10-rc1*, but can be safely applied manually without that line).

share|improve this answer
1  
Thanks for your efforts. Perhaps you can comment (for those who are not so familiar with kernel patches), how to apply the patch and how to use it (probably sdb=disable as kernel parameter). –  mpy Dec 8 '13 at 9:28
1  
kernel.org/doc/Documentation/applying-patches.txt covers applying kernel patches in general, but many distributions have specific methods of applying patches. This patch more specifically implements a 'disable' force flag for libata. The user will need to use it with libata.force=ID:disable where ID is a number or number.number tuple identifying the drive in question. –  robbat2 Dec 8 '13 at 21:06
    
I do not know if this instructions: wiki.ubuntu.com/Kernel/BuildYourOwnKernel are up-to-date. I will try if I can this week... –  Rmano Dec 9 '13 at 3:09
    
By the way, in the case of the Samsung Laptop the command should probably be "libata.force=2.00:disable" (grep iSSD /var/log/syslog should give you an hint). –  Rmano Dec 9 '13 at 3:16
1  
FYI, it's merged to the kernel for 3.13 as well as the stable kernel tree. The nodisable option was NOT accepted however. –  robbat2 Dec 18 '13 at 8:49
show 1 more comment

I have researched this and found a solution that can be implemented quite easily on Ubuntu. The distro uses kmod, so the following should work fine on that and any distro that uses kmod.

Depending on what driver you're using, you will need to blacklist it if you want to disable all SATA devices. Try lsmod | grep sata and figure out which driver(s) you're using. Then in your /etc/modprobe.d/ create a new file with echo blacklist (module) > blacklist.conf to add it to the blacklist. Rebuild your initramfs with mkinitramfs for it to take effect. Reboot.

Alternately, just add modprobe.blacklist=(module) to your kernel parameters.

share|improve this answer
1  
It will disable all sata devices including hard drive, so my laptop will not boot anymore. And sata support is compiled into kernel (not as a module), so I can't blacklist it. –  Sergey Melekhin Sep 23 '13 at 0:35
    
Okay, so then just open up your laptop and remove the drive... –  Hector Sep 23 '13 at 20:22
    
Unfortunately I am not competent enough to do it - it is soldered on mainbord, not attached via sata cable. I am not even shure that laptop will be functional if I just remove it. –  Sergey Melekhin Sep 24 '13 at 0:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.