Problems with Linux Swap partition - G1 General

So I've been trying to partition my stock 1GB sd card with the 3 partitions required: FAT32, Ext2 (or 3), and Linux Swap, but everytime I do it, my phone says the sd card is unreadable. Why is this? To get my phone to re-recognize my sd card, I have to re-format my entire sd card to new. I am able to partition it witht the first 2 partitions, but when I add the Linux Swap, I end up with the same issue. Is there something I am doing wrong? I am making the Linux Swap partition about 32mb and leaving about 2-3mb free (unallocated). I am using Wibu Linux for Windows and GParted to do the partitioning. Please help, and thanks in advance.

You could try GParted Live...
that worked for me... Be sure to make both the FAT32 and Ext2/3 partitions PRIMARY PARTITIONS.
Also, go ahead and make the first two partitions and leave enough space for a 32MB linux-swap partition but don't create it yet. Or make the partitions one at a time to see if you problem lies w/ one of the steps.
Not completely familiar with Wubi linux, seems to be an odd build to me. Try the Gparted live distro, I think you'll be pleased with the results.
Good luck!

There is NO NEED to make a separate partition for swap. Just create an empty FILE of the size that you want and mkswap it, i.e. 'dd if=/dev/zero of=/mountpoint/swapfile count=64000; mkswap /mountpoint/swapfile' to make a 32MB swap file. Note count=64000 -- thats 64000 blocks with default block size of 512 B, 64000x512B = 32MB. Then just mount the swap as normal; 'swapon /mountpoint/swapfile'.
** There is no performance difference.
** Best to put it in your ext2 filesystem since it won't be unmounted when you want to mount the fat partition as a usbdisk.

Related

creating 2 partitions on an SD card on a Mac fat32/ext2

Hey all. I was wondering how to format/create my sdcard with 2 partitions one fat32 the other ext2 on a mac. I used the search engine but cannot find anything.
I'm not a terminal noob but I can't figure out how to format/create the 2 partitions. I need help because I want to move my data from the g1 to the sdcard.
Thanks!
Install this http://sourceforge.net/projects/ext2fsx/ and then reboot and use the Disk Utility in /Applications/Utilities/
this will not format a ext2 partition, it only allows you to mount it, your best bet is to d/l GPARTED or of you have windows in parallels use Paragon Partition Manager... this will not work if your windows is in a bootcamp partition, the other option is to use a pc (sadly hu?)
If it helps, I actually used an ubuntu live cd and installed gparted while booted to the cd... of course, i had already made the sdcard fat32 in windows but gparted allowed me to resize and format the remainder in ext2.
I've used the ext2fsx tool to partition my SD card on my mac. I don't think I had any extra software installed, and I just used the Disk Utility...
I'm also having trouble creating a valid partition. I'm using gparted on an ubuntu live cd but the sdcard doesnt like being messed with.
What disklabel are you using? [Loop / msdos / bsd etc]?
I think i've tried every combination and haven't gotten anywhere.
Also, i've read that the card class makes a difference, is this right or does it only effect the speed of data transfer?
Any help would be much appreciated!!
.//Yamthief

Fat32 partition stuck in read-only in 16GB MicroSDHC

