giovedì 26 dicembre 2013

Prevent auto mount in OS X

I like experimenting, a lot, with my computers. To be honest, that is the funny part of owning a computer.

I am going to use the Terminal in order to edit the file /etc/fstab
As a matter of fact, this file does not exist by default in OS X 10.5, 10.8 and 10.9. It doesn't probably exist on other versions of OS X too, but those OSs are what I'm using.

To create and/or edit /etc/fstab use vifs. Do not simply edit fstab with a text editor like vi.

This is vifs' man page

The goal here is to insert into fstab the IDs of the volumes you don't want to mount when the system boots.
You have two options. Specify the UUID (universally unique identifier) of the volume, or the volume disk label.
The volume disk label is the easiest method, because you already know it. For example the internal Macintosh hard drive is labelled "Macintosh HD" or whatever you named it. So, the line to add, looks like this

LABEL=Macintosh\040HD none hfs rw,noauto

The \040 represents the space character (see ASCII table) in octal numeral system.

The other option is to put in the UUID of the volume you don't want to mount.
To know the UUID you must issue a couple of commands.

diskutil list

/dev/disk0
   #:            TYPE NAME                 SIZE       IDENTIFIER
   0:  GUID_partition_scheme              *500.1 GB   disk0
   1:            EFI                       209.7 MB   disk0s1
   2:            Apple_HFS MacOSX_SYS      499.2 GB   disk0s2
   3:            Apple_Boot Recovery HD    650.0 MB   disk0s3

Lists all the information about the disks connected to your Mac. You must search for a line with the name equivalent to the volume's name you want to exclude from auto mount and make note of its identifier.
In my example this is /dev/disk0s2.
The last command let you know the UUID associated to the volume

diskutil info /dev/disk0s2 | grep UUID

Volume UUID:         72B18CD5-ADD4-382E-A877-F67239F204B3

So, the line to add to fstab is

UUID=72B18CD5-ADD4-382E-A877-F67239F204B3 none hfs rw,noauto

Save the new fstab file and reboot.

lunedì 4 novembre 2013

Disable hibernation on Windows 7, 8, 8.1

By default hibernation is enabled, and uses the file named hiberfil.sys located on the root folder of the system disk. This file is as big as the total amount of RAM installed inside your computer.
To disable hibernation, the quickest way is running a Command Prompt session with Run as administrator

At the prompt type

powercfg.exe /hibernate off

To verify that hibernation is really gone issue the following command

dir /as %SystemDrive%\hiberfil.sys

if you get "File not found" then hibernation is disabled.

To revert the above command

powercfg.exe /hibernate on

sabato 19 ottobre 2013

EFI and SMC firmware updates for Intel-based Macs

Usually Software Update can detect autonomously if your computer needs firmware updates.
If you want to be sure that your Mac's EFI and SMC firmware are updated, especially before upgrading the operating system, check this Knowledge Base document HT1237.