Posts Tagged ‘drive’

How to disable Windows pagefile.sys and hiberfil.sys to temporary or permamently save disk space if space is critically low

Monday, March 28th, 2022

howto-pagefile-hiberfil.sys-remove-reduce-increase-increase-size-windows-logo

Sometimes you have to work with Windows 7 / 8 / 10 PCs  etc. that has a very small partition C:\
drive or othertimes due to whatever the disk got filled up with time and has only few megabytes left
and this totally broke up the windows performance as Windows OS becomes terribly sluggish and even
simple things as opening Internet Browser (Chrome / Firefox / Opera ) or Windows Explorer stones the PC performance.

You might of course try to use something like Spacesniffer tool (a great tool to find lost data space on PC s short description on it is found in my previous article how to
delete temporary Internet Files and Folders to to speed up and free disk space
 ) or use CCleaner to clean up a bit the pc.
Sometimes this is not enough though or it is not possible to do at all the main
partition disk C:\ is anyhow too much low (only 30-50MB are available on HDD) or the Physical or Virtual Machine containing the OS is filled with important data
and you couldn't risk to remove anything including Internet Temporary files, browsing cookies … whatever.

Lets say you are the fate chosen guy as sysadmin to face this uneasy situation and have no easy
way to add disk space from another present free space partition or could not add a new SATA hard drive
SSD drive, what should you do?
 

The solution wipe off pagefile.sys and hiberfil.sys

Usually every Windows installation has a pagefile.sys and hiberfil.sys.

  • pagefile.sys – is the default file that is used as a swap file, immediately once the machine runs out of memory. For Unix / Linux users better understanding pagefile.sys is the equivallent of Linux's swap partition. Of course as the pagefile is in a file and not in separate partition the swapping in Windows is perhaps generally worse than in Linux.
  • hiberfil.sys – is used to store data from the machine on machine Hibernation (for those who use the feature)


Pagefile.sys which depending on the configured RAM memory on the OS could takes up up to 5 – 8 GB, there hanging around doing nothing but just occupying space. Thus a temporary workaround that could free you some space even though it will degrade performance and on servers and production machines this is not a good solution on just user machines, where you temporary need to free space any other important task you can free up space
by seriously reducing the preconfigured default size of pagefile.sys (which usually is 1.5 times the active memory on the OS – hence if you have 4GB you would have a 6Gigabytes of pagefile.sys).

Other possibility especially on laptop and movable devices running Win OS is to disable hiberfil.sys, read below how this is done.


The temporary solution here is to simply free space by either reducing the pagefile.sys or completely disabling it


1. Disable pagefile.sys on Windows XP, Windows 7 / 8 / 10 / 11


The GUI interface to disable pagefile across all NT based Windows OS-es is quite similar, the only difference is newer versions of Windows has slightly more options.


1.1 Disable pagefile on Windows XP


Quickest way is to find pagefile.sys settings from GUI menus

1. Computer (My Computer) – right click mouse
2. Properties (System Preperties will appear)
3. Advanced (tab) 
4. Settings
5. Advanced (tab)
6. Change button

windows-xp-pagefile-disable-screenshot

1.2 Disable pagefile on Windows 7

 

advanced-system-settings-control-panel-system-and-security-screenshot

windows-system-properties-screenshot-properties-advanced-change-Virtual-memory-pagefile-screenshot

system-properties-performance-options
 

Once applied you'll be required to reboot the PC

How-to-turn-off-Virtual-Memory-Paging_File-in-Windows-7-restart

 

1.3 Disable Increase / Decrease pagefile.sys on Windows 10 / Win 11
 

open-system-properties-advanced-win10

win10-performance-options-menu-screenshot

configure-virtual-memory-win-10-screenshot


1.4 Make Windows clear pagefile.sys on shutdown

On home PCs it might be useful thing to clear up ( nullify) pagefile.sys on shutdown, that could save you some disk space on every reboot, until file continuously grows to its configured Maximum.

Run

regedit

Modify registry key at location

 

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

windows-clean-up-pagefile-sys-file-on-shutdown-or-reboot-registry-editor-value-screenshot

You can apply the value also via a registry file you can get the Enable Clearpagefile at shutdown here .reg.
 

2. Manipulating pagefile.sys size and file delete from command line with wmic tool 

For scripting purposes you might want to use the wmic pagefile which can do increase / decrase or delete the file without GUI, that is very helpful if you have to admin a Windows Domain (Active Directory)
 

[hipo.WINDOWS-PC] ➤ wmic pagefile /?

PAGEFILE – Virtual memory file swapping management.

HINT: BNF for Alias usage.
(<alias> [WMIObject] | [] | [] ) [].

USAGE:

PAGEFILE ASSOC []
PAGEFILE CREATE <assign list>
PAGEFILE DELETE
PAGEFILE GET [] []
PAGEFILE LIST [] []

 

