I have 9 partitions of which one is unallocated and i want to merge this unallocated partion to sdb11 partition on which my ubuntu is installed?
-
4There is no such thing as "unalolcated partition". You have 8 partitions. – Pilot6 Feb 10 '20 at 11:57
-
2Make sure you have good backups of everything what ever you do. But moving all those partitions has more risk. Better to use as a /home or /data partition. If /home. To move /home uses rsync- Be sure to use parameters to preserve ownership & permissions https://help.ubuntu.com/community/Partitioning/Home/Moving Shows on second drive, but can be same drive: https://askubuntu.com/questions/1013677/storing-data-on-second-hdd-mounting – oldfred Feb 10 '20 at 14:28
-
@K7AAY if you delete sdb10, and recreate it later, remember that you'll have to edit /etc/fstab :-) – heynnema Feb 10 '20 at 23:31
-
1Of course, if you just want to use that additional space, you don't have to move anything. Make a partition, put an ext4 filesystem on it, and mount it in some place you want, like /var/local/data or /home/
/mydata, etc. Use symlinks to the new mount point, like Documents2 from your home. – ubfan1 Feb 10 '20 at 23:38 -
The simplest way requires them adjacent, but there are partitions between. sdb11 is locked, which means you booted from this drive, and you can't change partitions on a drive you booted from. so you must boot from a LiveUSB or other drive to make changes you want. After reboot, you'd need to move sdb7 to the front of the drive & accept the change; move sdb8 to the front of the drive & accept the change; move sdb9 to the front of the drive & accept the change; delete sdb10 after swapoff before doing anything to sdb11, then, either make a new swap partition or swap file; ubfan1's idea is better. – K7AAY Feb 11 '20 at 00:13
-
Status please... – heynnema Feb 18 '20 at 15:14
-
Status please... – heynnema Feb 24 '20 at 00:42
-
Status please... – heynnema Mar 04 '20 at 21:09
1 Answers
Make sure that you have a good backup of your important files, as this procedure can corrupt or lose data.
The NTFS part...
I'm not a Windows guy per se, so I don't know if the Windows Disk Management app can move disk partitions, but if it can, use it to move /dev/sdb7 and /dev/sdb8 partitions all the way left.
The Ubuntu part...
Keep these things in mind:
always start the entire procedure with issuing a
swapoffon any mounted swap partitions, and end the entire procedure with issuing aswaponon that same swap partitiona move is done by pointing the mouse pointer at the center of a partition and dragging it left/right with the hand cursor
a resize is done by dragging the left/right side of a partition to the left/right with the directional arrow cursor
if any partition can't be moved/resized graphically, you may have to manually enter the specific required numeric data (don't do this unless I instruct you to)
you begin any move/resize by right-clicking on the partition in the lower pane of the main window, and selecting the desired action from the popup menu, then finishing that action in the new move/resize window
Note: I'll write this portion as if you couldn't move /dev/sdb7 and /dev/sdb8 using Windows Disk Management app.
Note: if the procedure doesn't work exactly as I outline, STOP immediately and DO NOT continue.
- boot to a Ubuntu Live DVD/USB
- start
gparted - move /dev/sdb7 partition all the way left
- move /dev/sdb8 partition all the way left
- move /dev/sdb9, /dev/sdb10, and /dev/sdb11 partitions all the way left
- resize the right side of /dev/sdb11 all the way right
- click the Apply icon
- quit
gparted - reboot
- If you have any Ubuntu boot issues, contact me and I'll give you a fix
- 68,647
- 15
- 124
- 180
-
-
@Pilot6 Why? Inquiring minds want to know :-) The UUID stays the same. I've moved many Ubuntu / partitions and I've never had to reinstall GRUB. If required, what's the best command to do that? `sudo grub-install /dev/sdb`? – heynnema Feb 10 '20 at 18:04
-
If you move the "left-hand side" of `/` partition, grub won't find it on boot. Something like that is needed. `chroot` to the system and at least `update-grub`. – Pilot6 Feb 10 '20 at 18:07
-
Grub uses UUID, UUID will not be changed when moving a partition, so Grub should still work. – mook765 Feb 10 '20 at 18:07
-
@Pilot6 Moving the /dev/sdb11 partition, and resizing the right side keeps the left side intact. That's why I do it in that order. – heynnema Feb 10 '20 at 18:08
-
In this case I don't see a way without moving the left side of sda11. Either you add space there, or move the whole partition. – Pilot6 Feb 10 '20 at 18:10
-
-
When you move the whole partition. the left side of it moves too. grub looks for a specific sector on disk. – Pilot6 Feb 10 '20 at 18:12
-
-
-
@Pilot6 Does my `sudo grub-install /dev/sdb` command look correct without chroot? – heynnema Feb 10 '20 at 18:20
-
-
@Pilot6 I just did `cat /boot/grub/grub.cfg` and I didn't notice anything about sectors. Maybe I missed it. Can you find the specific line in your grub.cfg? – heynnema Feb 10 '20 at 18:25
-
It is not in `grub.cfg`. This is all about where to look for `grub.cfg` )) – Pilot6 Feb 10 '20 at 18:26
-
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/104272/discussion-between-heynnema-and-pilot6). – heynnema Feb 10 '20 at 18:28
-
I believe it depends on whether grub is using blocklists or not. Block lists are hard coded. It may also depend if UEFI or BIOS boot. – oldfred Feb 10 '20 at 20:45