Having trouble un bzip2 file

I tired to search for this in the search forum section, but I have been unable to locate what I need.
I will explain what I have done and what system I am using and I am hoping that someone can help me.

First I have Debian Jessie installed on my server with no GUI.
I have a quad core AMD FX™-4100 Quad-Core Processor at 3.6Ghz.
I also have 16 Gb of ram and 32 GB of swap.
I ran this command twice to get the world map.

wget -bc -o /home/rehome/osmPlanet/planetosm_wget.log http://ftp.osuosl.org/pub/openstreetmap/planet/planet-latest.osm.bz2

I have tried to unzip the file with the following command:

bzip2 -sdk planet-latest.osm.bz2 > osmbzip2.txt 2>&1 &

I also tried it with out the slim mode.
It has said the the file is corrupt numerous times. I tried re-downloading the file, with the same results.
I read somewhere that if the file is too large that the bzip2 can create segment faults in the memory.
The thing I do not understand is that is is using all my memory for this. I read up on memory management, but it indicated that on decompression it is not relevant.

I recall having this problem a few years ago the last time I downloaded the file and I needed to run it a few times to get it to work. However with the file size I am thinking that maybe it is causing problems with the system.
Is it possible that it is my system and not the download. I run bzip2 -t and it said it was corrupted too.
Wget said that everything was fine when it was downloaded both times. The file is 51G, which I read is smaller then the latest copy. However, both times the download was the same size.
I don’t want to keep re-downloading the file because I don’t want to be hitting their server over and over, if it is not necessary and I only have so much bandwidth allowed to me.
Please let me know what you think.

P.S. I hope I have put everthing in here that you will need.

You might have better luck at help.openstreetmap.org

May I ask why you’re trying to unzip a large .bz2 file into what would be a humungous .xml file?

Does the md5sum of what you’ve downloaded match what’s at http://planet.openstreetmap.org/planet/ ?

I was unzipping it so I could use osm2pgsql and Nominatim for street locations.
I was unaware that you could use osm2pgsql with .PBF. I thought after I started the import into the database I found out that you can use it.
Please correct me if I am wrong there.
I have not had a chance to check if Nominatim will be able to use that format. I have not looked into it as I was successful in unzipping the file and now have it downloaded and have no intention on dowloading it again, though I will be using the format in the future if I can.
I can tell you that I was able to do it with renice or nice set to 19.
If you happen to know while we are chatting how to do it with .PDF I would love to know, so that when I set up my production server it will speed things up a lot.
The last time I did this a few years ago, maybe more I do not think .PDF was around.
I am still puzzled though why bzip2 kept reporting that the file was corrupt when it was not.
And yes the md5sum was correct and reported OK.
Thank you,

For info, http://wiki.openstreetmap.org/wiki/Nominatim/Installation says “Using a file in PBF format is recommended”.

As I understand it (from previous mailing list posts) the reason is that the PBF processing is actually faster than bzip2 / xml processing.

Thank you. I will use this in the future.
I will consider this matter resolved.
Thank you for your help, you have been great.
I do not know how to mark this as solved.
But once again thank you,
Donald Boissonneault

Unlike some other forums, I don’t think it has a “mark as solved” option, so don’t worry about that.