[hipo.WINDOWS-PC] ➤ wmic pagefile
AllocatedBaseSize  Caption          CurrentUsage  Description      InstallDate                Name             PeakUsage  Status  TempPageFile
4709               C:\pagefile.sys  499           C:\pagefile.sys  20200912061902.938000+180  C:\pagefile.sys  525                FALSE

 

[hipo.WINDOWS-PC] ➤ wmic pagefile list /format:list

AllocatedBaseSize=4709
CurrentUsage=499
Description=C:\pagefile.sys
InstallDate=20200912061902.938000+180
Name=C:\pagefile.sys
PeakUsage=525
Status=
TempPageFile=FALSE

wmic-pagefile-command-line-tool-for-windows-default-output-screenshot

 

  • To change the Initial Size or Maximum Size of Pagefile use:
     

➤ wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=2048,MaximumSize=2048

  • To move the pagefile / change location of pagefile to less occupied disk drive partition (i.e. D:\ drive)

     

     

    Sometimes you might have multiple drives on the PC and some of them might be having multitudes of gigabytes while main drive C:\ could be fully occupied due to initial install bad drive organization, in that case a good work arount to save you space so you can work normally with the server is just to temporary or permanently move pagefile to another drive.

wmic pagefileset where name="D:\\pagefile.sys" set InitialSize=2048,MaximumSize=2048


!! CONSIDER !!! 

That if you have the option to move the pagefile.sys for best performance it is advicable to place the file inside another physical disk, preferrably a Solid State Drive one, SATA disks are too slow and reduced Input / Output disk operations will lead to degraded performance, if there is lack of memory (i.e. pagefile.sys is actively open read and wrote in).
 

  • To delete pagefile.sys 
     

➤ wmic pagefileset where name="C:\\pagefile.sys" delete

 

If for some reason you prefer to not use wmic but simple del command you can delete pagefile.sys also by:

Removing file default "Hidden" and "system" file attributes – set for security reasons as the file is a system file usually not touched by user. This will save you from "permission denied" errors:
 

➤ attrib -s -h %systemdrive%\pagefile.sys


Delete the file:
 

➤ del /a /q %systemdrive%\pagefile.sys


3. Disable hibernation on Windows 7 / 8 and Win 10 / 11

Disabling hibernation file hiberfil.sys can also free up some space, especially if the hibernation has been actively used before and the file is written with data. Of course, that is more common on notebooks.
Windows hibernation has significantly improved over time though i didn't have very pleasant experience in the past and I prefer to disable it just in case.
 

3.1 Disable Windows 7 / 8 / 10 / 11 hibernation from GUI 

Disable it through:

Control Panel -> All Control Panel Items -> Power Options -> Edit Plan Settings -> Change advanced power settings


 like shown in below screenshot:

Windqows-power-options-Advanced-settings-Allow-Hybrid-sleep-option-menu-screenshot

 

3.2 Disable Windows 7 / 8 / 10 / 11 hibernation from command line

Disable hibernation Is done in the same way through the powercfg.exe command, to disable it
if you're cut of disk space and you want to save space from it:

run as Administrator in Command Line Windows (cmd.exe)
 

powercfg.exe /hibernate off

If you later need to switch on hibernation
 

powercfg.exe /hibernate on


disable-hiberfile-windows-screenshot

3.3 Disable Windows hibernation on legacy Windows XP

On XP to disable hibernation open

1. Power Options Properties
2. Select Hibernate
3. Select Enable Hibernation to clear the checkbox and disable Hibernation mode. 
4. Select OK to apply the change.

Close the Power Options Properties box. 

enable-disable-hibernate-windows-xp-menu-screenshot

To sum it up

We have learned some basics on Windows swapping and hibernation and i've tried to give some insight on how thiese files if misconfigured could lead to degraded Win OS performance. In any case using SSD as of 2022 to store both files is a best practice for machines that has plenty of memory always try to completely disable / remove the files. It was shown how  to manage pagefile.sys and hiberfil.sys across Windows Operating Systems different versions both from GUI and via command line as well as how you can configure pagefile.sys to be cleared up on pc reboot.
 

How rescue unbootable Windows PC, Windows files through files Network copy to remote server shared Folder using Hirens Boot CD

Saturday, November 12th, 2011

hirens-boot-cd-logo-how-to-rescue-unbootable-pc-with-hirens-bootcd
I'm rescuing some files from one unbootable Windows XP using a livecd with Hirens Boot CD 13

In order to rescue the three NTFS Windows partitions files, I mounted them after booting a Mini Linux from Hirens Boot CD.

Mounting NTFS using Hirens BootCD went quite smoothly to mount the 3 partitions I used cmds:

# mount /dev/sda1 /mnt/sda1
# mount /dev/sda2 /mnt/sda2
# mount /dev/sdb1 /mnt/sdb1

After the three NTFS file partitions are mounted I used smbclient to list all the available Network Shares on the remote Network Samba Shares Server which by the way possessed the NETBIOS name of SERVER 😉

