Monday, May 18, 2009

Mac OS X Split Command: Illegal Byte Count

Here's an issue I recently ran into on the Macintosh. I was archiving large data files...we take a number of user files that shouldn't be needed anymore but instead of deleting them I compress them with 7zip and set them aside in case we get a frantic call about missing file XYZ that they didn't know wasn't being stored on a share that is in the backup rotation.

Some of these folders get to be real doozies...6 gig or larger.

Most fit on the DVD's I'm burning to (4.7 gig). The big files, of course, won't fit. The easiest way to cut them down to size is to use the "split" command, a common command available on OS X and Linux. That way I don't need to hunt down and install additional proprietary software should the need come along to reassemble the data file later on...I can use tools already on the systems I usually have available.

So I transferred the files I needed to archive to my Mac (it has a DVD burner in it) and then tried to use the Split command from the terminal:

split -b 2G filename.7z newfilename.7z.split

This command should have taken the giant "filename.7z" and split it into manageable 2 gig chunks. Instead the terminal spit back an "Illegal byte count" error. Huh?

I searched around trying to figure out what I was doing wrong; I thought it might be related to this posting on Macosxhints.com about a problem with the version of split shipped with OS X.

I could have tried using a newer version of split or trying to narrow down the issue by trying a patched version of the program, but I went with the solution that was simply quicker to try; I transferred the giant file to my Ubuntu Linux system and ran the command there. Worked flawlessly. Transferred the resulting split files back to the Mac to burn to DVD.

*sigh*

Why must even things that should be simple become a project? Once again my Linux system managed to save me a couple Aspirins (or Tylenols).

UPDATE: an anonymous reader suggested:
Have you tried: split -b2000m filein fileout ?

I had the following response:
Actually I tried this after you suggested it on a file I created by tarring the 6 CentOS install CD's into one big file (over 3 gig) and it appears to have worked...so I guess the million dollar question is, why did that work while the Gig version didn't?

4 comments:

  1. I had the same problem and it turns out that OSX likes the M for megabyte to be lowercase - could be the same for the gigs.

    kris

    ReplyDelete
  2. I love you, I am like you, I feel like you. I will always be with you. You're my friend, forever.

    ReplyDelete
    Replies
    1. Damn! Hey are you out of your mind? Drunk?

      Delete
  3. You could allow people to edit/delete their comments after publication for freedom. I wanted to give you my number/mail so that we can exchange on these feelings. I still want it. But now you have a way to find it, just click again on my name, and you have the way to find it. Free, freedom, love and peace for you.

    ReplyDelete