Moving the /home partition

I am planning changes that affect my openSUSE /home partition. Specifically, I wish to separate personal data and files not directly associated with oS to a separate partition. This new partition, to be referred to as “/data” or “/common” (or whatever) would facilitate sharing with test/alternate versions of oS, as well as streamlining backup requirements.

Current configuration is:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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 identifier: 0x000d663c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63    62910539    31455238+  83  Linux
/dev/sda2        62910540    79682399     8385930   82  Linux swap / Solaris
/dev/sda3        79682400   289394909   104856255   83  Linux
/dev/sda4   *   289394971   976773119   343689074+   f  W95 Ext'd (LBA)
/dev/sda5       289394973   352305449    31455238+   7  HPFS/NTFS/exFAT
/dev/sda6       352305513   369077309     8385898+  82  Linux swap / Solaris
/dev/sda7       369077373   411023024    20972826   83  Linux
/dev/sda8       411023088   444582809    16779861   83  Linux
/dev/sda9       444585984   461361151     8387584   82  Linux swap / Solaris
/dev/sda10      461363200   503306239    20971520   83  Linux
/dev/sda11      503308288   534765567    15728640   83  Linux
/dev/sda12      534767616   576710655    20971520   83  Linux
/dev/sda13      576712704   618655743    20971520   83  Linux
/dev/sda14      618657792   660600831    20971520   83  Linux
/dev/sda15      660602880   702545919    20971520   83  Linux
/dev/sda16      702547968   734005247    15728640   83  Linux

with ~115GB free (past /sda16) in the extended partition.

In openSUSE, partitions are assigned as:

/dev/disk/by-id/ata-ST9500420AS_5VJCTBPC-part2 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-ST9500420AS_5VJCTBPC-part1 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-ST9500420AS_5VJCTBPC-part8 /Ubuntu/home         ext4       defaults              1 2
/dev/disk/by-id/ata-ST9500420AS_5VJCTBPC-part7 /Ubuntu/root         ext4       defaults              1 2
/dev/disk/by-id/ata-ST9500420AS_5VJCTBPC-part3 /home                ext4       defaults              1 2
/dev/disk/by-id/ata-ST9500420AS_5VJCTBPC-part5 /windows/F           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

Non-fstab partition usage is: /sda5 = shared NTFS data partition, (/sda 6,7,8) = Ubuntu 10.04.2 LTS, (/sda9, 10, 11) = openSUSE 12.1, (/sda12, 13) = Linux Mint, /sda14 reserved for openSUSE 12.1 “/” backup, (/sda15, 16) = Fedora 15.

One may observe that the openSUSE 11.4 /home partition, /sda3, is a physical partition. I would like to copy /sda3 to, say, /sda17 (via Clonezilla). I know I could easily finish the conversion/migration with a reinstall of oS. Is it possible to simply update /etc/fstab to

/dev/disk/by-id/ata-ST9500420AS_5VJCTBPC-part17 /home                ext4       defaults              1 2

and reboot ? If so, /sda17 could be subsequently shrunk after creating the /data partition:

/dev/disk/by-id/ata-ST9500420AS_5VJCTBPC-part18 /data                ext4       defaults              1 2

Of course, this may appear to simple too be easily done (one of Murphy’s laws?). The emptying of /sda3 would allow for a hopefully short-lived re-install of Windows (aaaarrrggghhhh) to solve an unrelated need. Of course, we know that Windows needs at least one (1) physical partition.

Comments, thoughts and alternatives ?

It will work. You can also create sda17 and sda18 with gparted and copy the content of sda3 into sda17 while preserving ownership, permissions, time stamps and everything. I would just use rsync. But I guess that’s what clonezilla does (according to its name). I don’t understand what you are doing with 3 swap partitions on the same hard disk though (unless you’re running open Solaris too). It is neither useful nor very efficient, IMO.

  • I prefer to mount by UUID. You probably have seen this notation already in Ubuntu and Fedora.

I have always used two (2) swap areas, one for my primary openSUSE and one for everything else. I had used the primary swap for hibernation (circa 11.2/11.3), allowing hibernation to proceed to GRUB, though I have not been able to make this work with 11.4. However, this has not been a serious shortcoming.

The third swap arose during initial testing of 12.1, circa Milestone 2. I was experiencing boot failures due to some contamination of the swap area. This was avoided by use of the GRUB parameter “noresume”, so this swap area will go by the wayside.

I do prefer mount by UUID. I must investigate this with the openSUSE GRUB. When I used Ubuntu’s GRUB2, this was easier.

Notice that you can choose to mount by UUID in openSUSE setup (Fstab options):
It’s just not the default for some reason.