WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Expanding /mnt/mmcblk0p1  (Read 5113 times)

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Expanding /mnt/mmcblk0p1
« on: October 29, 2014, 10:14:30 AM »
Hi Forum.

While i am working on a script, to choose between; say 2-3 different kernel's and /tce -dir's, i found that copying files in and out from the VFAT mmcblk0p1 partition, is somehow problematic, due to timestamp's, owner of the mounted partition, and so on...

So, i figured out, that having a bigger mmcblk0p1, was the easiest method for me.

I did left some space, after i expanded the mmcblk0p2 partition, when i flashed the piCore.img, a while back. In that space i created mmcblk0p3/EXT4, and copyed the hole mmcblk0p1 (boot, kernel, initrd, config etc... etc..) over, just for having a backup on card, if i messed something up.

I now need to expand my mmcblk0p1 partition, and i am i doubt if it's possible at all ?
Ofcause, i will have to accept a slight smaller mmcblk0p2 partition, but there are plenty of place allready, so no problem :)

My partitions is as this ::

Quote
Disk /dev/mmcblk0: 4008 MB, 4008706048 bytes
4 heads, 16 sectors/track, 122336 cylinders
Units = cylinders of 64 * 512 = 32768 bytes

        Device Boot      Start         End      Blocks  Id System
/dev/mmcblk0p1              33         704       21504   6 FAT16
/dev/mmcblk0p2             705       92258     2929728  83 Linux
/dev/mmcblk0p3           92259      122336      962496  83 Linux


Hoping, i can get some hint's howto do this ?

Regards;
   Jesper.


Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Expanding /mnt/mmcblk0p1
« Reply #1 on: October 29, 2014, 10:37:02 AM »
It is easy.

- backup content of /mnt/mmcblk0p1
- delete all partitions
- create a new VFAT partition starting at the same sector as deleted 1st partition started in any size
- format this partition (/dev/mmcblk0p1)
- copy files you saved in first step

You are ready, you have a bootable piCore system. Do whatever you want with the remainaing part of the SD card. Create additional partition to hold /tce, swap or to play with funny file systems like xfs, btrfs, ...

What is important do not touch sectors below the starting sector of first partition, it is used by the system.
« Last Edit: October 29, 2014, 10:38:39 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Expanding /mnt/mmcblk0p1
« Reply #2 on: October 29, 2014, 10:57:38 AM »
Hi... Thx...

Quote
- backup content of /mnt/mmcblk0p1
- delete all partitions
- create a new VFAT partition starting at the same sector as deleted 1st partition started in any size
- format this partition (/dev/mmcblk0p1)
- copy files you saved in first step

But problem is, that i need my hole setup, on mmcblk0p2 (special homemade tcz's, scripts in home/tc, opt/bootlocal /mnt/mmcblk0p2/tce/onboot... also persistance /etc/fstab, etc... etc...)
Sure, i could write it all up, and make copys... but i was hoping for a easier way ??

Regards;
   Jesper.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Expanding /mnt/mmcblk0p1
« Reply #3 on: October 29, 2014, 11:36:33 AM »
Even if there is a method to shrink partition with data the first step is to make backup which means copying the whole content. In such case you do the repartitioning. We are not talking about terabytes. Take an USB stick.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Expanding /mnt/mmcblk0p1
« Reply #4 on: October 29, 2014, 11:38:22 AM »
Well, you can play with dd offset values dd'ng the second partition to file and restoring to different place, etc. Good practice to learn how storage is partitioned, meaning if figures, etc. And how to recover lost data.

:)
« Last Edit: October 29, 2014, 11:39:56 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Expanding /mnt/mmcblk0p1
« Reply #5 on: October 29, 2014, 12:14:35 PM »
:)

Cool.. I will try to make it somehow!

What about mydata.gz, isent that backup of what needed ??

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Expanding /mnt/mmcblk0p1
« Reply #6 on: October 30, 2014, 09:20:33 AM »
Hi...

I now have created this 'beta' script, which switch between two kernel's, cmdline, config.txt, initrd and set tce=mmcblk0p2/tce-b visa versa /tce

I tried booting, as this, resulting in "ofcause" no ethernet, as openssh, was not "loaded" at boot.

I then copyed openssh + openssl onto mmcblk0p2/tce-b/optional, and put in the line in onboot.lst : openssh.tcz
But still no ethernet  ::)

What am i missing here ?

Regards;
   Jesper.


Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Expanding /mnt/mmcblk0p1
« Reply #7 on: October 30, 2014, 10:22:08 AM »
Is openssh started in bootlocal.sh?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Expanding /mnt/mmcblk0p1
« Reply #8 on: October 30, 2014, 12:31:45 PM »
Hi...

Yes now it is..

Did an extract of my MYDATA.TGZ, kernel B boots now, and i can login via ssh now :)

But i am fighting some permissions, giving me no access to home/tc ;-)

Will look at it tomorrow...

Good evening

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Expanding /mnt/mmcblk0p1
« Reply #9 on: October 30, 2014, 12:58:29 PM »
Bela'

Btw: do you have an default mydata.tgz, you use for the images ??

Regards;
   Jesper

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Expanding /mnt/mmcblk0p1
« Reply #10 on: October 30, 2014, 01:21:08 PM »
Download and check :) For SSH yes.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Expanding /mnt/mmcblk0p1
« Reply #11 on: October 30, 2014, 02:54:04 PM »
 :)

Sry... Lost it i guess...

Download and check ?..

Regards;
   jesper.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Expanding /mnt/mmcblk0p1
« Reply #12 on: October 30, 2014, 11:07:38 PM »
Download the piCore distribution SD card images and check mydata.gz
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Expanding /mnt/mmcblk0p1
« Reply #13 on: October 31, 2014, 03:21:13 AM »
Ahh... Okay

Offline lykkedk

  • Full Member
  • ***
  • Posts: 182
Re: Expanding /mnt/mmcblk0p1
« Reply #14 on: October 31, 2014, 10:11:47 AM »
 :)

Soo...!

While trying, i need a tcz, for creating vfat (mkfs.vfat) -Having hard time finding that ?

does it excist ?

Regards;
   Jesper.