Thursday, September 27, 2012

Cannot empty trash because item is in use


http://hints.macworld.com/article.php?story=20110105041622966

Cannot empty trash because item is in use 
System
Sometimes it is not possible to empty the trash because an item is in use. There are many possible causes for this; here is one thing to try to eliminate the error.
  • Go to Finder and select Finder » Secure Empty Trash.
  • If this operation gets stuck, open the Activity Monitor utility and force quit the Locum process.
    Enter your admin password when requested.
  • Go back to Finder and select Finder » Empty Trash.
This fixed it for me.

[crarko adds: I found this thread in the MacOSXHints forums where the Locum process is discussed. It references a good source for finding out more information about this process. By the way, the word 'Locum' means 'place-holder' or perhaps 'temporary proxy' is more applicable in this case. Apparently it fills in for the Finder in the background while emptying the Trash. It also can consume quite a bit of memory while doing so with a large number of files.]


Wednesday, August 22, 2012

Delete stubborn files

Mini-tutorial: Force-deleting stubborn or problematic files in Mac OS X

 

Mac OS X can experience difficulty deleting certain files due to the following (and other) reasons:
  1. The file is in use by an application or system process
  2. The file is locked
  3. The user does not have permission to delete the file
  4. The file is damaged or otherwise corrupt and "cannot be found" by the system
A. (File in use) If you receive an error message indicating the the file is in use by an application, try one of the following:
  • Quit any and all applications you think might be using the file
  • Open Activity Monitor (located in /Applications/Utilities) and kill any processes you think might be using the file (for more on killing processes with Activity Monitor, see this article)
You can also restart, which may put an end to lingering processes that are unnecessarily making use of files you are attempting to delete.
B., C., D. (file is locked, user does not have permission, file is damaged) Select the file in the Finder and press the Command and I keys simultaneously (or select "Get Info" from the File menu). Try to deselect the box next to "Locked." If the box is grayed out and you cannot change the locked status, you do not have permission to modify the file. In this case, try one of the following:
Use Secure Empty Trash The simplest workaround and the first one you should try is to drag the problematic file to the Trash, then (while in the Finder) select "Secure Empty Trash" from the "File" menu.
Modify permissions
  1. Select the file in the Finder. Hold down the option key, then go to the "File" menu and select "Show Inspector" (this item replaces "Get Info" when the option key is held)
  2. Go to the "Ownership and Permissions" section, then click the "Details" disclosure arrow.
  3. Click the small lock icon next to the "owner" menu, and enter your administrator password.
  4. Change ownership to your administrator account.
  5. From the "You can:" menu, select "Read and write"
  6. You should now be able to uncheck the "Locked" box and delete the file
Change lock flag via Terminal You can also manually unlock files via the Terminal with the following command:
  • chflags nouchg nameoffile
After which you can attempt deletion from the Trash, or use the Terminal delete command listed below.
Delete via the Terminal Failing the above, use the following command in Terminal (located in ~/Applications/Utilities)
  • sudo rm -R
followed by the location of the file you are trying to delete, e.g.:
  • sudo rm -R "/Applications/Photoshop CS2/legal/Tieng Viet.html"
Use Force Delete Finally, there is a freeware application dubbed Force Delete that can sometimes delete persistently locked and otherwise stubborn files.
The aforementioned workarounds can also be useful in a situation where Mac OS X says that the file marked for deletion "cannot be found," or generates a numbered error.

Saturday, March 5, 2011

See which files were modified in last Time Machine backup

- Download timedog: http://code.google.com/p/timedog/
- Copy it in root (Macintosh HD)
- Open terminal:

cd "/Volumes/Time Machine Backups/Backups.backupdb/*************’s MacBook Pro"
/timedog -d 5 -l

(where 5 is the depth of directory levels searched)

Sunday, February 13, 2011

Problems with Vmware fusion

"Failed to lock main memory file" when restoring suspended machine: open package and delete .lck file
"The CMOS of this virtual machine is incompatible with the current version of VMWare Fusion" when starting the machine: open package and delete .nvram file

Tuesday, December 14, 2010

Gagnez en autonomie grâce aux disques RAM (ramdrive/ramdisk) - Blog d'infobidouilleur - Matt

Gagnez en autonomie grâce aux disques RAM (ramdrive/ramdisk) - Blog d'infobidouilleur - Matt

L'essentiel:

Ouvrez un terminal, et tapez la commande suivante :

diskutil erasevolume HFS+ "RAMdisk" `hdiutil attach -nomount ram://taille`