# smbclient -L //SERVER/
Enter root's password:
Domain=[SERVER] OS=[Windows 7 Ultimate 7600] Server=[Windows 7 Ultimate 6.1]

Sharename Type Comment
——— —- ——-
!!!MUSIC Disk
ADMIN$ Disk Remote Admin
C$ Disk Default share
Canon Inkjet S9000 (Copy 2) Printer Canon Inkjet S9000 (Copy 2)
D$ Disk Default share
Domain=[SERVER] OS=[Windows 7 Ultimate 7600] Server=[Windows 7 Ultimate 6.1]
Server Comment
——— ——-
Workgroup Master
——— ——-

Further on to mount the //SERVER/D network samba drive – (the location where I wanted to transfer the files from the above 3 mounted partitions):

# mkdir /mnt/D
# mount //192.168.0.100/D /mnt/D
#

Where the IP 192.168.0.100 is actually the local network IP address of the //SERVER win smb machine.

Afterwards I used mc to copy all the files I needed to rescue from all the 3 above mentioned win partitions to the mounted //SERVER/D
 

Play Dune2 on Debian Linux with dosbox – Dune 2 Mother of all Real Time Strategy games

Saturday, March 1st, 2014

medium_1809-dune-ii-the-building-of-a-dynasty_one_of_best_games_ever_linux_windows.gif

