1

I'm running my laptop using Ubuntu 12.04 on a USB HDD as the laptop's HDD has failed. Whenever I boot or do a grub update etc, it takes forever because it scans for the failed drive about 20 times and takes ages for each scan.

Is there a way to disable the automatic scanning but still be able to manually mount one of the working partitions on the drive?

Thanks Chris

1

1 Answer 1

0

I do believe that it's the OS prober that is scanning the other drives. The OS prober gets run whenever update-grub is run, which is usually only after a kernel update or when a module is installed that needs to be compiled into the kernel.

I haven't actually done this, (Correction, I just did it. What a fun hack!) but I do think if you delete /etc/grub.d/30_os-prober and replace it with a bash script that does nothing, then it should disable the OS prober without having any other bad effect on the system. It's a bit like squashing an ant with a steam hammer, but hey...

OK, I did this and it seemed to work fine. First, make backup copy of the file in question:

sudo mkdir /etc/grub.d/backup
sudo cp /etc/grub.d/30_os-prober /etc/grub.d/backup/

Next edit the file /etc/grub.d/30_os-prober and delete all the lines except for the first crunch-bang. (the first text line you will find in the file)

sudo nano /etc/grub.d/30_os-prober

Arrow down to the line below the crunch-bang and hold down Ctrlk to cut all other lines, then press Ctrlo to save the file and Ctrlx to quit.

You are done except if you want to make sure that the partitions on the hard drive are not mounted inadvertently, add a line for each of them to the /etc/fstab file. eg

sudo nano /etc/fstab

and and the lines at the bottom:

/dev/sda1  /home/username/part1  ntfs-3g  noauto,ro  0 0
/dev/sda2  /home/username/part2  ext4     noauto,ro  0 0

and so on where username is your username, and ntfs-3g/ext4 etc is the correct filesystem type for the partition. This will stop the partitions showing up in Nautilus, and will require you to mount the drives manually with sudo, and the directory part1, part2 must exist already otherwise the partition can NOT be mounted. Oh, and the partitions will also only be mounted read only (,ro) which is a great idea for devices which are failing since any write operations you do on them could make things much worse.

when you want to mount the partitions, do so with

sudo mount /dev/sda1

etc

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .