This shows you the differences between two versions of the page.
— |
multi_partitions [2016/06/14 16:35] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Add new partitions to the original microSD ===== | ||
+ | This article explains how to modify the original partition table for the FoxBox G25, and it can be particularly useful to phisically separate data increasing their safety. | ||
+ | :!: Please implement this solution on a new microSD, keeping the original one as a backup if something goes wrong. | ||
+ | |||
+ | === 1) Create partitions === | ||
+ | In this step you will need to follow the same procedure used to restore the internal microSD (available [[restore_g25|here]]). | ||
+ | \\ Obviously, you will have to modify the structure defined in GParted. As an example we will use: | ||
+ | ^ Label ^ Filesystem ^ Dimension (MB) ^ Type ^ | ||
+ | | kernel | Fat16 | 32 | Primary | | ||
+ | | rootfs | ext4 | 1700 | Primary | | ||
+ | | data | ext4 | 1500 | Extended | | ||
+ | | data1 | ext4 | 500 | Logic | | ||
+ | | data2 | ext4 | 500 | Logic | | ||
+ | | data3 | ext4 | 500 | Logic | | ||
+ | | swap | linux-swap | Unused space | Primary | | ||
+ | :id1: Note that the //data// partition has now become Extended, and inside of it we have three //dataN// Logic ones. | ||
+ | |||
+ | |||
+ | Moreover you will have to edit the script //restoreVerC.sh//, editing the line shown below: | ||
+ | <code> | ||
+ | Original: sudo tar xvjpSf ./dataXYZ.tar.bz2 -C /media/data | ||
+ | Modified: sudo tar xvjpSf ./dataXYZ.tar.bz2 -C /media/data1 | ||
+ | </code> | ||
+ | |||
+ | === 2) Modify fstab === | ||
+ | Before booting the system, you also have to modify the file// /etc/fstab //as shown below: | ||
+ | <code> | ||
+ | Original: /dev/mmcblk0p3 /media/data ext4 noatime 0 1 | ||
+ | Modified: /dev/mmcblk0p3 /media/data ext4 noatime,sync 0 0 | ||
+ | </code> | ||
+ | This will avoid problems during the boot phase, when the automatic filesystem check will parse the Extended partition. | ||
+ | |||
+ | === 3) Mount new partitions === | ||
+ | As for every other Linux system, once the system is working you can mount each new partition with these commands: | ||
+ | <code> | ||
+ | mkdir /mnt/data1 | ||
+ | mkdir /mnt/data2 | ||
+ | mkdir /mnt/data3 | ||
+ | mount /dev/mmcblk0p5 /mnt/data1 | ||
+ | mount /dev/mmcblk0p6 /mnt/data2 | ||
+ | mount /dev/mmcblk0p7 /mnt/data3 | ||
+ | </code> | ||
+ | Now the device will see all the partitions defined before, and you will be able to work over them as usual. | ||
+ | |||
+ | :id1: Add the new partitions to the //fstab// in order to automatically mount them during the boot phase. |