Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Script to resize embedded images

    Scheduled Pinned Locked Moved Problems Installing or Upgrading pfSense Software
    12 Posts 5 Posters 27.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      hoba
      last edited by

      Feel free to add this to our wiki at wiki.pfsense.com  :)

      1 Reply Last reply Reply Quote 0
      • M
        marzl
        last edited by

        http://wiki.pfsense.com/wikka.php?wakka=FlashHowToSkript

        1 Reply Last reply Reply Quote 0
        • J
          jakee
          last edited by

          :) very good

          1 Reply Last reply Reply Quote 0
          • belleraB
            bellera
            last edited by

            I have troubles using it in a FreeBSD 6.2 machine:

            ./mkflash_new.sh 256 pfSense.img.gz

            abr 19 17:16:32: Creating 256MB Compact Flash
            abr 19 17:16:32: And using pfSense.img.gz as source image.
            abr 19 17:16:32:
            abr 19 17:16:32:        Real flash size: 222 MB
            abr 19 17:16:32:        root size: 218, root blocks: 446464
            abr 19 17:16:32:        conf size: 4, conf blocks: 8192 446464
            abr 19 17:16:32:        cylinders: 888, heads: 16, sectors: 32
            abr 19 17:16:32:
            abr 19 17:16:32: Creating empty 256MB flash image in /usr/home/super/pfsense
            abr 19 17:16:45:
            abr 19 17:16:45: Preparing Filesystems on /usr/home/super/pfsense/pfSense-256MB.img
            abr 19 17:16:45:        Bsdlabel
            abr 19 17:16:45:        Newfs
            abr 19 17:16:45:
            abr 19 17:16:45: Extracting content from pfSense.img.gz
            mount: /dev/md0a: No such file or directory
            mount: /dev/md0d: No such file or directory

            abr 19 17:16:45:        -> /usr/home/super/pfsense/pfSense-slash.tar.bz2
            abr 19 17:16:45:        -> /usr/home/super/pfsense/pfSense-conf.tar.bz2
            umount: /dev/md0a: statfs: No such file or directory
            umount: /dev/md0a: unknown file system
            umount: /dev/md0d: statfs: No such file or directory
            umount: /dev/md0d: unknown file system

            abr 19 17:16:46:
            abr 19 17:16:46: Restoring content to /usr/home/super/pfsense/pfSense-256MB.img
            abr 19 17:16:46:        <- /usr/home/super/pfsense/pfSense-slash.tar.bz2
            abr 19 17:16:46:        <- /usr/home/super/pfsense/pfSense-conf.tar.bz2
            abr 19 17:16:47:        Cleanig up.
            abr 19 17:16:47:
            abr 19 17:16:47: Compressing /usr/home/super/pfsense/pfSense-256MB.img
            abr 19 17:17:04:        Creating MD5 hash
            abr 19 17:17:04:
            abr 19 17:17:04: READY! Now you have a 256MB pfSense image.
            abr 19 17:17:04: You can get this image on your CF Card using:
            abr 19 17:17:04: zcat /usr/home/super/pfsense/pfSense-256MB.img.gz | dd of=/dev/da0 bs=16k

            Please, help!

            Josep Pujadas

            1 Reply Last reply Reply Quote 0
            • M
              marzl
              last edited by

              It seems there is no support fpr Memory Disks on your System.
              Does a```
              #> kldload /boot/kernel/geom_md.ko

              1 Reply Last reply Reply Quote 0
              • belleraB
                bellera
                last edited by

                kldload /boot/kernel/geom_md.ko

                kldload: can't load /boot/kernel/geom_md.ko: File exists

                Any other idea?

                Thanks,

                Josep Pujadas

                1 Reply Last reply Reply Quote 0
                • M
                  marzl
                  last edited by

                  The Sourceimage has to be decompressed FIRST!

                  Use```
                  #>./mkflash_new.sh 256 pfSense.img

                  1 Reply Last reply Reply Quote 0
                  • belleraB
                    bellera
                    last edited by

                    I'm very sorry!

                    I forgot gunzip the image file before running the script …

                    Many thanks!

                    Josep Pujadas

                    1 Reply Last reply Reply Quote 0
                    • V
                      Veni
                      last edited by

                      What values should i use inside the following variables:

                      • flash_MB

                      • conf_MB

                      • heads

                      • sectors

                      for a 2 GB CF card
                      if i wanted to modify the script(http://wiki.pfsense.com/wikka.php?wakka=FlashHowToSkript ) to support 2 GB cards?

                      1 Reply Last reply Reply Quote 0
                      • belleraB
                        bellera
                        last edited by

                        Hello!

                        I don't know if it is standard, but I found at http://www.industrialcompactflash.com/datasheets/wincflash.pdf :

                        Table 48: Product Capacity & Part Numbering

                        | Card Capacity Part Number Real Capacity Total Sectors/Card (Max LBA+1) Cylinders Heads Sectors |
                        | 128 MB CFLASH-G-128-I 131MB 256,512 1,002 8 32 |
                        | 256 MB CFLASH-G-256-I 262MB 513,536 1,003 16 32 |
                        | 512 MB CFLASH-G-512-I 526MB 1,028,160 1,020 16 63 |
                        | 1 GB CFLASH-G-1024-I 1,054MB 2,060,352 2,044 16 63 |
                        | 2 GB CFLASH-G-2048-I 2,118MB 4,136,832 4,104 16 63 |
                        | 4 GB CFLASH-G-4204-I 4,204MB 8,211,168 8,146 16 63 |
                        | 8 GB CFLASH-G-8415-I 8,415MB 16,435,440 16,305 16 63 |

                        Regards,

                        Josep Pujadas

                        1 Reply Last reply Reply Quote 0
                        • V
                          Veni
                          last edited by

                          Nice, thanks :D.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.