User talk:Tomj

This is very much a work in progress, not finished. I don't think following the instructions exactly will break anything, but going off-piste can quite easily.

Contents

[edit] Repartioning n900 for directory Easy Debian on entirely on device

Software I needed installed on the device: Kernel Power 52, CSSU-thumb, rootsh, a text editor (I like TxPad), Easy Debian (I use Estel's image assumed initially to be installed on MyDocs).

Unless otherwise specified, all commands is entered in maemo's terminal as root. When modifying filename, I tend to make 2 copies, filename.old and filename.new, edit filename.new and, when I'm happy with it, copy it over filename. This may be overkill, but it makes me happy...


[edit] Prepare backup

  1. Put 32GB card without any data you care about into your device and unmount it, as root entering umount /media/mmc1/
  2. Start by using cfdisk to format the SD; it's easier than calculaing needed for sfdisk. I velieve there a version in Extras-devel, but why bother with that when there's one in Easy Debian. In the Easy Debian chroot shell, type cfdisk mmcblk1
  3. If you can't see the filetable, quit cfdisk, tap the fullscreen icon in the bottom of the xterm window and/or shrink the terminal font size using the volume keys and fire cfdisk up again.
  4. Use cfdisk to set up 2 partitions. I created a small one at the start of the available space to reserve the name mmcblk1p1, then a 5120MB one at the end, then deleted the one at the beginning and recreated it using all the remaining available space. Make sure you remember to write the new patritions, then quit cfdisk and unmount Easy Debian using the icon.
  5. In maemo's xterm as root, format your partitions, then mount them
    mkfs.vfat /dev/mmcblk1/p1
    mkfs.ext4 /dev/mmcblk1p2
    mount /dev/mmcblk1p1 /media/mmc1
    mount -t ext4 /dev/mmcblk1p2 /mnt
  6. Mount the Easy Debian image file: mount -o loop /home/user/MyDocs/debian-m5-estel.img.ext3 /.debian
  7. Copy the Easy Debian image to a directory in the second partition on the SD:
    mkdir /mnt/debian
    cp -a /.debian/* /mnt/debian
  8. Unmount the Easy Debian image: umount /.debian
  9. Modify /home/user/.chroot, to make it point to new location, in the relevant position:
    IMGFILE=none
    CHROOT=/mnt/debian
  10. Edit /sbin/closechroot changing the line
    #Abort if chroot not mounted
    if [ ! -f "$CHROOT/var/lock/qmount-complete" ] ; then

    to

    #Abort if chroot not mounted
    if [ "$IMGFILE" != "none" ] && [ ! -f "$CHROOT/var/lock/qmount-complete" ] ; then
  11. Check whether Easy Debian works, then unmount it with the icon.
  12. If you want, delete the Easy Debian image file: rm /home/user/MyDocs/debian-m5-estel.img.ext3
  13. Backup MyDocs to mmc1: cp -a /home/user/MyDocs /media/mmc1
  14. Unmount MyDocs: umount /home/user/MyDocs/
  15. Backup /home to the second partition on the SD: cp -a /home/* /mnt

[edit] Repartition time

I took the gist of this from Repartitioning_the_flash, but at some point CSSU in the thumb and/or testing branches changed it's startup and no longer uses /usr/lib/genfstab.awk. This is based on the latest thumb CSSU, so if you are using a setup from before this change, things may be different.

  1. Create a file /etc/default/mount-opts-overwrite containing the line genfstab="0"
  2. Edit /etc/fstab, changing the line
    /dev/mmcblk0p2 /home ext3 defaults 0 2
    to
    /dev/mmcblk1p2 /home ext4 defaults 0 0
  3. reboot If you've done something wrong, this is where it all comes tumbling down with an infinite reboot loop.
  4. Assuming you've booted successfully, you may as well unmount MyDocs; I'm not sure if it's necessary, but why not? umount /home/user/MyDocs
  5. Get Easy Debian pointing in the right direction by editing /home/user/.chroot to change the line CHROOT=/mnt/debian to CHROOT=/home/debian
  6. In Easy Debian chroot shell, type cfdisk /dev/mmcblk0
  7. There is some unformatted memory at the start of the eMMC; I don't know if it's important, but to preserve it, I started by making a new partiton of it, to be deleted before writing the new setup. I then set up a 25923.23MB mmcblk0p1 setting type to 0C (FAT32 (LBA)) for MyDocs and a 5219.49MB mmcblk0p2 for home. I then deleted the mmcblk0p4 I'd set up to protect the unformatted space at the start and select Write to repartition the eMMC. You may, of course, chose partition sizes to suit yourself. When done, unmount with the Close Debian icon.
  8. Part of my aim was to have home as ext4, so back in the maemo root shell: mkfs.ext4 /dev/mmcblk0p2

[edit] Restoring the system to eMMC

  1. Mount the future /home. mount /dev/mmcblk0p2 /mnt
  2. Restore your home backup: cp -a /home/* /mnt
  3. Unmount /home to be umount /mnt
  4. Mount MyDocs to be: mount /dev/mmcblk0p1 /mnt
  5. Restore MyDocs: cp -a /media/mmc1/* /mnt
  6. If, like me, you've gone for an ext4 home, edit line 98 of /etc/event.d/rcS-late, changing ext3 to ext4
  7. Delete the file stopping maemo for looking for eMMC partitions: rm /etc/default/mount-opts-overwrite
  8. Cross your fingers and reboot