Forum

Full Version: Expanding SSD partition.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

After getting ssd's for a couple of pi3 installs (to eliminate sd card) I decided to try it on the pi2 running xbian. It still 'boots' from SD, but 'runs' from ssd. Works well, fast and hopefully less data corruption.

Trouble is, I only copied the partition across from usb stick to ssd and that leaves a lot of unallocated space.

Is there a way to expand the root partition to make use of this? The sd card expand in config doesn't work for ssd, nor can I expand it with easeus partition manager. I've seen a few web pages with differing how-tos, but don't want to mess it all up!

Anyone managed to do this and can share the secret please?
1) A fdisk -l of your ssd would help
2) You have to resize partition first. I'm preferring fdisk, so you have to remove existing partition first and then create it again. VERY IMPORTANT: This partition must start a the SAME position. After you did this, save new partition table and reboot
3) after reboot, you have to resize filesystem by running sudo btrfs filesystem resize max /
Btw, another option would be:

1) boot from (old) usb stick
2) plug ssd and make partition
3) run xbian-config copier, select previous generated ssd partition as destination
4) shutdown, remove usb stick, boot again, now from ssd

Nothing secret Big Grin
Thanks for the pointers. A lot of instructions were for pure raspbian with desktop available, not much use for my set up.

(27th Sep, 2018 02:07 AM)Nachteule Wrote: [ -> ]1) A fdisk -l of your ssd would help

Here it is Smile

Code:
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram4: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram5: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram6: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram7: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram8: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram9: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram10: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram11: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram12: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram13: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram14: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 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: 0xb3e3634e

Device         Boot    Start      End  Sectors   Size Id Type
/dev/mmcblk0p1 *        2048   141311   139264    68M  b W95 FAT32
/dev/mmcblk0p2        141312 30614527 30473216  14.5G 83 Linux
/dev/mmcblk0p3      30615552 31116287   500736 244.5M 82 Linux swap / Solaris


Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 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: 0x0999c332

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1             63 29743294 29743232 14.2G  c W95 FAT32 (LBA)
/dev/sda2       29752380 30254139   501760  245M 82 Linux swap / Solaris


Disk /dev/zram0: 128 MiB, 134217728 bytes, 32768 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
(27th Sep, 2018 02:07 AM)Nachteule Wrote: [ -> ]2) You have to resize partition first. I'm preferring fdisk, so you have to remove existing partition first and then create it again. VERY IMPORTANT: This partition must start a the SAME position. After you did this, save new partition table and reboot

OK - I saw some stuff about this but wasn't too sure it would be OK with Xbian. I'll take another look.
With Easeus Partition Manager I couldn't expand the partition at all (works for ntfs a treat though) - So I have an option to format the drive with fat32/ext2/ext3/ntfs/ - But to clone the partition from usb stick to ssd it needs an unformated partition to write to. I guess it's easy when you know, but not when you don't.
So if I get the ssd into one big unallocated state using the full size, create a partition on that (but then what about the swap partiton, how will that be affected?)....Hmmm....

(27th Sep, 2018 02:07 AM)Nachteule Wrote: [ -> ]3) after reboot, you have to resize filesystem by running sudo btrfs filesystem resize max /

Ah, yes, btrfs.... None of the tutorials I saw mentioned this, so just as well I asked here first Wink - But can't I just do that anyway? Ah, maybe not as the fs is limited to the copied size and the rest is unallocated.
I think I need to sleep on this before I do something bad. Wink

Thank you for the info, I'll let you know how it goes.....
Ah, now I know why automagically resize did not work [1]. Seems you copied data partition (sda1) AND swap partition (sda2) to from stick to usb

So, third option:

1) stop swap: sudo swapoff -a
2) remove swap parttion, fdisk is your friend
3) make sure that initramfs is active (I suppose it is) and reboot
4) partition should be automagically resized and swap created again

[1] Resize works only if partition is at the end of the partition table
(27th Sep, 2018 03:33 AM)Nachteule Wrote: [ -> ]So, third option:

1) stop swap: sudo swapoff -a
2) remove swap parttion, fdisk is your friend
3) make sure that initramfs is active (I suppose it is) and reboot
4) partition should be automagically resized and swap created again

[1] Resize works only if partition is at the end of the partition table

Tried this and it didn't work, but after a little more head scratching I realised that I have to hit 'w' to exit fdisk and only then are the changes made.

After that it was easy and now I have......

Code:
Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 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: 0x0999c332

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1              63 233938030 233937968 111.6G  c W95 FAT32 (LBA)
/dev/sda2       233938944 234441647    502704 245.5M 82 Linux swap / Solaris

So it worked! - Thank you soooo much! Smile Smile Smile

(Another pint of your favourite beverage is added to my list!) Wink
(27th Sep, 2018 06:42 AM)Skywatch Wrote: [ -> ]Tried this and it didn't work, but after a little more head scratching I realised that I have to hit 'w' to exit fdisk and only then are the changes made.

Yep, that you have to do Tongue

Quote:After that it was easy and now I have......

Code:
Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 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: 0x0999c332

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1              63 233938030 233937968 111.6G  c W95 FAT32 (LBA)
/dev/sda2       233938944 234441647    502704 245.5M 82 Linux swap / Solaris

So it worked! - Thank you soooo much! Smile Smile Smile

(Another pint of your favourite beverage is added to my list!) Wink

I did not expect anything else Cool
Reference URL's