Here is the manual way via command line:
1 - boot up with new partition
2 - ssh to Openframe
3 - sudo nano /etc/fstab
4 - make it look like this:
Code: Select all
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# tmpfs /tmp tmpfs noatime,size=192M 0 0
# tmpfs /var/cache/apt tmpfs noatime,size=256M 0 0
# tmpfs /var/lib/apt/lists tmpfs noatime,size=256M 0 0
# tmpfs /var/log tmpfs noatime,size=16M 0 0
UUID=ba8a6400-7af1-11ed-84b1-02ba0049c120 / ext2 errors=remount-ro,noatime 0 0
LABEL=BOOTBA8A /boot vfat defaults 0 0
5 - reboot
6 - ssh to your Openframe2
7 - check the set up and type
df -h
Code: Select all
root@openframe:/home/of# df -h
Filesystem Size Used Avail Use% Mounted on
udev 243M 0 243M 0% /dev
tmpfs 50M 2.1M 48M 5% /run
/dev/mmcblk2p2 923M 810M 67M 93% /
tmpfs 246M 0 246M 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
/dev/mmcblk2p1 41M 14M 28M 34% /boot
tmpfs 50M 0 50M 0% /run/user/1000
8 - then type
fdisk -l
All we care about looking is this part:
Code: Select all
Disk /dev/mmcblk2: 1.91 GiB, 2055208960 bytes, 4014080 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
Disklabel type: dos
Disk identifier: 0xda94f4ca
Device Boot Start End Sectors Size Id Type
/dev/mmcblk2p1 * 1 83984 83984 41M e W95 FAT16 (LBA)
/dev/mmcblk2p2 83985 2006111 1922127 938.5M 83 Linux
root@openframe:/home/of#
Note the size of the mmcblk2 partition and what the OS is actually using above.
9 - try to unmount the partition and you will see that you cannot.
type umount /
Code: Select all
root@openframe:/home/of# umount /
umount: /: target is busy.
10 -
All what needs to be done is take a note of a starting sector of a current partition, which in our case is 83985. Remove the partition and recreate a new, larger partition starting from sector 83985 . For this we are simply going to use fdisk command. Let’s start by printing again our current partition table:
11 - next you want to look at the partition to make sure you have your starting sector mentioned above correct.
Code: Select all
root@openframe:/home/of# fdisk /dev/mmcblk2
Welcome to fdisk (util-linux 2.36.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/mmcblk2: 1.91 GiB, 2055208960 bytes, 4014080 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
Disklabel type: dos
Disk identifier: 0xda94f4ca
Device Boot Start End Sectors Size Id Type
/dev/mmcblk2p1 * 1 83984 83984 41M e W95 FAT16 (LBA)
/dev/mmcblk2p2 83985 2006111 1922127 938.5M 83 Linux
Once again please take a note of the starting sector 83985. Still in fdisk‘s interactive mode remove partition.
NOTE: if you mess this up then start all over again writing the OS back to the Openframe2 with the USB stick and rebooting again and SSHing again to the Openframe.
12.
Code: Select all
Device Boot Start End Sectors Size Id Type
/dev/mmcblk2p1 * 1 83984 83984 41M e W95 FAT16 (LBA)
/dev/mmcblk2p2 83985 2006111 1922127 938.5M 83 Linux
Command (m for help): d
Partition number (1,2, default 2): 2
Partition 2 has been deleted.
Command (m for help):
13.
Next, create a new partition right on the top of the previous and ensure that you use same starting sector:
Code: Select all
Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (83985-4014079, default 86016): 83985
Last sector, +/-sectors or +/-size{K,M,G,T,P} (83985-4014079, default 4014079):
Created a new partition 2 of type 'Linux' and of size 1.9 GiB.
Partition #2 contains a ext2 signature.
Do you want to remove the signature? [Y]es/[N]o: No
Command (m for help):
14.
print new partition table
Code: Select all
Command (m for help): p
Disk /dev/mmcblk2: 1.91 GiB, 2055208960 bytes, 4014080 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
Disklabel type: dos
Disk identifier: 0xda94f4ca
Device Boot Start End Sectors Size Id Type
/dev/mmcblk2p1 * 1 83984 83984 41M e W95 FAT16 (LBA)
/dev/mmcblk2p2 83985 4014079 3930095 1.9G 83 Linux
Command (m for help):
15. Confirm all new details and write new partition table:
Code: Select all
Command (m for help): w
The partition table has been altered.
Syncing disks.
root@openframe:/home/of#
16. At this point the system needs to be rebooted in order to remount our root partition with a new size. Force fsck on next reboot to ensure that the partition is checked before it is mounted. To do so just create an empty file called forcefsck in the root of your / partition:
touch /forcefsck
17. reboot
18. The Openframe2 is sitting in the master bedroom one floor up so went to check it and it has booted to Squeezeplayer. SSHing to the Openframe see this:
Code: Select all
root@openframe:/home/of# df -h
Filesystem Size Used Avail Use% Mounted on
udev 243M 0 243M 0% /dev
tmpfs 50M 2.1M 48M 5% /run
/dev/mmcblk2p2 923M 810M 67M 93% /
tmpfs 246M 0 246M 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
/dev/mmcblk2p1 41M 14M 28M 34% /boot
tmpfs 50M 0 50M 0% /run/user/1000
Note here that it still shows second partition at 923 M
Then I type:
Code: Select all
fdisk -l
Disk /dev/mmcblk2: 1.91 GiB, 2055208960 bytes, 4014080 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
Disklabel type: dos
Disk identifier: 0xda94f4ca
Device Boot Start End Sectors Size Id Type
/dev/mmcblk2p1 * 1 83984 83984 41M e W95 FAT16 (LBA)
/dev/mmcblk2p2 83985 4014079 3930095 1.9G 83 Linux
root@openframe:/home/of#
fsck doesn't ever run on boot. Other option is to install it to grub. Here booted with my USB stick to Squeezeplayer and then ran fsck on unmounted partition.
NOW I see the error when I do this running fsck...it shows the following when running fsck on that new expanded partition...
Code: Select all
fsck /dev/mmcblk2
fsck from util-linux 2.36.1
e2fsck 1.46.2 (28-Feb-2021)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/mmcblk2
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
Found a dos partition table in /dev/mmcblk2
So expanding the partition with a boot Ubuntu USB stick works fine. Not so with command line.