OK so far my problem has stumped everyone.
I have a rooted and hacked G1(HTC Dream) with a 16GB MicroSDHC that is divided into a 2GB Ext2 partition and a 14GB FAT32 partition. It worked fine for a while but then my G1 started to freeze up and reboot continuously so I took the card out and it stopped. I tried chkdsk in Vista and it hung in elevated .cmd prompt and it says i have bad sectors but it cannot fix in read only mode. I tried format in Vista and cmd and it tries, says the data is RAW and that it tried to convert to FAT but cluster size too big. Then when I try fs command for vfat in .cmd it still won't work. I used Paragon Partition Manager 9.0 PAID version to create partitions but now it hangs every time it tries to read the card and it won't format. Tried sdformatter and a low level formatter to and no good.
I have Terminal in my G1 but I am not familiar with Linux commands. I tried fdisk and it says the FAT32 is in read only mode. When I type busybox df -h it won't show the "/dev/block/mmcblk0p1" but it shows the Ext2 partition. But when I type the mount command it shows up as "rw". But i cannot access it at all to wipe the stupid card out.
HELP!!!!
1) can you mount the fat32 partition in you phone and can see the files?
2) did you tried as root *mount -o rw,remount -t vfat /sdcard* ?
Yes I tried it and it doesn't work. Is there anyway to flash the bootloader or the ramdisk?
assuming i have ramdisk.img boot.img and system.img on sdcard root and I want to copy to system files, anyone know the commands in Terminal Emulator?
Download the ubuntu live cd, burn it, then boot your computer with it. Plug your SD card into an external reader, NOT the g1. Run gparted and select the sd card from the list of drives and see if you can format or re-partition your card. If it wont let you then try selecting Device->Create Partition Table, to create a new partition table. If none of that works then either your card or card reader is dead.
Mike
Nevermind, it was a class 2 16GB card...i think I broke it...getting a class 6...
need help....
i have a 16gb class 6 and i need help or technically a walk through on how to partition this card....hence i am an extreme noob. i got into parted and it says i have a 16.1 gb so would that translate to 16001 mb? reason i ask is cause i dont know what to subtract 32mb from and such? also what is the optimal set up for a card this size? thanx in advance for any help that you guys may supply me...
TeCH NiNJa said:
i have a 16gb class 6 and i need help or technically a walk through on how to partition this card....hence i am an extreme noob. i got into parted and it says i have a 16.1 gb so would that translate to 16001 mb? reason i ask is cause i dont know what to subtract 32mb from and such? also what is the optimal set up for a card this size? thanx in advance for any help that you guys may supply me...
Click to expand...
Click to collapse
do it from phone terminal its much easier, if you need any more help pm me
i got guys thanks alot....i think ill try 42mb linux-swap to see if the hero rom will run smoother. to
JJbdoggg
Senior Member
thanx

SD Partitioning from Recovery

How long should it take? I have done it a couple times before so that I could use Apps2SD and then back to a single partition to use Froyo, then back to an ext partition set up. Now, I was trying to partition back to a single FAT32 partition, but it seems like it has been doing it for a lot longer than it previously did. Is it stuck in a loop, or should I just battery pull and assume it worked?
I just checked it. It didn't partition anything. Weird. I'll try again.
joshmerd said:
I just checked it. It didn't partition anything. Weird. I'll try again.
Click to expand...
Click to collapse
If you're checking for the partition in Windows, then you're making the same mistake that I first made. Ext2 and Ext3 partitions are Linux partitions, so windows doesn't see them. If you partitioned using Amon_RA's recovery, make sure you also converted from Ext2 to Ext3. Also, make sure you did NOT convert to Ext4--Zanfur's OC Kernel does not currently support Ext4, so this won't work on any of the Eris ROMs. Hope this helps!
Some ROMS seem to require ext2 and some require ext3 apparently. Is it possible to create a softlink so the phone would see both ext2 and ext3 or is it even possible due to differences in the filesystem structure? I'm thinking along the lines of using something like "ln -s"...

Supporting alternative filesystems (ext, NTFS, others) in your external SD

Update: The SD card I'm using for this is brand new and it is showing corruption sometimes. I think that the SD card is broken but I'm not sure. While I am debugging this I will not give more details to avoid other's damage. In the meantime, if someone is interested and wants to take the risk, please PM me.
------
In summary, this is a method to mount from the PC a sd-ext formatted partition on the SD card inside the phone.
The linux kernel inside Android can potentially understand ext2/3/4, NTFS and other advanced filesystems, but you have to mount them manually to see their data within the phone. That is a hassle, but it can be solved if you are root. However, if you connect your phone to your PC with this setup the alternative filesystems in the external SD card cannot be seen from the PC.
I did not find in Internet how to solve the latter issue, but I figured it out. So here I will explain how:
see the ext4 partition within the phone <-- this is not new!!
see the ext4 partition by connecting the phone to a Linux PC <-- these are the news!!
I do not have a lot of time now to explain the steps in detail. I will update the post later, but basically:
- Using Ubuntu and gparted, I formatted my external SD card with 2 partitions: first one small (32MiB) FAT to satisfy Android and second one big (~16GiB) ext4 where my data remains. This assures that the FAT filesystem cannot grow above the 32MiB limit.
- Then, with Ubuntu and fdisk I deleted (yeah!) the partition table and created a new partition table that says that the FAT filesystem occupies the entire SD card space. This step is the important, it means that the whole card will be exported from the phone when connected to a PC (since the partition table says that there is only one big partition for the whole SD card). However, due to the small size format in the first step the FAT partition cannot grow above the 32MiB mark (where the ext4 filesystem still resides).
- With this setup you can still access the ext4 data (it will not be touched by FAT accesses!!) using mount and the loop device, both from within the phone and from a PC with Linux (if you have another OS, maybe you can use a VM with Linux).
More or less, that's all without the details. I'll update this post later with a step-by-step guide.
Thanks to share that information...
You are welcome. It is a pity that my SD card is not working properly with my phone (it works Ok in the PC). I think that it is a kernel (Froyo) problem so I planned to upgrade to Gingerbread before doing more tests. But right now I have no time...

External card as ext2?

Can I have external card mounted as ext2? I have files names not supported by fat and sync'ed with dropbox
Yes, you can but afaik there is no easy way to do this.
I formatted my sdcard to ext2 (because I wanted to put large file (image for wikipedia offline) on my sdcard).
I formatted the beginning (~30MB) of my sdcard to fat32 so that the Nook detect the sdcard and does not trigger an error and the remaining part to ext2.
Then I used a script that mount manually the ext2 partition to /sdcard on boot.
This generally works but I have sometimes a few bug in some applications, especially when I connect and disconnect my Nook to my computer...
The best solution would be to find a way so that Android can automount a ext2 partition by itself but I don't know how to do it.
Instead of using the whole card I partitioned the first 4gb as fat16 (msdos) and then set the rest to ext3. When the fat16 space runs out I'll look into making some sort of script to try to mount the second partition. At the moment with the card acts like a normal 4gb card.
is it possible to repartition the nook to be able to use the space that b&n reserves for its contents? I heard that the space for our files is just 250 mb.
user4242 said:
is it possible to repartition the nook to be able to use the space that b&n reserves for its contents? I heard that the space for our files is just 250 mb.
Click to expand...
Click to collapse
yes of course. If you're used to linux repartitioning and the dd command then it's a breeze. If you're a Windows user who've never done partitioning or disk imaging then you can easily mess up.
I'll assume the former.
It's just a case of:
boot with a noogie.img that you've written to a sdcard (root of card, not partition 1)
then plug it in
now you can see all the nook partitions like it's an external USB drive and fdisk, cfdisk, partitionmagic or whatever you want
Obviously you're gonna want to backup first because if you mess up the only way to restore would be asking one of us off this forum to break the distribution laws and send you a 2gb (or whatever it is) image.
All the details on this forum
Has someone tried editing /system/etc/vold.conf to get a ext-formated SD-Card mounted?
mali100 said:
Has someone tried editing /system/etc/vold.conf to get a ext-formated SD-Card mounted?
Click to expand...
Click to collapse
I checked, I had modified it adding a line "partition 2" in the section "volume_sdcard2" so that Android does not show the message "SD card blank or has unsupported filesystem".
But I couldn't make it mount a ext2 sdcard itself. (if you know how to do it without using another script, I'm interested)
Time to resurrect this thread.
FAT is ugly. File timestamps are in local time (whatever that means, summer? winter?).
The Nook vfat implementation has problems with caching in and out directory info on vfat
and intermittently changes all the modify timestamps by 1, 4 or 5 hours.
This can play havoc if you are trying to keep things synchronized by filetime.
I've decided to have my SD card be ext3
Our volume demon, /system/bin/vold (which is ancient) uses /system/etc/vold.conf to configure automounting.
It presumes that all volumes are vfat.
It seems from a brief look inside that it does handle ext2 and ext3 somehow.
There is also the question of getting it to automount USB drives.
The easiest solution to ext3 on the SD card is to make it non-removable.
First, delete the second section out of vold.conf that relates to the SD card.
Then edit init.rc:
Code:
mkdir /sdcard 0777 system system
...
mount ext3 /dev/block/mmcblk1p1 /sdcard nosuid nodev noatime nodiratime uid=1000,gid=1015,fmask=117,dmask=007
chown system sdcard_rw /sdcard
chmod 0770 /sdcard
If you feel like having 12 partitions on your SD card you can.
That leaves vold only handling the mounting of /media
This exists so that you can serve /media as USB Mass Storage.
You could have /media be a fixed mount by doing what you just did to the SD card.
The only hiccup there would be the Adobe Digital Editions wants to see /media as UMS.
Note: To edit init.rc, download bootutil from the signature, extract, edit and replace init.rc in uRamdisk.
Make sure that you have a backup and a recovery!
Note: All of the above changes to init.rc are wrong.
I can get it to mount in a shell, but not in init.rc
Whoops.
Oops, this thread has been forgotten.
Yes, auto-mounting ext3 SDcards has been solved.
See: http://forum.xda-developers.com/showthread.php?t=2184495

Categories

Resources