1

Case scenario (a SD Card with three partitons: a boot partition, and two Linux-type partitions) :

$ sudo fdisk -l

Disk /dev/mmcblk0: 61.9 GB, 61924704256 bytes
4 heads, 16 sectors/track, 1889792 cylinders, total 120946688 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000697c0

        Device Boot      Start         End       Blocks   Id  System
/dev/mmcblk0p1               1      125000        62500    c  W95 FAT32 (LBA)
/dev/mmcblk0p2          133120    62945279     31406080   83  Linux
/dev/mmcblk0p3        62945279   120946687    28410843+   83  Linux

The usual place for Ubuntu and Kali seems to be /dev/mmcblk0p2, for what I have tested until now (the .img image file creates the system root there).

Is it possible to install some Linux distribution on /dev/mmcblk0p3 or move it from /dev/mmcblk0p2 after installed?

Generic any-Linux answers are preferred. If not possible, I would go for Ubuntu, as it is a very popular distro.

Additional points:

  • This is the official tutorial for system partition moving on Ubuntu (desktop version). But I think it could not be the proper one. For example: there is no need GRUB for RaspBerry, as long as I know.

2 Answers2

1

Is it possible to install some Linux distribution on /dev/mmcblk0p3

Yes.

or move it from /dev/mmcblk0p2 after installed?

Yes; your primary concern is the content of /etc/fstab. After you move the partition, check that file for references to the partition you moved from, and update them; e.g. /dev/mmcblk0p2 -> /dev/mmcblk0p3.

If you do not know how to actually move/copy the contents of a partition, it is identical to the process described here for creating a backup, since the purpose of the backup is to be used as a drop-in replacement for the original filesystem.

goldilocks
  • 56,430
  • 17
  • 109
  • 217
0

So this is the 3rd time (1st, 2nd) you have asked this question. It's a bit better this time but clearly you are not asking specific enough questions.

  1. install kali on an sdcard or mount an img of it on loopback (use dd, or mount)
  2. copy the files to a computer (use cp, rsync, dd, or the like)
  3. do the same with Ubuntu
  4. make a fresh partition table on the sdcard with 3 partitions with the correct flags and file systems (use fdisk, parted, or the like)
  5. copy the files back to the card but only copy boot from Ubuntu and copy each boot to there respective /opt/boot/ubuntu/ folders. you may have to edit /etc/fstab for kali
  6. re-read the answers to your other 2 questions to select what to boot.

if you copy the files use rsync -a or the like to preserve file flags, if you copy whole partitions using dd do it from loopback or otherwise make sure they have not been expanded to the whole card. A bootable img is a dd copy of the whole partition table / disk.

user1133275
  • 2,167
  • 12
  • 30
  • Thanks for answering. If this question has been asked three times, I think I must delete the others two questions. I have reviewed all my questions on this forum, and I am not able to find them. Could you please refer them with a (two) link? – Sopalajo de Arrierez Aug 02 '15 at 11:36