pfSense Support Subscription

Author Topic: Slightly undersized CF cards with nanobsd images?  (Read 8652 times)

0 Members and 1 Guest are viewing this topic.

Offline althornin

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Slightly undersized CF cards with nanobsd images?
« on: August 31, 2009, 08:46:55 am »
Hey, I just recently purchased a stack of 5 Alix boxes to use with pfSense.  They came with "2GB" CF cards.
However, when I try to use physdiskwrite to write the 2GB nanobsd images to them, I always get the following error:
2011226112/2048901120 bytes written
Write error after 2011226112 bytes.

However, the resulting CF card appears to boot and work properly (but I don't trust it).
Flashing one of the 1GB nanobsd images doesn't result in an error.

My request/question:
Should I continue to use the 1GB nanobsd images, and if so, can the 2GB images be "shrunk" to take into account the apparent multitude of cards that say they are one size when they are just a little smaller?

Online jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 14932
    • View Profile
Re: Slightly undersized CF cards with nanobsd images?
« Reply #1 on: August 31, 2009, 08:58:50 am »
You'll probably be safer using the 1GB images unless you really plan on filling up the card. Using less of the CF leaves more room for the wear leveling to work over time. Depending on the card, some will shrink little by little as sectors become unusable.

The 2GB cards can be sized when they are made, but not resized after the fact. I think the profile chosen was Sandisk, though I'd have to look up the sector size to be sure.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline althornin

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Slightly undersized CF cards with nanobsd images?
« Reply #2 on: August 31, 2009, 09:09:38 am »
Just to note, I am in fact using SanDisk CF cards.

I will stick with the 1GB images, I don't think space will be a problem, I would be fine with 512MB CF cards, these are just what came with the Alix boxes when I ordered them.

Thanks!

Online jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 14932
    • View Profile
Re: Slightly undersized CF cards with nanobsd images?
« Reply #3 on: August 31, 2009, 09:40:15 am »
pfsense_local.sh:export FLASH_MODEL="sandisk"

Not sure why yours are lower than what is defined in the list used by the builder.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline althornin

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Slightly undersized CF cards with nanobsd images?
« Reply #4 on: August 31, 2009, 09:49:56 am »
Me either - its not a 1-off problem either, all 5 of the cards error at the exact same point when trying to flash the 2GB images.  I tried several different 2GB snapshots as well.

Just to clarify, I am using SanDisk Ultra 2GB cards(supposedly 15MB/s, ha!)
From the Alix boot console:

01F0 Master 848A SanDisk SDCFH-002G
Phys C/H/S 3897/16/63 Log C/H/S 974/64/63
« Last Edit: August 31, 2009, 09:54:24 am by althornin »

Online jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 14932
    • View Profile
Re: Slightly undersized CF cards with nanobsd images?
« Reply #5 on: August 31, 2009, 09:59:51 am »
The builder code shows this under Sandisk:

                2048|2048mb|2g)
                        NANO_MEDIASIZE=`expr 2048901120 / 512`
                        NANO_HEADS=16
                        NANO_SECTS=63

Which agrees with what you saw it trying to write.

What's even stranger is that Google has no relevant hits on your sector count, but a search for 2048901120 turns up several hundred.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline gloomrider

  • Full Member
  • ***
  • Posts: 119
    • View Profile
Re: Slightly undersized CF cards with nanobsd images?
« Reply #6 on: August 31, 2009, 10:20:21 am »
Me either - its not a 1-off problem either, all 5 of the cards error at the exact same point when trying to flash the 2GB images.  I tried several different 2GB snapshots as well.

Just to clarify, I am using SanDisk Ultra 2GB cards(supposedly 15MB/s, ha!)
From the Alix boot console:

01F0 Master 848A SanDisk SDCFH-002G
Phys C/H/S 3897/16/63 Log C/H/S 974/64/63

Interesting

512 X 63 X 16 X 3897 = 2,011,226,112

When my ALIX boots:

Code: [Select]
01F0 Master 848A SanDisk SDCFH2-002G                    
Phys C/H/S 3970/16/63 Log C/H/S 992/64/63

512 X 63 x 16 x 3970 = 2,048,901,120

The only difference is the the "SDCFH2" in my vendor string as opposed to "SDCFH" above.

I believe we have found the problem!

Offline althornin

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Slightly undersized CF cards with nanobsd images?
« Reply #7 on: August 31, 2009, 10:32:40 am »
oh nice I should have caught that!

I guess these cards are all 3 cylinders short of 2GB.

New phrase has been coined:  "he's a few cylinders short of a gig, if you know what I mean"

