# Wrong partition table

**URL:** <https://forums.digi.com/t/wrong-partition-table/6214>\
**Category:** Linux\
**Created:** [March 13, 2012, 6:02pm UTC](https://forums.digi.com/t/wrong-partition-table/6214 "2012-03-13T18:02:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cassea](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@Cassea](https://forums.digi.com/u/Cassea)\
**Post date:** [March 13, 2012, 6:02pm UTC](https://forums.digi.com/t/wrong-partition-table/6214/1 "2012-03-13T18:02:40Z")

</div>

Hello,

I have prepared an auto-configuration scritp that allows to create all the partitions needed on my Digi Connect ME 9210:

```auto

Nr | Name | Start | Size | Type | FS | Flags
-----------------------------------------------------------------------
 0 | U-Boot | 0 | 192 KiB | U-Boot | | fixed
 1 | NVRAM | 192 KiB | 128 KiB | NVRAM | | fixed
 2 | Kernel | 320 KiB | 1152 KiB | Linux-Kernel | |
 3 | RootFS | 1472 KiB | 1 MiB | Filesystem | SQUASHFS | rootfs
 4 | UserFS | 2496 KiB | 1600 KiB | Filesystem | JFFS2 |

```

My scritp assumes that by default the system is configured only with U-Boot and NVRAM partitions and it works properly.

Recently we have received devices with a different default partition table:

```auto

Nr | Name | Start | Size | Type | FS | Flags
-----------------------------------------------------------------------
 0 | U-Boot | 0 | 192 KiB | U-Boot | | fixed
 1 | NVRAM | 192 KiB | 128 KiB | NVRAM | | fixed
 2 | Kernel | 320 KiB | 1280 KiB | Linux-Kernel | |
 3 | RootFS | 1600 KiB | 1536 KiB | Filesystem | SQUASHFS | rootfs
 4 | UserFS | 3136 KiB | 960 KiB | Filesystem | JFFS2 |

```

Therefore, after the execution of my script the result is:

```auto

Nr | Name | Start | Size | Type | FS | Flags
-----------------------------------------------------------------------
 0 | U-Boot | 0 | 192 KiB | U-Boot | | fixed
 1 | NVRAM | 192 KiB | 128 KiB | NVRAM | | fixed
 2 | Kernel | 320 KiB | 1280 KiB | Linux-Kernel | |
 3 | RootFS | 1600 KiB | 1536 KiB | Filesystem | SQUASHFS | rootfs
 4 | UserFS | 3136 KiB | 960 KiB | Filesystem | JFFS2 |
 5 | Kernel | 320 KiB | 1152 KiB | Linux-Kernel | |
 6 | RootFS | 1472 KiB | 1 MiB | Filesystem | SQUASHFS | rootfs
 7 | UserFS | 2496 KiB | 1600 KiB | Filesystem | JFFS2 |

```

There are two Linux-Kernel partitions, 2 SQUASHFS partitions and 2 JFFS2 partitions.  
In this situation, my application loaded in JFFS2 partition, seems to work the same. Could it be possible?  
What can be happen with a wrong partition table as the last described?  
How can modify the auto-configuration script in order to detect and delete all unwanted partition at the beginning?

Below the scritp:

```auto
intnvram set partition add name=Kernel chip=0 start=0x50000 size=0x120000 type=Linux-Kernel flag_fixed=0 flag_readonly=0
intnvram set partition add name=RootFS chip=0 start=0x170000 size=0x100000 type=Filesystem flag_fixed=0 flag_readonly=0 flag_fs_type=SQUASHFS flag_fs_root=1 flag_fs_mount_readonly=0
intnvram set partition add name=UserFS chip=0 start=0x270000 size=0x190000 type=Filesystem flag_fixed=0 flag_readonly=0 flag_fs_type=JFFS2 flag_fs_root=0 flag_fs_mount_readonly=0
erase_pt UserFS
setenv loadbootsc no
update linux
update rootfs
update userfs tftp userfs.jffs2
setenv bootcmd dboot linux flash
setenv start_app /tmp/mnt/UserFS/boot.sh
setenv console console=none
setenv dhcp on
saveenv
reset

```

Thanks in advance,  
Paolo

---

<div class="post-metadata">

**Author:** ![bobthomas13](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bobthomas13](https://forums.digi.com/u/bobthomas13)\
**Post date:** [March 14, 2012, 7:21am UTC](https://forums.digi.com/t/wrong-partition-table/6214/2 "2012-03-14T07:21:05Z")

</div>

Refer [http://www.digi.com/support/kbase/kbaseresultdetl?id=3173](http://www.digi.com/support/kbase/kbaseresultdetl?id=3173)
