Expanding SSD partition.
|
26th Sep, 2018, 11:42 PM
Post: #1
|
|||
|
|||
Expanding SSD partition.
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? |
|||
27th Sep, 2018, 02:07 AM
Post: #2
|
|||
|
|||
RE: Expanding SSD partition.
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 / |
|||
27th Sep, 2018, 03:05 AM
Post: #3
|
|||
|
|||
RE: Expanding SSD partition.
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 |
|||
27th Sep, 2018, 03:23 AM
Post: #4
|
|||
|
|||
RE: Expanding SSD partition.
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 Code: Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors (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 - 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. Thank you for the info, I'll let you know how it goes..... |
|||
27th Sep, 2018, 03:33 AM
(This post was last modified: 27th Sep, 2018 03:37 AM by Nachteule.)
Post: #5
|
|||
|
|||
RE: Expanding SSD partition.
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, 06:42 AM
Post: #6
|
|||
|
|||
RE: Expanding SSD partition.
(27th Sep, 2018 03:33 AM)Nachteule Wrote: So, third option: 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 So it worked! - Thank you soooo much! (Another pint of your favourite beverage is added to my list!) |
|||
27th Sep, 2018, 07:04 AM
Post: #7
|
|||
|
|||
RE: Expanding SSD partition.
(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 Quote:After that it was easy and now I have...... I did not expect anything else |
|||
« Next Oldest | Next Newest »
|
Possibly Related Threads... | |||||
Thread: | Author | Replies | Views: | Last Post | |
partition usb to boot from and store movies on other partition, possible?? | Pete Garza | 10 | 24,670 |
10th Feb, 2015 08:07 PM Last Post: rikardo1979 |