Dune II: The Building of a Dynasty (known also as Dune II: Battle for Arrakis in Europe is a game that my generation will never forget. Dune 2 is the "first" computer Real Time Strategy (RTE) game of the genre of the Warcraft I and Warcraft II / III and later Command and Conquer – Red Aleart, Age of Empires I / II and Starcraft …

dune2-unit-destroyed

I've grown up with Dune2 and the little computer geek community in my school was absolutely crazy about playing it. Though not historically being the first Real Time Strategy game, this Lucas Inc. 
game give standards that for the whole RTE genre for years and will stay in history of Computer Games as one of best games of all times.

I've spend big part of my teenager years with my best friends playing Dune2 and the possibility nowadays to resurrect the memories of these young careless years is a blessing.  Younger computer enthusiasts and gamers probably never heard of Dune 2 and this is why I decided to place a little post here about this legendary game.

dune-2-tank-vehicle - one of best games computer games ever

Its worthy out of curiosity or for fun to play Dune 2 on modern OS be it Windows or Linux. Since Dune is DOS game, it is necessary to play it via DOS emulator i.e. – (DosBox). 
Here is how I run dune2 on my Debian Linux:

1. Install dosbox DOS emulator

apt-get install --yes dosbox

2. Download Dune2 game executable

You can download my mirror of dune2 here

Note that you will need unzip to uanrchive it, if you don't have it installed do so:

apt-get install --yes unzip

cd ~/Downloads/
wget https://www.pc-freak.net/files/dune-2.zip

3.  Unzip archive and create directory to mount it emulating 'C:\' drive

mkdir -p ~/.dos/Dune2
cd ~/.dos/Dune2

unzip ~/Downloads/dune-2.zip
 

4. Start dosbox and create permanent config for C: drive auto mount


dosbox

To make C:\ virtual drive automatically mounted you have to write a dosbox config from inside dbox console

config -writeconf /home/hipo/.dosbox.conf

My home dir is in /home/hipo, change this with your username /home/username

Then exit dosbox console with 'exit' command

To make dune2 game automatically mapped on Virtual C: drive:

echo "mount c /home/hipo/.dos" >> ~/.dosbox.conf

Further to make dosbox start each time with ~/.dosbox.conf add alias to your ~/.bashrc 

vim ~/.bashrc
echo "alias dosbox='dosbox -conf /home/hipo/.dosbox.conf'" >> ~/.bashrc
source ~/.bashrc

Then to run DUNE2 launch dosbox:

dosbox

and inside console type:

c:
cd Dune2
Dune2.exe

dune2-first-real-time-strategy-game-harkonen-screenshot

For the lazy ones who would like to test dune you can play dune 2 online on this website

Archive Outlook mail in Outlook 2010 to free space in your mailbox

Thursday, May 15th, 2014

outlook-archive-old-mail-to-prevent-out-of-space-problems-outlook-logo
If you're working in a middle or big sized IT company or corporation like IBM or HP, you're already sucked into the Outlook "mail whirlwind of corporate world" and daily flooded with tons of corporate spam emails with fuzzy business random terms like taken from Corporate Bullshit Generator

Many corporations, because probably of historic reasons still provide employees with small sized mailboxes half a gigabyte, a gigabyte or even in those with bigger user Mailboxes like in Hewlett Packard, this is usually no more than 2 Gigabytes.

This creates a lot of issues in the long term because usually mail communication in Inbox, Sent Items, Drafts Conversation History, Junk Email and Outbox grows up quickly and for a year or a year and a half, available Mail space fills up and you stop receiving email communication from customers. This is usually not too big problem if your Mailbox gets filled when you're in the Office (in office hours). However it is quite unpleasent and makes very bad impression to customers when you're in a few weeks Summar Holiday with no access to your mailbox and your Mailbox free space  depletes, then you don't get any mail from the customer and all the time the customer starts receiving emails disrupting your personal or company image with bouncing messages saying the "INBOX" is full.

To prevent this worst case scenario it is always a good idea to archive old mail communication (Items) to free up space in Outlook 2010 mailbox.
Old Outlook Archived mail is (Saved) exported in .PST outlook data file format. Later exported Mail Content and Contacts could be easily (attached) from those .pst file to Outlook Express, leaving you possibility to still have access to your old archived mail keeping the content on your hard drive instead on the Outlook Exchange Mailserver (freeing up space from your Inbox).

Here is how to archive your Outlook mail Calendar and contacts:

Archive-outlook-mail-in-microsoft-outlook-2010-free-space-in-your-mailbox

1. Click on the "File" tab on the top horizontal bar.Select "Cleanup Tools" from the options.

2. Click "Cleanup Tools" from the options.

3. Click on the "Archive this folder and all subfolders" option.

4. Select what to archive (e.g. Inbox, Drafts, Sent Items, Calendar whatever …)

5. Choose archive items older than (this is quite self-explanatory)

6. Select the location of your archive file (make sure you palce the .PST file into directory you will not forget later)

That's all now you have old mails freed up from Outlook Exchange server. Now make sure you create regular backups ot old-archived-mail.pst file you just created, it is a very good idea to upload this folder to encrypted file system on USB stick or use something like TrueCrypt to encrypt the file and store it to external hard drive, if you already don't have a complete backup corporate solution backuping up all your Laptop content.

Later Attaching or detaching exported .PST file in Outlook is done from:

File -> Open -> Open Outlook Data File

outlook-open-backupped-pst-datafile-archive-importing-to-outlook-2010


Once .PST file is opened and attached in Left Inbox pane you will have the Archived old mail folder appear.

 

outlook-archived-mail-pannel-screenshot-windows-7
You can change Archived name (like I did to some meaningful name) like I've change it to Archives-2013 by right clicking on it (Data File properties -> Advanced)

How to read ext2 / ext3 / ext4 Linux filesystem and Mac OS X HFS+ partitions from Windows

Thursday, November 27th, 2014

access-linux-drives-filesystem-disks-from-microsoft-windows-howto-picture
If you are using a Dual-boot PC with installed M$ Windows and GNU .Linux OS storing many of your Documents / Music / Movie data on Linux's ext3 / ext4 filesystem partition  but using often also Windows PC for Professional Graphic Design or Photoshop CS5 / Coreldraw Graphics Suite X7 / 3D Studio / Adobe Drewmweaver you will certainly want to be able to mount (Map drive) as a drive Linux partitions ext3 / ext4 or Mac OS's HFS+ read / use it straight from Windows.

Below are few softs that does allow mounting Mac and Linux (Debian, Ubuntu, Fedora, SuSE etc.) partitions on Windows

1. Mapping Linux ext3 and ext4 as a Windows drive

There are number of programs that can map Linux partition as a drive / directly explore Linux FS content. Most famous (free) ones are:

  • Ext2Explore (also known as Ext2Read) – Probably best historically known Windows driver that does Linux ext FS reading 

     

     

     

    ext2explore-access-ubuntu-debian-fedora-suse-linux-from-your-windows-screenshot
     

  • Ext2FSD – Open source file system driver for Windows (2K / XP / WIN7 / WIN8 – both x86 and 64 bit arch) supports ext2 / ext3 FSs and even CIFS protocol shares over network mounts. Ext4 filesystems are supported in read only mode only. It supports many language codepage utf8, cp936, cp950 etc..- Cyrillic file names shown correctly 🙂

     

     

     

    ext2fsd-mount-linux-partitions-in-microsoft-windows-screenshot
     

  • Explore2FS – GUI explorer tool for accessing ext2 and ext3 filesystems. It runs under all versions of Windows and can read almost any ext2 and ext3 filesystem.

     

     

    explore2fs-linux-partitions-from-widnows-screenshot
     

  • Disk Internals Linux reader – A freeware tool for reading and extracting files from EXT2/EXT3/EXT4, HFS, UFS2, Reiser4, and ReiserFS partitions in Windows.

     

     

     

    disk-internals-linux-reader-2.0-screenshot-proprietary-linux-filesystem-reader-mounter-for-windows


Other useful multiplatorm Linux FS reader unfortunately proprietary one is ParagonExtFS – proprietary software having version for both Win OS and Mac (Supports also mounting Linux partitionons Mac).

Note that if you copy some files using some of above tools to Windows permissions held in Linux could screw up, so it is not a good idea to try backup Linux configuration files to Windows's partitions 🙂

2. Read Copy files from Mac OS HFS+ filesystem to Windows

Apple has Boot Camp driver package which allows Mac OS's HFS+ to be viewable from Windows.

reading-Mac-OSX-HFS-plus-partitions-from-ms-windows-with-bootcamp-driver

For people who don't intend to continuosly read data HFS+ it might be better to not load Boot Camp but use:

hfsexplorer-explorero-allowing-read-access-to-mac-osx-from-ms-windows-os

 Only problem with Boot Camp and HFSExplorer is it allows you to read data from Mac OS filesystem only read only.If you want to write to HFS+ filesystem from Windows you will need:

  • Proprietary Paragon HFS+ (or)

Don’t msg and Drive! ;)

Wednesday, June 22nd, 2011

Don't message and drive picture

Do you message when you drive? Do you know who are you messaging to ? 😉 Arghhh its the GRIM Reaper !!! 🙂

Raspberry Pi – Cheap portable credit-card sized single board Linux computer box

Thursday, November 7th, 2013

RaspberryPi tiny-computer running Linux and free software Logo

Not of a the latest thing out there but I believe a must know for every geek is existence of Raspberry Pi mini computer Linux board. It is a geek credit-card sized mini PC on extremely cheap price between 25$ and 35$ bucks (e.g. Raspberry Pi model A and Raspberry Pi Model B).

Raspberry Pi hardware you get for this ultra low price is as follows:

  • Broadcom BCM2835 system on chip
  • ARM Mobile processor model ARM1176JZF running at 700 Mhz (overlocking up to 1Ghz is possible – overclocked RP is called Turbo 🙂 )!
  • VideoCore IV GPU with 512 MBytes of ram
  • No Build hard disk or solid-state drive but instead designed to use SD-Card as a Storage
  • two video outputs
  • composite RCA and an HDMI port
  • 3.5mm audio output
  • 2 or 1SD/MMC/SDIO card slot (depending on device model A or model B)
  • Micro USB adapter power charger 500mA  (2.5 watts) – Model and 700mA (3.5 watts)

Raspberry PI mini computer hardware running Linux explained picture

The idea of whole device is to make cheap affordable device for pupils and people from third countries who can't afford to pay big money for a full-featured computer. Achievement is unique all you need to Raspberry Pi credit card sized device is external keyboard a mouse, SD-card and a monitor, this makes a 700Mhz featured almost fully functional computer for less than lets say 80$ whether used with a second hand monitor / mouse and kbd :). A fully functional computer or full functional thin client for as less as 80$ yes that's what RaspberryPi is!

It is recommendable that SD-Card storage on which it is installed is at least 4GB as this is part of its minimum requirement, however it is best if you can get an SD-Card of 32GBytes whether you plan to use its whole graphic functionalities.

Raspberry Pi Hardware is not too powerful to run a version of Windows as well as there is no free version of MS-Windows for ARM Processor, so basicly device is planned to run free software OSes GNU / Linux. 5 operating systems are working fine with the mini-board device as time of writting;
 

  • Raspbian – Debian "Wheezy" Linux port
  • Pidora – Fedora mixed version ported to run on Raspberry Pi
  • Risk OS port
  • Arch Linux port for ARM devices
  • Slackware Arm
    FreeBSD / NetBSD
  • QtonPi

Recommended and probably best distro port is for Debian Squeeze

To boot an OS into raspberry PI dowbnload respective image from raspberrypi.org

– Use application for copying and extracting image to SD-Card like Win32 Disk Imager – whether on Windows platform

Win32DiskImager burning raspberry PI mini Linux card board computer box image

– Or from Linux format SD-Card with gparted (N!B! format disk to be in FAT32 filesystem), extrat files and copy them to SD-CARD.

Once Raspberry Pi loads up it will drop you into Linux console, so further configuration will have to be done manually with invoking plenty of apt-get commands (which I will not talk about here as there are plenty of manuals already) – you will have to manually install your Desktop … Default shipped Web browser in Debian is Midori and due to lack of ported version of flash player for ARM streaming video websites like youtube.com / vimeo.com does not work in browser. There is a Google Chrome for Raspberry Pi port but just like with Midori heavy object loaded websites works very slow and thus not very suitable for multimedia.

raspberry pi cheaest portable linux powered computer sized of a credit card

Raspberry Pi device is very suitable for ThinClient use there is a special separate project – Raspberry ThinClient Project – using which a hobbyist can save 400$ for buying proprietary ThinClient.

RaspberryPI linux as a free software hardware thinclient picture

 

How to manually disable Windows Genuine Advantage on Windows XP SP2

Wednesday, May 25th, 2011

WGA Notification message popup message

I have a pirate version of Windows XP Pro 2 installer CD which does automatically turn on Windows Genuine Advantage

This is kind of annoying as the computer gets really slow and the hard disk drive activite gets intensive as well as an annoying popup message that the Windows XP copy is not genuine does appear periodically

In order to get rid of the message I had to do the following steps:

1. Get into Windows Safe Mode without Networking

