FORUMS

CloudPlayer: DIY HiFi Music Streaming Solution

In our Helpful Guide to Music Streaming Services, we mentioned several different services … more

Optimize Battery Life with This Useful App

Battery life is an important aspect of your smartphone, especially if you use it for more … more

The OnePlus 2 & The Year of Smartphone Compromises

We are very close to entering the last third of 2015, and we have now seen many of … more

OnePlus 2 Teardown, Major Android Vulnerability – XDA TV

The OnePlus 2 has been officially released. That and much more news is … more

Resize Nook STR Partitions

112 posts
Thanks Meter: 141
 
By meghd00t, Senior Member on 19th August 2011, 07:32 AM
Post Reply Subscribe to Thread Email Thread
I wanted to increase the available space for my side loaded content and reduce the space for B&N downloads

First I used noogie to make a backup of the pristine nook at v 1.0.0, next I upgraded it to v1.0.1 and made another image

Then these commands on a linux box

Code:

dd if=/dev/zero of=new.img bs=1958739968 count=1

(
cat << _EOF
0,8,c,*
,2,c
,64,L
,,E
,128,L
,668,c
,32,L
,,L
_EOF
) | sfdisk -H128 -S32 -D -f new.img


kpartx -a mynookbackup.img
kpartx -a new.img

mkdir x z
cd x
mkdir boot  cache  data  factory  NOOK  p5  rom
cd ../z
mkdir boot  cache  data  factory  NOOK  p5  rom
cd ..

mkdosfs -H128 -t32 -F16 -n boot /dev/mapper/loop1p1
mkdosfs -H128 -t32 -F12 -n rom  /dev/mapper/loop1p2
mkdosfs -H128 -t32 -F32 -n NOOK /dev/mapper/loop1p6

mkfs.ext2 -L factory /dev/mapper/loop1p3
mkfs.ext2            /dev/mapper/loop1p5

mkfs.ext3 -L cache   /dev/mapper/loop1p7
mkfs.ext3 -L data    /dev/mapper/loop1p8


cd x
mount /dev/mapper/loop0p1 boot
mount /dev/mapper/loop0p2 rom
mount /dev/mapper/loop0p3 factory
mount /dev/mapper/loop0p5 p5
mount /dev/mapper/loop0p6 NOOK
mount /dev/mapper/loop0p7 cache
mount /dev/mapper/loop0p8 data


cd ../z
mount /dev/mapper/loop1p1 boot
mount /dev/mapper/loop1p2 rom
mount /dev/mapper/loop1p3 factory
mount /dev/mapper/loop1p5 p5
mount /dev/mapper/loop1p6 NOOK
mount /dev/mapper/loop1p7 cache
mount /dev/mapper/loop1p8 data
cd ..

