yashsingh1/xdaforums huggingface dataset:
[Barnes & Noble Nook Tablet] cfoesch:
Eh... modifying the clrbootcount.sh is of course, always a bit risky. I looked at it, and it actually provides a hook to execute /data/boot_complete_hook.sh, which is a nice little place to put things that you want to execute after every boot. (And plus, you don't have to rw your /system every time you want to change something.)

Also, using a "mount -o bind" sets up a situation where you can fill your /data directory with data, and lock yourself out of things. Plus, many apps expect your user data to be stored on a VFAT filesystem, or rather, a case-insensitive filesystem. I would recommend going with the loopback device mentioned by someone else. Also, I chose to use the title "sd-ext", which seems to be more common use for a second sdcard, or such.

After setting up an image file with:

su
cd /data/local
dd if=/dev/zero of=sd-ext.img bs=1024 count=10485760
chown root sd-ext.img
chgrp 2000 sd-ext.img # 2000 = system
chmod 644 sd-ext.img
mkfs.vfat sd-ext.img

I then setup my /data/boot_complete_hook.sh to be:

#!/system/bin/sh
mount -o remount,rw -t rootfs rootfs /
mkdir /mnt/sd-ext
chown 1000 /mnt/sd-ext
chgrp 1015 /mnt/sd-ext
chmod 775 /mnt/sd-ext
ln -s /mnt/sd-ext /sd-ext
mount -o remount,ro -t rootfs rootfs /

busybox mount -o loop /data/local/sd-ext.img /mnt/sd-ext

N.B.: Ensure that your /data/boot_complete_hook.sh is executable!

This has given me a 10GB partition under /mnt/sd-ext that works just like the sdcard, and media partitions, except that it doesn't mount over USB (drat, always a catch, right?) ... Also, I can't seem to get a Favorite in for it on ES File Explorer, perhaps I'm just doing it wrong?

I'm still quite the Android noob, but I've been using Linux and other *nixes exclusively for over a decade now...

Does anyone know how to get vold to mount a loopback device as if it were an SDCARD device? I tired the naive approach of just putting in /dev/loop0 as the two device names, but it seems to have not worked.
[Barnes & Noble Nook Tablet] Anxiyz:
Unfortunately, this method doesn't seem to work for me. Both MX Video Player and the Gingerbread Gallery do not detect data/usrdata

I may have done something wrong, but I tried both methods suggested (replacing file, editing original file).
[Barnes & Noble Nook Tablet] cfoesch:
I've been messing around with my variation with /mnt/sd-ext, and what it is, is that some apps simply refuse to look anywhere but /mnt/sdcard, and potentially /mnt/media (nook native apps, like Music.apk)

As a result, unless your apps are built to allow for arbitrary file locations, no other option is going to allow you to "cheat" this system. For instance, Music.apk won't look in my /mnt/sd-ext, so I had to put my music entirely in /mnt/sdcard, but MX Video Player is willing to allow you to specify /mnt/sd-ext as a search directory, so it can look in.

I'm playing videos from /mnt/sd-ext right now, but for the life of me I cannot get music playing from it, and they must be in /mnt/media or /mnt/sdcard right now. I'm working on it, but it's a pain.
[Barnes & Noble Nook Tablet] CapsLockKey:
I just used WiFi File Explorer (was a FAOTD on Amazon a long time ago) to move files from my PC to mnt/internal directory without any problems as an alternative to not having access via USB.
[Barnes & Noble Nook Tablet] jairuncaloth:
Nook Tablet Fdisk output

I haven't seen this posted in this thread yet, so here's the 'fdisk -l' output. The partition table is GPT and I don't know if fdisk can deal with GPT or not. Maybe we could build parted and use it to resize partitions? I can't really experiment with the partition tables right now because this is my GF's NT and we're going out of town tomorrow. I don't think she would be very happy if I bricked the thing before we left :-p.

# fdisk -l /dev/block/mmcblk0

Disk /dev/block/mmcblk0: 15.9 GB, 15925772288 bytes
256 heads, 63 sectors/track, 1928 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 1894 15267839+ ee EFI GPT

Edit: Looks like parted has already been built for arm. I'll take a closer look when I get back in town. http://xdaforums.com/showthread.php?t=1388996
[Barnes & Noble Nook Tablet] cfoesch:
Looking at the vold.fstab, it lists two numbers where there would normally only be one.

dev_mount sdcard /mnt/sdcard auto [B][I][U]auto[/U][/I][/B] /device/platform/usb/mass/storage/lun1 /devices/platform/mmci-omap-hs.0/mmc_host/mmc1
dev_mount media /mnt/media 10 [B][I][U]002[/U][/I][/B] /devices/platform/usb_mass_storage/lun0 /devices/platform/mmci-omap-hs.1/mmc_host/mmc0

This is non-standard, so it looks likely that they are using some sort of extra level of partitioning or something.

---------- Post added 28th December 2011 at 12:09 AM ---------- Previous post was 27th December 2011 at 11:53 PM ----------

Here's the parted output, it seems that there is a lot of funky stuff going on in various places, I've touched nothing, because I definitely don't want to brick my device permanently.

# parted /dev/block/mmcblk0
parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
print
Error: The backup GPT table is not at the end of the disk, as it should be.
This might mean that another operating system believes the disk is smaller.
Fix, by moving the backup to the end (and removing the old backup)?
Fix/Ignore/Cancel? ignore
ignore
ignore
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be
used, you can fix the GPT to use all of the space (an extra 569312 blocks) or
continue with the current setting?
Fix/Ignore? ignore
ignore
ignore
Model: MMC SEM16G (sd/mmc)
Disk /dev/block/mmcblk0: 15.9GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 16.3MB 15.7MB recovery
4 16.8MB 33.6MB 16.8MB boot
5 33.6MB 83.9MB 50.3MB fat32 rom
6 83.9MB 134MB 50.3MB fat32 bootdata
7 134MB 522MB 388MB ext4 factory
8 522MB 1164MB 642MB ext4 system
9 1164MB 1611MB 447MB ext4 cache
10 1611MB 2684MB 1074MB fat32 media
11 2684MB 15.6GB 12.9GB ext4 userdata

(parted)
[Barnes & Noble Nook Tablet] jairuncaloth:
Seeing as how data (I'm reasonably sure userdata is /data) and media are directly next to each other,

10 1611MB 2684MB 1074MB fat32 media
11 2684MB 15.6GB 12.9GB ext4 userdata

it should be trivial to simply re-size the partitions with parted. Theoretically this shouldn't cause any loss of data, but if anyone attempts this I would recommend backing up personal files first. I would think that the worst case scenario, is that parted could fubar the partition table and render the device unbootable.

First step would be to shrink userdata. GF is currently using about 512MB of hers, I would probably shrink it to about 2GB which might be overkill but allows lots of room for apps. Then grow Media to fill in the space which should leave us with 11GB or so of space. I want to try this very much right now, but I don't want the GF aggro if for some reason this bricks it.

Keep in mind this is me mostly thinking out loud and anyone who tries anything like this does so at their own risk. I'm not a dev and I don't know the internals of the NT very well at all.
[Barnes & Noble Nook Tablet] cfoesch:
No, worst case, is that you trigger the boot chip's efuse by changing the partition tablet. Then, it's not just bricked, it's BRICKED, and entirely unrecoverable.

I've been making a 10GiB sd-ext.img file in the /data partition for awhile. It does seem like that's probably the optimal space. Especially, since B&N apps store all their stuff on the /data partition. (Although, we could symlink from there onto the /mnt/media partition without any troubles, since /data is ext2.)

The main reason I haven't touched anything like this is because of the secure bootloader. I'm comfortable with partitions and everything (been hacking them since MS-DOS) so, I'm not scared about the modifying... I'm just scared to death of pissing off the bootloader...
[Barnes & Noble Nook Tablet] beatphreek:
From following the saga on the Atrix for about 6 months until we finally got our boot loaders unlocked I am pretty sure we were doing every thing but messing with the boot loading partition on ours. The only hard bricks ever were after a patched bootloader was released and some people tried to downgrade back to that via sbf.

Now I do any repartitioning because MOTO had us correctly partitioned in the first place, however I know that others did and it didn't blow the efuse.

Not sure that any of that information is at all valid with BN's software, but it was just an observation from watching things unfold daily for a few months with my phone.
[Barnes & Noble Nook Tablet] cfoesch:
That's good news that the partitioning didn't seem to brick the device... I'm feeling more confident about maybe trying to do it.

... hate to be the first though, lol

If I could look at their recovery scripts that would probably help me more, because then I could see if it fixes the partitioning during recovery as well. It would be super crazy nice if it didn't repair partitioning so you could just repartition, and recover, and have fresh factory install, but then it would be nice if it did recover the partitions, because then it would be able to unbrick itself if someone ****s things up.
[Barnes & Noble Nook Tablet] cfoesch:
Using the /data/usrdata hack as posted doesn't seem to be working right...

When I made a directory in ES File Explorer, it set the permissions of the folder to be "700", with owner and group app_76 ...

This could probably be fixed with a umask, but it's part of the problem I noted when I suggested against using this method, because FAT32, which everyone is expecting to store stuff on doesn't use permissions or case-sensitivity, and might make the assumption based on that.
[Barnes & Noble Nook Tablet] gameman733:
This was the main reason I wanted to use the mount command because I knew there was a way to mount partitions while ignoring permissions. I didn't find out until later you can't do this with bind mounts. I thought about adding something to run a recursive chmod every so often, but that would be hackish at best, and get pretty slow once it fills up.

If we could get an image file to be expandable and shrink, I wouldn't have an issue with that. Thought about using fuse and a virtual hard disk image file, but haven't looked into it very far.
[Barnes & Noble Nook Tablet] cfoesch:
Well, I implemented this /data/usrdata hack into snowball-mod by default because, hey... it's cheap, it's inexpensive, and if you do get your data there, and your permissions set up, that's really most of what's important anyways.

But I also implemented the card image loopback device load... but yeah, as you mentioned, it won't shrink or grow, so a little less useful. But in my mind, it fits better. I'd rather allocate all that memory upfront and have the data space the data space, and the user space as user space, and the two can't overfill into each other. It's the way the normal partitions work, so.
[Barnes & Noble Nook Tablet] cfoesch:
Well, I got desperate enough to try. I selected "fix" for the GPT table problem, and it went away, and I selected "fix" for the "not using all of the space" problem, and it went away. Both of these did not brick my NT.

However, the fix for not using all of the space still indicated the disk as ending at 15.6, rather than 15.9, so I'm not so sure about how that went.

I am currently restoring factory software (ntunroot.apk recovery) in order to see if this will wipe out the "fixes" indicated above.

--- Update ---

Unable to umount either /data or /media in order to resize them.
[Barnes & Noble Nook Tablet] cfoesch:
Since B&N didn't fill the disk, there is about 300~400 MB left at the end of the sdcard of freespace.

So what?! The /mnt/media partition only takes up 440kb of space. This means that you can create a small partition at the end, format it with mkfs.vfat, then copy over the files from /mnt/media, and then edit /etc/vold.fstab to use partition 13, instead of 10, which allows you to reboot, and now your /mnt/media partition is unmounted!

So WHAT? That means that you can resize that partition down really small, which allows you to make a ~600MB partition and format that as ext4, which you can mount and then copy all the files from /data (assuming you're on a fresh install, this is only about 104.1MB, obviously if you have more than this, this will NOT work for you) onto this new partition, which you can then rename to be "userdata" after renaming the old "userdata" as "userdata2" or something else like that.

SO WHAT?! This means that after a reboot, you can now delete partition 11, and recreate it the same way as you did above the placeholder /data partition, then copy over your data again, and then name swap, and then you can then reboot, and now you have only a 2GB /data partition, which allows you to delete the placeholder userdata partition, and the old media partition, and then recreate a brand new 12GB media partition!

DISCLAIMER!​

Recovery does

NOT

recreate partitions. If you do this, but you screw something up, you will BRICK your NT... and not a happy brick, that just resets after 8 failed boots. No, a FULL ON brick that will render it useless.

The reason I didn't give exacting detail to any of this, is because I do not want someone following a line of scripts and borking their system. You need to be

VERY

confident with editing partitions to try this, and if you are, then all of the above, plus this thread should be enough to help you, too, turn more of your NT's flash available to you.

Again:

THIS CAN HARD BRICK YOUR NOOK TABLE, IF YOU SCREW UP!!!

If you have no experience with partitioning then you should consider this OFF LIMITS. If you aren't afraid yet, then let me remind you:

THIS CAN TURN YOUR NOOK TABLET INTO AN INOPERABLE PAPERWEIGHT, BE AFRAID, BE VERY AFRAID.

Here be dragons, and all that.
[Barnes & Noble Nook Tablet] cfoesch:
I was watching this thread myself, and it seems to have just been buried without anyone noticing or responding. (Most devs I talked to on IRC didn't know about it either.) I also think it used to be under the dev heading, but that doesn't seem to be supported by the evidence... so *shrug* I guess.

Anyways, to clarify my post above. Nothing checks the partition table, and it can be modified freely. So all you people out there who are confident and able workers of partition tables, feel free to give the repartitioning process a shot.

Unfortunately, it does require a large number of reboots (no less than 4), each of which if you screwed up a step, could permanently brick your Nook Tablet (as we have no alternate shell available to boot into in order to fix partition problems). So unless you're already familiar and confident with repartitioning, I highly recommend not trying to mess with it.
[Barnes & Noble Nook Tablet] drwecki:
What do you mean by image file...what program are you using to execute this image file code. Sorry for the noob question
[Barnes & Noble Nook Tablet] cfoesch:
If you have snowball-mod, then you need merely go to the Terminal and type "setup-sd-ext" followed by the number of gigs you want the sd-ext.img to be.

The commands that I gave are shell script commands, that you execute from any terminal.
[Barnes & Noble Nook Tablet] jimmysuggs:
Does anyone know why root explorer won't let me mount as R/W? I'm fully rooted, so I think I should be able to. Yet when I push the "Mount R/W" button, nothing changes.

Help?
[Barnes & Noble Nook Tablet] jimmysuggs:
Whoops, never mind. When I rebooted, it let me change it to write. Thanks anyhow.
[Barnes & Noble Nook Tablet] kbs24:
I am trying out this method and not being familiar with chmod code can you please confirm that the permissions for the new .sh file that I am copying into system/bin are supposed to be changed to match the permissions of the old file that I have now renamed .bk? Sorry, it is probably a stupid question but I don't want to mess up.....thx.
[Barnes & Noble Nook Tablet] lavero.burgos:
yes but just if you want it to persist after reboots then add the lines at the end of the .sh file

~Veronica
[Barnes & Noble Nook Tablet] kbs24:
Thanks Veronica. I have done all of the steps, with the following permissions: data 777, usrdata 777, mnt 777, mnt/internal 777. The permissions for the .sh file are ---rwxr-x. I placed some music folders into usrdata. Rebooted. The mnt/internal folder was there but it was empty. Were my music folders automatically supposed to show up in mnt/internal? I thought they were, but there is nothing in that folder. (Or, am I supposed to copy folders directly into the mnt/internal folder? Because whenever I try to do that root explorer and also my launcher get buggy and freeze and force me to reboot, after which everything that I copied into mnt/internal is gone). I'm about ready to give up and just use docfreed's method with /data/media and forget the /mnt. I'll just have to find progs that find the directory....thanks again for any solutions you wizards have up your sleeves!!

DISCOVERED BUSYBOX WAS NOT INSTALLED. (DON'T KNOW HOW IT GOT UNINSTALLED) I OPENED NINJAMORPH AND IT DID ITS CHECKS AND THERE IT WAS, NO BUSYBOX INSTALLED. SO I REINSTALLED IT, NOW MOUNTS INTERNAL AND PERSISTS UPON REBOOT. NO WONDER I HAD PROBLEMS.
[Barnes & Noble Nook Tablet] roustabout:
cfoesch, I wanted to thank you for biting the bullet and taking a run at parted for everyone.

Once I saw your post, I went ahead and took the plunge, but I did some things a little differently because they were clearer to me that way.

I started off by rooting and dding out the stock partitions 1-8 to temp locations in /data, then moved them to an SD card. 8 was probably a waste of a few minutes, since what I'd hoped - to resize and reboot and have it just work - to have happen, didn't happen :)

DeanG has cautioned that sidebooting using bauwks' exploit makes changes in the boot environment, and the NC is very touchy about those, so I wanted to have that environment frozen for a dead simple restore.

Once I had the dd images of the boot environment made and copied to a safe location, I made a nook OS sideboot card similar to Adam's, but with parted, a Gingerbread make_ext4fs binary, wifi and ssh available and the vold.fstab and vold.conf files edited to comment out all references to the internal partitions.

Once that card booted, I deleted partitions 10 and 11, resized them, built the filesystems on them, and dd'ed back in the partitions from stock so I could be 100% that restore (should) work. (I also tried making a copy of /data in the original setup and copying it back in. That didn't work; the device bootlooped with the new partitions.)

So I did an 8 failed boots hard reset, and that did work - the install script was able to redo all the formatting and I wound up with what I'd wanted, a 10 gig /media and 4 gig /userdata partition.

I rerooted that and symlinked /data/media/B&N Downloads to /media/B&N Downloads and now I have complete visibility on my library and a nice refresh to the NC hardware.

I'm not happy about the magazines on the tablet - I also have an NST and I've been reading the much simpler magazine files that that device gets by sideloading for some time. The New Yorker, for instance, is a 4-5 meg file on the NST and any epub reader can view it; on the NT, it's about a 100M file, you have to read it in the NT magazine viewer, and the navigation is pretty annoying because of choices the publisher made (like not supporting article view or resizing text.) If I blow in the NST file, I can read it but it's not seen as a magazine.

I'm hoping to find a database on the device that tells it what format to request and fix it so that it's looking for the lightweight format, but I'm not there yet.
[Barnes & Noble Nook Tablet] dang69:
It looks to me as if the only thing you haven't done is remove 11 before changing 10. Follow the instructions in this thread,

http://xdaforums.com/showthread.php?t=1531120

I think you're close. those instruction will have you remove 11, modify 10 and rebuild 11.
[Barnes & Noble Nook Tablet] kbs24:
Folders gone from /mnt/internal

Last January I successfully managed to set NT up so that folders I put into /data/usrdata would show up in /mnt/internal. Worked great for 6 months. Played all my music from that folder. Then, just yesterday, upon reboot, all the folders are gone from /mnt/internal. I tried to copy & paste the folders into /internal, and they will not paste (even though for a split second it says "paste in progress". All settings, permissions, etc are exactly as they were set up back in January. The modified clrbootcount.sh is the same. Busybox is installed. Has anyone run into this problem, or have any ideas what may have happened or how to fix? Thanks.
[Barnes & Noble Nook Tablet] hwong96:
Congrats to all who figured out the rooting process on NT. The NT has a measly 1gb media partition and over generous 11gb data partition. Can more experienced developers look into gparted-live-0.10.0-3.iso and e2fsprogs-1.41.14.tar.gz to use as tools to repartition the NT? I do not have a NT yet. I have a rooted emmc CM7.1 NC oc'd to 1.225gHz. I appreciate and respect all the effort that goes into this project. I used the develop financial apps for a big US bank.
[Barnes & Noble Nook Tablet] anlog:
Looks like it won't be necessary...

http://xdaforums.com/showthread.php?t=1355969
[Barnes & Noble Nook Tablet] unsivil_audio:
Necessary no, but definitely desired.

Sent from XDA Premium app CM7.1
[Barnes & Noble Nook Tablet] rmm200:
Not even desired if storage is really not partitioned, as it now appears.
[Barnes & Noble Nook Tablet] anlog:
At best, repartitioning will give you an additional 1GB of space, and probably break the ability to ever do a factory restore or load additional updates when they are released by B&N.

I think we need to wait for an unlocked bootloader or at least an accessible CWM with bootable workaround (like on the Droids) before we start messing with the filesystem.
[Barnes & Noble Nook Tablet] hwong96:
Current configuration allows 11gb for purchased apps, movies, books, music from Amazon app store, BN app store or Google market. Only 1gb is allowed for end user loaded music, books, movies etc. If you have over one thousand song music collection (5gb) you want loaded to NT you will need to use a microSD card. You cannot load an HD movie in the 1gb media partition. The old NC partition scheme had 5gb media and 1gb data. The newer NC partition scheme (blue dot) has 1gb media and 5gb data. Most users will not utilize the 11gb for purchased apps.
[Barnes & Noble Nook Tablet] unsivil_audio:
Thank you hwong for my case in point.

Sent from XDA Premium app CM7.1
[Barnes & Noble Nook Tablet] anlog:
You can add custom search paths to some media players to scan /data/media (or whatever you want to call it). You might even be able to setup a symlink. You can also open the files (large movies, etc) directly from a file manager like Root Explorer.

I do see your point, though, how the layout is different from the NC. I'm using a 32gb memory card so I guess this isn't an issue for me.
[Barnes & Noble Nook Tablet] hwong96:
The data partition is ext4 formatted whereas the media partition is vfat formatted. When the NT is connected to a computer via USB, the vfat system is what the user sees for loading his own content. I do not think the ext4 partition shows up as a drive on the computer.
[Barnes & Noble Nook Tablet] bx19:
thread moved..

Thread moved to general section .. :)
[Barnes & Noble Nook Tablet] Slowmo310:
So, ext4 cant be used ? Can't have books and videos, etc stored in it ?
[Barnes & Noble Nook Tablet] Chowlz:
What about in a linux distribution like ubuntu? I know that windows doesn't read ext4 (unless 3rd party drivers are installed) nor the first partition (if the nook tablet is really partitioned, that is).