La valeur de taille est en nombre de blocs de 512 octets. Il faut donc multiplier la taille désirée en Mo par 2048. Le volume RAMdisk apparaitra alors sur votre bureau, sous la forme d'un volume amovible.
Pour supprimer le disque virtuel, utilisez la commande suivante :

hdiutil detach `mount | grep RAMdisk | cut -d ' ' -f 1`

Vous pouvez aussi l'éjecter depuis le Finder



Par Matt le dimanche 26 octobre 2008, 23:51 - Soft - Lien permanent


Il m'arrive de faire de longs voyages en train (9-10h...) quand je rentre chez mes parents, et j'utilise alors mon Macbook pour regarder des films. Le problème sur une telle durée c'est que même avec deux batteries, c'est parfois un peu juste, surtout quand il faut pousser la luminosité à fond pour ne pas être trop gêné par les reflets. Les solutions pour gagner un peu d'autonomie sont donc toujours bonnes à prendre ! Depuis quelques temps, je m'interrogeais sur l'utilité d'un ramdisk pour cet usage.

En effet, le disque dur est l'un des composants les plus gourmands sur un ordinateur portable. En usage classique (surf, bureautique...), le disque dur se met régulièrement en veille, et se relance à chaque fois que nécessaire. Mais en lecture de vidéo, l'utilisation du disque dur est plus fréquente, l'empêchant de se mettre en veille. L'idée est donc de créer un ramdisk, c'est-à-dire un disque virtuel alloué en RAM, et d'y copier le fichier vidéo avant la lecture. Ainsi, le disque dur est bien moins sollicité et peut donc se mettre en veille plus souvent.

En pratique, sur la lecture d'un fichier d'1h45 avec VLC sous Mac OS X, la consommation est ainsi passée de 29.4 Wh à 27.1 Wh, soit un gain d'autonomie de plus de 8%. C'est toujours ça de gagné, sur l'autonomie en lecture vidéo avec deux batteries, ça représente un gain de plus d'une demi heure.

Alors, comment faire me direz vous ? Voici différentes solutions, sous OS X et sous Windows.

  • Solution 1 (OS X) : avec diskutil et hdiutil

Ouvrez un terminal, et tapez la commande suivante :

diskutil erasevolume HFS+ "RAMdisk" `hdiutil attach -nomount ram://taille`

La valeur de taille est en nombre de blocs de 512 octets. Il faut donc multiplier la taille désirée en Mo par 2048. Le volume RAMdisk apparaitra alors sur votre bureau, sous la forme d'un volume amovible.
Pour supprimer le disque virtuel, utilisez la commande suivante :

hdiutil detach `mount | grep RAMdisk | cut -d ' ' -f 1`

Vous pouvez aussi l'éjecter depuis le Finder. Merci marcel's et MacJL du forum de Macbidouille pour cette solution plus simple... moi et ma manie d'utiliser la ligne de commande au lieu du clicodrôme ^^

  • Solution 2 (OS X) : Esperance DV

Si le terminal vous fait peur, vous pouvez utiliser Esperance DV, un petit freeware qui vous permettra de créer et supprimer un ramdisk (jusqu'à 2 Go) depuis le panneau de contrôle. Il a également l'avantage de permettre la sauvegarde et la restauration du volume sous forme d'image disque. Il souffre d'un petit bug, mais qui ne gêne pas son fonctionnement : il n'affiche pas correctement les quantités de RAM supérieures à 2 Go.

  • Solution 3 (Windows) : RRamDisk

Sous Windows, les solutions de création de ramdisks sont nombreuses, mais les solutions gratuites sont souvent très limitées en capacité (64 Mo en général, en se basant sur le drivers ramdisk fournit par Microsoft). RRamDisk est une exception : ce petit freeware vous permet de créer un ramdisk dans la limite de votre quantité de mémoire. Vous trouverez plus d'informations sur MyDigitalLife.

SuperSpeed Ramdisk Plus est une solution payante. Dans le cadre d'une simple utilisation comme tampon pour de la lecture vidéo, c'est même un peu surdimensionné. Son intérêt est surtout de permettre de créer des ramdisks persistants (sauvegardés automatiquement à l'arrêt de l'ordinateur, puis restaurés au démarrage), de supporter le swap de Windows, mais aussi d'allouer le ramdisk dans une zone mémoire non reconnue par le système. Utile donc pour récupérer le Go non reconnu par les versions 32 bits de Windows sur une machine dotée de 4 Go de RAM.