rsync -avP x/ z/
sync
umount x/*
umount z/*

kpartx -d mynookbackup.img
kpartx -d new.img

after that I now have 1.4 GB for side loaded content.

Hope this helps someone.
The Following 7 Users Say Thank You to meghd00t For This Useful Post: [ View ]
 
 
20th August 2011, 03:31 AM |#2  
Member
Clearfield, UT
Thanks Meter: 21
 
More
Thanks for sharing. This is something that i have been wanting to do so I would not have to use an sd card.

Now I do have a question on this. the part
Code:
(
cat << _EOF
0,8,c,*
,2,c
,64,L
,,E
,128,L
,668,c
,32,L
,,L
_EOF
) | sfdisk -H128 -S32 -D -f new.img
what does this actually do?
20th August 2011, 04:26 AM |#3  
OP Senior Member
Flag Bangalore
Thanks Meter: 141
 
More
It creates a new partition table on the file new.img using sfdisk I can script it instead of doing it manually

Here is the output of fdisk -l on both files
Code:
Disk mynook101.img: 1958 MB, 1958739968 bytes
128 heads, 32 sectors/track, 934 cylinders, total 3825664 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

        Device Boot      Start         End      Blocks   Id  System
mynook101.img1   *          32      155647       77808    c  W95 FAT32 (LBA)
mynook101.img2          155648      188415       16384    c  W95 FAT32 (LBA)
mynook101.img3          188416      577535      194560   83  Linux
mynook101.img4          577536     3792895     1607680    5  Extended
mynook101.img5          577568     1167359      294896   83  Linux
mynook101.img6         1167392     1658879      245744    c  W95 FAT32 (LBA)
mynook101.img7         1658912     2150399      245744   83  Linux
mynook101.img8         2150432     3792895      821232   83  Linux

Disk new.img: 1958 MB, 1958739968 bytes
128 heads, 32 sectors/track, 934 cylinders, total 3825664 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

  Device Boot      Start         End      Blocks   Id  System
new.img1   *          32       32767       16368    c  W95 FAT32 (LBA)
new.img2           32768       40959        4096    c  W95 FAT32 (LBA)
new.img3           40960      303103      131072   83  Linux
new.img4          303104     3825663     1761280    5  Extended
new.img5          303136      827391      262128   83  Linux
new.img6          827424     3563519     1368048    c  W95 FAT32 (LBA)
new.img7         3563552     3694591       65520   83  Linux
new.img8         3694624     3825663       65520   83  Linux
The Following User Says Thank You to meghd00t For This Useful Post: [ View ]
20th August 2011, 04:34 AM |#4  
OP Senior Member
Flag Bangalore
Thanks Meter: 141
 
More
and here is the output of df to see where the space has been reallocated

Code:
Filesystem    Type    Size  Used Avail Use% Mounted on
              vfat     75M  9.8M   66M  14% /mnt/scratch/tmp/x/boot
              vfat     16M  119K   16M   1% /mnt/scratch/tmp/x/rom
              ext2    184M  106M   77M  58% /mnt/scratch/tmp/x/factory
              ext2    279M  185M   92M  67% /mnt/scratch/tmp/x/p5
              vfat    237M  171K  237M   1% /mnt/scratch/tmp/x/NOOK
              ext3    233M  6.1M  224M   3% /mnt/scratch/tmp/x/cache
              ext3    790M   42M  740M   6% /mnt/scratch/tmp/x/data
              vfat     16M  9.8M  6.2M  62% /mnt/scratch/tmp/z/boot
              vfat    4.0M  148K  3.9M   4% /mnt/scratch/tmp/z/rom
              ext2    124M  106M   13M  90% /mnt/scratch/tmp/z/factory
              ext2    248M  185M   51M  79% /mnt/scratch/tmp/z/p5
              vfat    1.4G  212K  1.4G   1% /mnt/scratch/tmp/z/NOOK
              ext3     62M  5.4M   54M  10% /mnt/scratch/tmp/z/cache
              ext3     62M   30M   29M  51% /mnt/scratch/tmp/z/data
26th August 2011, 11:56 AM |#5  
Member
Flag Paris
Thanks Meter: 29
 
More
Thank you very much, it works very well

Here is what I did with comments of what I understood (might be useful for someone)
Code:
#First, we create a blank image (same size as the nook, mine is 1962934272)
#I used bs=1916928 count=1024 instead of bs=1962934272 count=1, I assume it is the same (or else I didn't have enough memory))
dd if=/dev/zero of=new.img bs=1916928 count=1024

#Then, we create partitions on it with sfdisk (I used a larger data partition to have more space for my apps)
(
cat << _EOF
0,8,c,*
,2,c
,64,L
,,E
,128,L
,620,c
,32,L
,,L
_EOF
) | sfdisk -H128 -S32 -D -f new.img

#We create partition mapping (or something like that) so that we can "access" them in /dev/mapper
kpartx -a mynookbackup.img
kpartx -a new.img

mkdir x z
cd x
mkdir boot  cache  data  factory  NOOK  p5  rom
cd ../z
mkdir boot  cache  data  factory  NOOK  p5  rom
cd ..

# We create the filesystems on the partitions (Your mkdosfs commands were invalid for me, so I did something like)
mkdosfs -F16 -n boot /dev/mapper/loop1p1
mkdosfs -F12 -n rom  /dev/mapper/loop1p2
mkdosfs -F32 -n NOOK /dev/mapper/loop1p6

mkfs.ext2 -L factory /dev/mapper/loop1p3
mkfs.ext2            /dev/mapper/loop1p5

mkfs.ext3 -L cache   /dev/mapper/loop1p7
mkfs.ext3 -L data    /dev/mapper/loop1p8

#We mount them
cd x
mount /dev/mapper/loop0p1 boot
mount /dev/mapper/loop0p2 rom
mount /dev/mapper/loop0p3 factory
mount /dev/mapper/loop0p5 p5
mount /dev/mapper/loop0p6 NOOK
mount /dev/mapper/loop0p7 cache
mount /dev/mapper/loop0p8 data


cd ../z
mount /dev/mapper/loop1p1 boot
mount /dev/mapper/loop1p2 rom
mount /dev/mapper/loop1p3 factory
mount /dev/mapper/loop1p5 p5
mount /dev/mapper/loop1p6 NOOK
mount /dev/mapper/loop1p7 cache
mount /dev/mapper/loop1p8 data
cd ..

#We copy the content of the nook's partitions to the new ones
rsync -avP x/ z/
sync

umount x/*
umount z/*

kpartx -d mynookbackup.img
kpartx -d new.img

#Now we just have to "restore" new.img on the nook
For information, my partition table
Code:
Disque new.img*: 1962*Mo, 1962934272*octets
128 têtes, 32 secteurs/piste, 936 cylindres, total 3833856 secteurs
Unités = secteurs de 1 * 512 = 512 octets
Taille de secteur (logique / physique)*: 512*octets / 512*octets
taille d'E/S (minimale / optimale)*: 512*octets / 512*octets
Identifiant de disque*: 0x00000000

Périphérique Amorce  Début        Fin      Blocs     Id  Système
new.img1   *          32       32767       16368    c  W95 FAT32 (LBA)
new.img2           32768       40959        4096    c  W95 FAT32 (LBA)
new.img3           40960      303103      131072   83  Linux
new.img4          303104     3833855     1765376    5  Étendue
new.img5          303136      827391      262128   83  Linux
new.img6          827424     3366911     1269744    c  W95 FAT32 (LBA)
new.img7         3366944     3497983       65520   83  Linux
new.img8         3498016     3833855      167920   83  Linux

#The original one
Disque /dev/sdb*: 1962*Mo, 1962934272*octets
128 têtes, 32 secteurs/piste, 936 cylindres, total 3833856 secteurs
Unités = secteurs de 1 * 512 = 512 octets
Taille de secteur (logique / physique)*: 512*octets / 512*octets
taille d'E/S (minimale / optimale)*: 512*octets / 512*octets
Identifiant de disque*: 0x00000000

Périphérique Amorce  Début        Fin      Blocs     Id  Système
/dev/sdb1   *          32      155647       77808    c  W95 FAT32 (LBA)
/dev/sdb2          155648      188415       16384    c  W95 FAT32 (LBA)
/dev/sdb3          188416      577535      194560   83  Linux
/dev/sdb4          577536     3792895     1607680    5  Étendue
/dev/sdb5          577568     1167359      294896   83  Linux
/dev/sdb6         1167392     1658879      245744    c  W95 FAT32 (LBA)
/dev/sdb7         1658912     2150399      245744   83  Linux
/dev/sdb8         2150432     3792895      821232   83  Linux

#df
Sys. de fichiers    Taille Util. Disp. Uti% Monté sur
/dev/mapper/loop0p1    75M   58M   17M  78% /home/mdall/x/boot
/dev/mapper/loop0p2    16M  120K   16M   1% /home/mdall/x/rom
/dev/mapper/loop0p3   184M  106M   77M  58% /home/mdall/x/factory
/dev/mapper/loop0p5   279M  194M   83M  71% /home/mdall/x/p5
/dev/mapper/loop0p6   240M  104M  137M  43% /home/mdall/x/NOOK
/dev/mapper/loop0p7   233M   14M  217M   6% /home/mdall/x/cache
/dev/mapper/loop0p8   790M  149M  633M  20% /home/mdall/x/data

/dev/mapper/loop1p1    16M   10M  6,0M  63% /home/mdall/z/boot
/dev/mapper/loop1p2   4,0M  150K  3,9M   4% /home/mdall/z/rom
/dev/mapper/loop1p3   124M  106M   13M  90% /home/mdall/z/factory
/dev/mapper/loop1p5   248M  191M   45M  82% /home/mdall/z/p5
/dev/mapper/loop1p6   1,3G  104M  1,2G   9% /home/mdall/z/NOOK
/dev/mapper/loop1p7    62M   13M   47M  21% /home/mdall/z/cache
/dev/mapper/loop1p8   159M  136M   16M  90% /home/mdall/z/data
The Following 3 Users Say Thank You to mdall For This Useful Post: [ View ]
27th August 2011, 02:49 AM |#6  
silentwind96's Avatar
Member
Flag Bakersfield, CA
Thanks Meter: 4
 
More
For those of us tards who have no clue how to use linux and still wanna increase the size of our Nook Touch, is there a nice gui that will do the same thing?
The Following 2 Users Say Thank You to silentwind96 For This Useful Post: [ View ]
30th August 2011, 08:46 AM |#7  
Senior Member
Thanks Meter: 207
 
More
Another helpful trick to add to this mix:

symlink /data/media to
/media so you can actually see the files BN is downloading to your device.

in adb shell or via ssh:

cd /data/media

rm -r *

cd ..

rmdir media

ln -s media /media

After doing this, the reader, etc. put their files where you can pick them up and archive them in Calibre, etc.
3rd December 2011, 09:53 AM |#8  
Member
Thanks Meter: 2
 
More
One more nook succesfully resized.

Thanks
3rd December 2011, 11:15 AM |#9  
Junior Member
Thanks Meter: 0
 
More
Smile
is a step by step instruction possible......
Last edited by toniexly; 3rd December 2011 at 12:43 PM.
3rd December 2011, 02:39 PM |#10  
Senior Member
Thanks Meter: 24
 
More
Hi, I can see the you do not care about bootloader during the resize. Do you know what bootloader is used in nook? grub? (don't have my nook atm so I cannot check it)
5th December 2011, 08:37 PM |#11  
ros87's Avatar
Senior Member
Flag Bodø
Thanks Meter: 161
 
Donate to Me
More
Quote:
Originally Posted by cceerrtt

Hi, I can see the you do not care about bootloader during the resize. Do you know what bootloader is used in nook? grub? (don't have my nook atm so I cannot check it)

x-loader and u-boot, both located on the fat32 /boot partition.
This is the beauty of the omap3 platform

Read More
Post Reply Subscribe to Thread

Tags
howto, linux, partition, resize
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes