View Single Post
Posts: 2,102 | Thanked: 1,937 times | Joined on Sep 2008 @ Berlin, Germany
#7
Having 2,3 or 4 swap partitions on the sdcard does alter the procedure slightly, but since you asked for a setup with two partitions, i wrote that up!

fdisk is NOT sfdisk, they handle things differently.
fdisk is part of busybox-power package that i have installed manually.

These could be the commands to use built-in sfdisk to change the partition table to contain two swap partitions and one data partition.
To get the rights:
Code:
sudo gainroot
These 5 lines are one command to create the text file 'table.txt'. Better copy and paste it to prevent any typos.
Code:
echo "unit: sectors
> /dev/mmcblk1p1 : start= 64, size= 59383744, Id=c
> /dev/mmcblk1p2 : start= 59383808, size= 1572864, Id=82
> /dev/mmcblk1p3 : start= 60956672, size= 1572864, Id=82
> /dev/mmcblk1p4 : start= 0, size= 0, Id= 0" > table.txt
To dump the content of the file to the partition table with sfdisk
Code:
sfdisk --no-reread /dev/mmcblk1 < table.txt
If no errors are reported, reboot the device to apply file systems to the newly created partitions. The labels (-L blablabla) or names (-n blablabla) of the partitions might only serve as suggestion, change to your liking, please.
Code:
mkfs.vfat -n sdcard1 /dev/mmcblk1p1
mkswap -L swap1_sdcard /dev/mmcblk1p2
mkswap -L swap2_sdcard /dev/mmcblk1p3
Better reboot again to make use of the swap partitions.
 

The Following 7 Users Say Thank You to michaaa62 For This Useful Post: