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
- Put 32GB card without any data you care about into your device and unmount it, as root entering
umount /media/mmc1/
- 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
- 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.
- 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.
- 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
- Mount the Easy Debian image file:
mount -o loop /home/user/MyDocs/debian-m5-estel.img.ext3 /.debian
- Copy the Easy Debian image to a directory in the second partition on the SD:
mkdir /mnt/debian cp -a /.debian/* /mnt/debian
- Unmount the Easy Debian image:
umount /.debian
- Modify /home/user/.chroot, to make it point to new location, in the relevant position:
IMGFILE=none CHROOT=/mnt/debian
- 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
- Check whether Easy Debian works, then unmount it with the icon.
- If you want, delete the Easy Debian image file:
rm /home/user/MyDocs/debian-m5-estel.img.ext3
- Backup MyDocs to mmc1:
cp -a /home/user/MyDocs /media/mmc1
- Unmount MyDocs:
umount /home/user/MyDocs/
- 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.
- Create a file /etc/default/mount-opts-overwrite containing the line
genfstab="0"
- Edit /etc/fstab, changing the line
/dev/mmcblk0p2 /home ext3 defaults 0 2
to/dev/mmcblk1p2 /home ext4 defaults 0 0
reboot
If you've done something wrong, this is where it all comes tumbling down with an infinite reboot loop.- 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
- Get Easy Debian pointing in the right direction by editing /home/user/.chroot to change the line
CHROOT=/mnt/debian
toCHROOT=/home/debian
- In Easy Debian chroot shell, type
cfdisk /dev/mmcblk0
- 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.49MBmmcblk0p2
for home. I then deleted themmcblk0p4
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. - 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
- Mount the future /home.
mount /dev/mmcblk0p2 /mnt
- Restore your home backup:
cp -a /home/* /mnt
- Unmount /home to be
umount /mnt
- Mount MyDocs to be:
mount /dev/mmcblk0p1 /mnt
- Restore MyDocs:
cp -a /media/mmc1/* /mnt
- If, like me, you've gone for an ext4 home, edit line 98 of /etc/event.d/rcS-late, changing
ext3
toext4
- Delete the file stopping maemo for looking for eMMC partitions:
rm /etc/default/mount-opts-overwrite
- Cross your fingers and
reboot
- This page was last modified on 27 July 2014, at 17:23.
- This page has been accessed 11,346 times.