8

How avoid reformatting others swap partitions?
I have a lot of distro in my hard drive:

  • Windows10
  • Ubuntu16.10
  • Antergos[ Arch Linux]
  • Fedora25
  • free space
  • Data

All Linux distros have swap partitions (16GiB each one).
In the free space first I created a swap partition of 16 GiB and the rest of size is for root partition(ext4).

  • /dev/sda13
  • /dev/sda14 enter image description here

enter image description here

It is odd that we can't select the swap partitions, anyway click in "install now" button

enter image description here

I do not want to reformat those Linux' swap, How avoid that?

hard drive : 2 TiB MBR
Output of fdisk -l

ubuntu-gnome@ubuntu-gnome:~$ sudo fdisk -l Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 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: 64 MiB, 67108864 bytes, 131072 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: 64 MiB, 67108864 bytes, 131072 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: 64 MiB, 67108864 bytes, 131072 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: 64 MiB, 67108864 bytes, 131072 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: 64 MiB, 67108864 bytes, 131072 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: 64 MiB, 67108864 bytes, 131072 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: 64 MiB, 67108864 bytes, 131072 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: 64 MiB, 67108864 bytes, 131072 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: 64 MiB, 67108864 bytes, 131072 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: 64 MiB, 67108864 bytes, 131072 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: 64 MiB, 67108864 bytes, 131072 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: 64 MiB, 67108864 bytes, 131072 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: 64 MiB, 67108864 bytes, 131072 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: 64 MiB, 67108864 bytes, 131072 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: 64 MiB, 67108864 bytes, 131072 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/loop0: 1.2 GiB, 1246838784 bytes, 2435232 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

Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 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 Disklabel type: dos Disk identifier: 0xaaf06e0e

Device Boot Start End Sectors Size Id Type /dev/sda1 2048 1026047 1024000 500M 7 HPFS/NTFS/exFAT /dev/sda2 1026048 525314047 524288000 250G 7 HPFS/NTFS/exFAT /dev/sda3 525316094 3907028991 3381712898 1.6T f W95 Ext'd (LBA) /dev/sda5 2644512768 3907028991 1262516224 602G 7 HPFS/NTFS/exFAT /dev/sda6 525316096 557314047 31997952 15.3G 82 Linux swap / Solaris /dev/sda7 557316096 1057314815 499998720 238.4G 83 Linux /dev/sda8 1057314817 1058291377 976561 476.9M 83 Linux /dev/sda9 1058291379 1090291377 31999999 15.3G 83 Linux /dev/sda10 1090291379 1590291377 499999999 238.4G 83 Linux /dev/sda11 * 1590294528 2114582527 524288000 250G 83 Linux /dev/sda12 2114584576 2148139007 33554432 16G 82 Linux swap / Solaris

Partition 3 does not start on physical sector boundary. Partition 8 does not start on physical sector boundary. Partition 9 does not start on physical sector boundary. Partition 10 does not start on physical sector boundary. Partition table entries are not in disk order.

Disk /dev/sdb: 7.2 GiB, 7742685184 bytes, 15122432 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: 0x178e5ca0

Device Boot Start End Sectors Size Id Type /dev/sdb1 * 0 2538431 2538432 1.2G 0 Empty /dev/sdb2 2511036 2515771 4736 2.3M ef EFI (FAT-12/16/32) ubuntu-gnome@ubuntu-gnome:~$

8
  • 1
    Besides having multiple swap partitions, which is nuts, you've got a bigger problem in that 4 of your existing partitions are not properly aligned. This really impacts performance.
    – heynnema
    Dec 5, 2016 at 0:02
  • How can we fix that, I only have one important partition /dev/sd5 (Data). Dec 5, 2016 at 3:08
  • How can we fix that, I only have one important partition /dev/sd5 (Data) that i can't delete. Or I must to delete all hard drive. Dec 5, 2016 at 3:16
  • There's two choices. 1) start over. repartition the entire drive, reload software. or restore from previous partition image backups. or 2) try to surgically remove the unaligned partitions, replace them with aligned partitions, restoring the data from a previous partition image backup.
    – heynnema
    Dec 5, 2016 at 4:51
  • 1
    Technically, fdisk is for MBR disks, and gdisk is for GPT disks, like what you have. I don't know if gdisk will give the same quick alignment info as fdisk, but you could try gdisk -l /dev/sda. You may have to check the man page. Gparted should align properly on MiB. To be sure, surgically remove one of your misaligned partitions, recreate it, and recheck it with fdisk/parted.
    – heynnema
    Dec 6, 2016 at 15:26

1 Answer 1

19

You don't need different swap partitions for different systems, the same way you don't need different RAM sticks for different systems. Just share one between all of them. You should use the left-most one because it's the one with the fastest read/write speed (on a HDD).

The only time something relevant after a shutdown is still on the swap is when you hibernate your PC (suspend to disk). But that's disabled by default, anyway.

Don't care about them getting formatted. If no system is suspended to disk (and only if a swap partition is used to hold the suspension image which isn't necessarily the case), it doesn't change anything.

Formatting a swap partition is a problem if it's auto-mounted using its UUID. To check whether that's the case, open the /etc/fstab files of your systems. If there is a line containing the word "swap" which starts with UUID=, the UUID has to be exchanged by the new one. Note that there doesn't have to be such a line. Your swap partitions can be identified by their device name. In this case, the line starts for example with /dev/sda12 and nothing has to be done – except if you deleted the partition or it's now a partition of a different kind, in which case the device name has to be changed.

If you deleted all but one swap partition, write the same UUID into the respective line of the /etc/fstab of all of your Linux systems. This can be done either in the live session or in the systems themselves. The change will take effect after you boot the next time. If the UUID changed, the swap partition will not be mounted but apart from there being no swap partition, the system can be used normally.

15
  • hello pal, those ramx have been created by themselves Dec 4, 2016 at 16:24
  • then, we can go ahead safely Dec 4, 2016 at 16:28
  • 1
    I didn't assume you use different RAM bars for different systems. Of course, you don't. It wasn't an allusion to your /dev/ramXs, instead I tried to say: "You don't use different RAM bars for different operating systems. A swap partition is an extension of your RAM. So why would you use different swap partitions for different systems?"
    – UTF-8
    Dec 4, 2016 at 16:28
  • Ah ok pal, I understood you. ram bar= RAM memory stick Dec 4, 2016 at 16:31
  • 1
    Wouldn't formatting the swap areas change their UUIDs? That's going to be annoying for any system that has UUIDs for the swap entries in their /etc/fstab. Dec 4, 2016 at 21:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .