0

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?partition image link

Pilot6
  • 88,764
  • 91
  • 205
  • 313
nitish
  • 1
  • 4
    There is no such thing as "unalolcated partition". You have 8 partitions. – Pilot6 Feb 10 '20 at 11:57
  • 2
    Make 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
  • 1
    Of 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 Answers1

0

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 swapoff on any mounted swap partitions, and end the entire procedure with issuing a swapon on that same swap partition

  • a 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
heynnema
  • 68,647
  • 15
  • 124
  • 180
  • Moving Ubuntu `/` will require reinstall grub. – Pilot6 Feb 10 '20 at 17:59
  • @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
  • @Pilot6 I MOVE the whole partition, and RESIZE to the right. – heynnema Feb 10 '20 at 18:11
  • 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 I'm not aware that GRUB looks for sectors. Are you sure? – heynnema Feb 10 '20 at 18:17
  • I shot this way into my foot a couple of times. ;-) I am quite sure. – Pilot6 Feb 10 '20 at 18:18
  • @Pilot6 Does my `sudo grub-install /dev/sdb` command look correct without chroot? – heynnema Feb 10 '20 at 18:20
  • It doesn't make sense from Live without chroot. – Pilot6 Feb 10 '20 at 18:21
  • @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