As most of the people knows this is achieved by pressing F8 keyboard key right before the Windows bootup screen appears.

After in Safe mode it’s necessery to,

2. Run Windows Command Line (cmd.exe)

To do so follow, the menus:

Windows (Start Menu) -> Run -> cmd.exe

3. In the command prompt window issue the commands:

C:Documents and SettingsUser> cd WindowsSystem32
C:WindowsSystem32> taskkill -IM wgatray.exe
C:WindowsSystem32> del wgatray.exe
C:WindowsSystem32> move wgalogon.dll wgalogon.dll.old
C:WindowsSystem32> del wgalogon.dll.old

Something to mention is you have to be really quick, with deleting wgalogon.dll, cause wgatray.exe is scheduled to run every 1 / 2 seconds 🙂 It is a bit of situation of type “be quick or be dead” as Maiden used to sing 🙂
A Windows system restart and Hooray the Windows Genuine message is gone 🙂

How to solve “Incorrect key file for table ‘/tmp/#sql_9315.MYI’; try to repair it” mysql start up error

Saturday, April 28th, 2012

When a server hard disk scape gets filled its common that Apache returns empty (no content) pages…
This just happened in one server I administer. To restore the normal server operation I freed some space by deleting old obsolete backups.
Actually the whole reasons for this mess was an enormous backup files, which on the last monthly backup overfilled the disk empty space.

Though, I freed about 400GB of space on the the root filesystem and on a first glimpse the system had plenty of free hard drive space, still restarting the MySQL server refused to start up properly and spit error:

Incorrect key file for table '/tmp/#sql_9315.MYI'; try to repair it" mysql start up error

Besides that there have been corrupted (crashed) tables, which reported next to above error.
Checking in /tmp/#sql_9315.MYI, I couldn't see any MYI – (MyISAM) format file. A quick google look up revealed that this error is caused by not enough disk space. This was puzzling as I can see both /var and / partitions had plenty of space so this shouldn't be a problem. Also manally creating the file /tmp/#sql_9315.MYI with:

server:~# touch /tmp/#sql_9315.MYI

Didn't help it, though the file created fine. Anyways a bit of a closer examination I've noticed a /tmp filesystem mounted besides with the other file system mounts ????
You can guess my great amazement to find this 1 Megabyte only /tmp filesystem hanging on the server mounted on the server.

I didn't mounted this 1 Megabyte filesystem, so it was either an intruder or some kind of "weird" bug…
I digged in Googling to see, if I can find more on the error and found actually the whole mess with this 1 mb mounted /tmp partition is caused by, just recently introduced Debian init script /etc/init.d/mountoverflowtmp.
It seems this script was introduced in Debian newer releases. mountoverflowtmp is some kind of emergency script, which is triggered in case if the root filesystem/ space gets filled.
The script has only two options:

# /etc/init.d/mountoverflowtmp
Usage: mountoverflowtmp [start|stop]

Once started what it does it remounts the /tmp to be 1 megabyte in size and stops its execution like it never run. Well maybe, the developers had something in mind with introducing this script I will not argue. What I should complain though is the script design is completely broken. Once the script gets "activated" and does its job. This 1MB mount stays like this, even if hard disk space is freed on the root partition – / ….

Hence to cope with this unhandy situation, once I had freed disk space on the root partition for some reason mountoverflowtmp stop option was not working,
So I had to initiate "hard" unmount:

server:~# mount -l /tmp

Also as I had a bunch of crashed tables and to fix them, also issued on each of the broken tables reported on /etc/init.d/mysql start start-up.

server:~# mysql -u root -p
mysql> use Database_Name;
mysql> repair table Table_Name extended;
....

Then to finally solve the stupid Incorrect key file for table '/tmp/#sql_XXYYZZ33444.MYI'; try to repair it error, I had to restart once again the SQL server:

Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..
root@server:/etc/init.d#

Tadadadadam!, SQL now loads and works back as before!

Tricks of the supermarket trade or how supermarket lie to you to buy more than you need (My few memories on government food stores in communism times)

Friday, June 22nd, 2012

I've personally always hated super markets from the very early days I entered one. Here in Bulgaria we've been somehow partly lucky not to have supermarket due to the different philosophy of the communistic regime in which we lived until 1991. The philosophy of then governing communist back then was to distribute food in local middle size or small stores owned by the government. The food has to be approved by governmental body and heavily checked if it matches the governmental set standards. The variety of food we were offered in the stores was very little. Most of the small stores (which were owned by the government) only contained basic products like;;;

bread, youghurt, milk, meat, butter, lemonade, beer and few more,

This was done probably intentionally and was a result probably of our long years Orthodox Christian faith which (has saved us and preserved over the centuries). Orthodox Christianity has always teached for simplicity. Even though the communist party rejected the faith and even did severe persecution against the Bulgarian Orthodox Church. The people on the top elite who were planning the communism had been a descent of an orthodox christian raised up living and therefore the philosophy of simplicity was inherited (even genetically) so the way the COM party behaved based on its leaders and the governing decisions about the nations belonging to communism (Russia, (Yugoslavia) – Serbia Koso , Bulgaria, Greece, Egypt etc.) were in a material expression in conjunction with the Christian tradition of simplicity (i say material because Orthodox Christian Church even visiting back then in the countries was usually prohibited and the Com. party did their best to ruin up the believe in Christ in people).

In communism the local suburb grocery stores, were the only "points" of distribution of food. Since buying and owning a car took at least few years of waiting and big money for it. Not more than 10 to 20% of families owned car and owning a car was considered to be granted mostly to people belonging to the then governing communistic elite or the Communist Party.

The public transportation was encouraged because according to communism so called "geometry" which was a main drive for how the systems in communistic countries should work it was estimated public transportation is cheaper and more environmental friendly than if a car is given to anyone, also public transportation (trains, bus-es) etc. did a good thing in the aim of the party to exersice higher control and surveilance over the population.

Because of that existence of big super-market was scarce and the culture to go and buy from a shop with your own family car was not existing.

The equivalent of nowdays mall shops (big retail stores) was usually located on the city center and the size of this shop was much smaller and the variety of products one can find there was only few. Hence the customer didn't have so much options to choose between, neither had to spend too much of time on choosing, the com party wanted the people to work more and buy less, so spending time in stores was not encouraged.

With the entrance of democracy and the moving up of large super-market food and good retails shops like Metro was among the first ones which entered the "freed" market. It was really a bizarre experience for us the ex U.S.S.R belonging people to enter such a large sized stores and to face such a big variety of choice.

Before that in communism we never saw such stores even on the TV, since the TV was governed by communistic party and only information which was useful for the establishment and protection of the regime was projected on the only available National TV channel.

Sorry to distract a bit from the major topic of this post, but I thought this is necessery to explain before continuing because it is important to understand that unintentinonally the communist gave us an advantage to have a different view on things than Western free world, a view which is in many things contrary and more correct (in terms of hard logic) than to Western Europe.

My first encounter with a super-market was only about 8 or 10 years ago and I believe many people who lived in the province of Bulgaria and other ex-communist countries did for a first time experience super-markets approximate 10y. ago.
Though all looked so nice inside the shop and the shop emploees were so nice I always felt something very cold dead inside this big stores. Ptonsnlu my intuition (spirit) if you want has always pointed me out that there is something very wrong with this super markets.

With the increase of products on the market for us people who lived up to our 8 to 12 years (young age) in communism it was a great shock, since we were raised in a society based on some communist false ideology and suddenly the markets were opened and the products variety to choose between become extremely high.
All previously said to be good and true in communism time was said to be anti-freedom and many people did their best to destroy as much as possible mostly everything somehow connected with previous communistic time.
My homeland Bulgaria as a result of this become a very hard to live place and we were forced to adapt in fast paces and learn things on how we have to live like democrats for a very little short of time.
One severe "damage" most of the growing people in Bulgaria in communism had was the hardness and inability to make choices.
For many people between the age of 25 to 35 it is very hard to make choices even for small things.
This was a direct consequence of a long years (45 years) of communist propaganda, and few generations who lived in a non-freedom respecting regime which conditioned and prepared a specific plan and place for every individual living in the country.

Seeing communism as the ultimate evil and manipulation to make us dependent we didn't know that in the free democratic world the manipulation and conditioning in society was heavy too.

"The Programming" of western society through institutions, stores and order in society was a fact and in a sense the only difference between the Democratic world and communistic world was one of the worlds seemed to have a larger frame in which the individual can work and live, whether the communistic regime seem to be more restrictive.
One main thing used to condition people choices and buying behavior and make them over-consume to make the democratic economy constantly growth was big super-markets. Though they were privately owned and not like in communist country, the only drive behind each shop was PROFIT, PROFIT and agian PROFIT.

Higher profits would mean higher consumptions, higher consumptions means higher production and more work places opened as well as more expenses for working individuals would mean bigger necessity to work more and earn more, because though the sallaries incomes were high in the free world. The individual necessities there were even increasing too.

Since the about 1950s 1960s the super-markets started entering the "free" democrat countries world. As a result the small shops which were prior a main food and beverage distribution source started closing, because they couldn't be a concurrence to the big "brothers" super-markets which were able to buy higher quantities of goods in lesser price and therefore sell many of the goods in much lower prices than the little grocery stores.

The result with the years was a huge shift in people buying behavior from local groce and open markets to buy everything from the big super-markets. The big store chains had to be in a fight for customers all the time, so businesses involved started customer wars and tried their best to "steal" customers from each other. In this financial wars a main thing that most super-market chains and malls did was constant optimization of efficiency of both buying and reselling to the end customer. This is a 3 step business process actually.

1;;; They buy from the commodity producer
2;;; They prepare the food for the store (packaging, cleaning up whatever)
3;;; They put it in a certain way in the store and organize the store in a way to always sell more and more