Offline gloomrider

  • Full Member
  • ***
  • Posts: 119
    • View Profile
Re: Slightly undersized CF cards with nanobsd images?
« Reply #8 on: August 31, 2009, 10:52:41 am »
oh nice I should have caught that!

I guess these cards are all 3 cylinders short of 2GB.

New phrase has been coined:  "he's a few cylinders short of a gig, if you know what I mean"

My $.02: The build sizes should be recomputed to accommodate these "few cylinders short" CF cards.  Those should be the new standards.  In the case of the 2GB cards, we're only talking about a 36-ish MB difference.

Online jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 14932
    • View Profile
Re: Slightly undersized CF cards with nanobsd images?
« Reply #9 on: August 31, 2009, 10:59:23 am »
My $.02: The build sizes should be recomputed to accommodate these "few cylinders short" CF cards.  Those should be the new standards.  In the case of the 2GB cards, we're only talking about a 36-ish MB difference.

The problem then is a question of limbo: "how low do we go?"

Your card is a few cyls short, but are there many more out there that are smaller? Or will using your size suffice?

I wonder if anyone has a database of card sizes that is actually worthwhile in this regard.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline gloomrider

  • Full Member
  • ***
  • Posts: 119
    • View Profile
Re: Slightly undersized CF cards with nanobsd images?
« Reply #10 on: August 31, 2009, 12:13:46 pm »
My $.02: The build sizes should be recomputed to accommodate these "few cylinders short" CF cards.  Those should be the new standards.  In the case of the 2GB cards, we're only talking about a 36-ish MB difference.

The problem then is a question of limbo: "how low do we go?"

Your card is a few cyls short, but are there many more out there that are smaller? Or will using your size suffice?

I wonder if anyone has a database of card sizes that is actually worthwhile in this regard.

I'm thinking the pfSense community can help.  How about a new sticky thread: "Post Your CF card sizes" ?

Offline wallabybob

  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
Re: Slightly undersized CF cards with nanobsd images?
« Reply #11 on: August 31, 2009, 06:08:26 pm »
Could it be that a 2GB card should have at least 2,000,000 bytes but may have more?

I don't know how the card size is used so this may not be a useful observation.

Offline althornin

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Slightly undersized CF cards with nanobsd images?
« Reply #12 on: August 31, 2009, 06:36:46 pm »
Could it be that a 2GB card should have at least 2,000,000 bytes but may have more?

I don't know how the card size is used so this may not be a useful observation.
Oh man, maybe we need to treat 2GB like HD makers do:
2GB where 1GB is defined as 1,000,000,000 bytes...

After all, the cards do use the proper SI for that, they say 2GB, not 2GiB.
Time to follow the standards :)

Offline blewis

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: Slightly undersized CF cards with nanobsd images?
« Reply #13 on: September 01, 2009, 01:19:39 pm »
Good day,

I was also having all sorts of issues with trying to write to a 512MB CF card using physdiskwrite under windows, but as soon as I popped a Linux LiveCD (Knoppix) I performed the write without issue. 

Another issue, is that some lower cost CF cards are made using "chip rejects" that do not meet specs.  Just like most HDD, they all contain bad sectors that gets re-allocated by its firmware.  I believe all the extra sectors that would have been used for re-allocation are all used up hence the unusually smaller size.

Finally, a couple of cheap CF reader I had were also to blame for not able to read larger CF cards.

Offline gloomrider

  • Full Member
  • ***
  • Posts: 119
    • View Profile
Re: Slightly undersized CF cards with nanobsd images?
« Reply #14 on: September 01, 2009, 01:33:16 pm »
Good day,

I was also having all sorts of issues with trying to write to a 512MB CF card using physdiskwrite under windows, but as soon as I popped a Linux LiveCD (Knoppix) I performed the write without issue. 

Another issue, is that some lower cost CF cards are made using "chip rejects" that do not meet specs.  Just like most HDD, they all contain bad sectors that gets re-allocated by its firmware.  I believe all the extra sectors that would have been used for re-allocation are all used up hence the unusually smaller size.

Finally, a couple of cheap CF reader I had were also to blame for not able to read larger CF cards.

So what should the verdict be for those that have CF cards too small to fit the nanobsd images?  I recently bought 2GB and 4GB cards and have no issues.  But others no doubt would like to avoid purchasing new CF cards.  I understand that pfSense is community supported and there really aren't a lot of resources to throw at this.  I'm merely suggesting that the pfSense team needs to deliver a unified and unambiguous message to the users about this.

My personal feeling is that pfSense embedded is well worth the cost of new CF card(s).