As a result a huge number of tricks were employed by each and every super-market aiming to deceive the customer to ever buy more
The deception of the client in store is very tricky and smart organized so it cannot really be called a lie but its rather a tricky smartness.

Since the super-markets entered in my country too and the tiny grocery stores are mostly closing unable to compete with the large super-market 'money making machines'. Even I am sometimes forced to buy stuff from super markets. Since here in Bulgaria the culture of purchasing from super-markets is not so strong yet. In order to be able to consume the little grocery stores. Many large super-markets started investing in making the little groceries their retail shops with their brand or (sometimes a new make up brand).
By doing so the little grocery stores loose their authoritarity and independance and become dependant on the big super-market on the type of products they will sell, this obviously means this strategy of the big super-market in the long run will lead the little grocery stores we still have to ruin up. This is obvious because if the small grocery stores start selling the exact same products (brands) of the big super-markets, there will be nothing left to make the little grocery unique. Neither the variety of products choice inside or pricing will be any different from super-market. This will mean the tiny grocer will be no different from the big super-markets in terms of product and prices and therefore. The clients which now are loyal to small grocery stores like me will then have not such big motivation to buy from small super-markets, since everything inside is somehow similar (not to say) the same as with big supermarket the only difference would be the lesser variety which is obviously a good reason why the customer would definitely prefer to buy from the large supermarket …

On the videos you're about to see below, they explain some of the probably thousands of tricks nowdays existing the super-market chains employs to trick us to exponentiolly consume their goods.

Old Tricks of the SuperMarket Trade

As you can see the video is presenting a reality of the tricks which was used in the 1960 and now technology and knowledge in the field has largely increased and since they there are surely many new trick 'developments' which are working for the masses of customers daily.
There is even a whole science centered on buying behaviour already existent called buyology!

Here is a short introduction to buyology to give you an idea what its purpose is:

Short introduction video on buyology – The Science of buying part 1 of 2

Short introduction video on buyology – The Science of buying part 2 of 2


Seeing all this is very precious information, since being informed one can escape the bad "tricks and traps" pawn in the markets.

All the information about the communistic regime and the 'shopping system' there was mentioned priorly because I wanted to explain a bit of the difference of then and now to point you to my opinion that the Western buying model and expectation to sell more based on the tricks are probably not working very well here in the ex-communistic countries, especially with the older generations and the one like me which somehow grow a small part of their youth in communism.

The reason is we have a different 'social programming' than westerners. Also the different spirituality (The orthodox Christian faith) plays another role. Also there is a difference in the type of buying behaviour. In Bulgaria there is no culture to buy once or twice per week. People have culture to buy daily, though this is starting to change slowly these days.

For a bit more of videos and a bit of my thougths on my research on Super Market Psychology check my previous post containing educational videos on how the supermarkets cheat you to buy more

The topic is actually very huge and I'm sure what I'm saying is just the 'tip of the iceberg'. As I'm a firm opponent of big industries and large business I'm firmly against the buying from big stores any goods. The reason is that simply by doing so one makes the already RICH people even more RICHER. By increasing the richness of a certain small group of people daily, we as society are un-consciously somehow involuntarily letting them increase the financial control that is already there in some degree to the society.
As democracy's main drive is money this means that by helping the large business-es marge and become even BIGGER, we're doing something against ourselves and our interests as society.
I don't think that any ordinary citizen in the free world want to live in a fully controlled one World State (one world country), similar to the ex-communism I lived through, so I think people concerned about our freedoms should oppose the big businesses according to the society level they're in. Even if we're not in position to change things with money, we as society are in a position to change ourselves and our understanding of world, our desires and our behaviour. If we change our value system in a way, where money are not a top priority and the highest value the outcome will be positive in both spiritual terms and overall world state.

The modern day however wants us to falsely believe that we're divided, helpless and money dependent. This is a big delusion which we're constanty repeated. Just like with the super-market this big super-market company owners were able to convince us through time that super-market is better than the grocery stores, because of the less money spending advantage. Even if in the past there were possibility to spend less via supermarket nowdays spending less by using the supermarket instead of the small groce-store is a BIG LIE. Even if one spends less in super-market on certain products, the amount of related products he is cheated* to buy in store highly exceed the simply money one would spend on even higher priced products in the small groce.
The outcome results from the super-market is also a big waste, as I lived in the west I've seen most of the households are buying more than they need, spending more than they need, cooking more food and more frequently than necessery and throughing large portions of food in the garbage (e.g. a huge amount of food waster).

If it was possible that people were aware they are buying all this non-sense food because of deception, they would have bought less, the super-markets would bought less and distribute less and the food (waster) remaining could be distributed to poor-er countries to help the starving kids and suffering people in Africa.
Helping the suffering and starving, we would have helped each other as it is a nowdays well known that even on molecular level the whole world is connected, therefore helping our poorer brothers and sisters is actually helping ourselves ***