Rebuilding with additional drive and new installation but retaining exsiting home directory

I am planning the rebuilding of an openSUSE machine which has all the partitions on one raid array. I have installed a PCi NVMe memory to be used as the additional drive for a new OS and have also included a USB stick in anticipation of not being able to boot from PCi NVMe. The machine is essentially the same as another machine which I have rebuilt and on which I had this problem. Previously I had to use the USB stick for /boot and /boot/efi.

This is what the installation is at present:-

lastair@ibmserv2:~> lsblk -l 
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT 
sda       8:0    0  5.5T  0 disk  
sda1      8:1    0  156M  0 part /boot/efi 
sda2      8:2    0    2G  0 part [SWAP] 
sda3      8:3    0   40G  0 part /var 
sda4      8:4    0  512G  0 part /home 
sda5      8:5    0  4.9T  0 part /multimedia 
sdb       8:16   1 28.9G  0 disk  
sdb1      8:17   1 28.9G  0 part /run/media/alastair/KINGSTON 
sr0      11:0    1 1024M  0 rom   
nvme0n1 259:0    0  1.8T  0 disk  
alastair@ibmserv2:~>    


I have not yet attempted the installation of the OS which will be Leap 15.3 and all the existing system is on /dev/sda. The nvme and USB can also be seen and I am not sure what sr0 is?

My dumb question is; if I put the new OS on the PCi NVME and USB, how do I avoid touching the existing /home partitions, and if I am successful, how can I then access the data on the old /home partitions? I am just trying to think this through in case my backups are messed up.

That can all be done using the (expert) partitioner of the installer.

SCSI ROM, your CD/DVD/Bluray drive.

My dumb question is; if I put the new OS on the PCi NVME and USB, how do I avoid touching the existing /home partitions, and if I am successful, how can I then access the data on the old /home partitions?
I don’t see any reason to involve USB here. You appear to have an ESP on sda1. When you reach partitioning in the installer, choose expert, specify your existing /home be mounted on /home, and your existing ESP be mounted on /boot/efi/. If you don’t wish the existing /home mounted on /home, just don’t, or else mount it elsewhere, or nowhere. If you want the NVME to be bootable without sda in the system, put a clone of its ESP on a USB device after you’ve completed the 15.3 installation, or use YaST2 to build one on USB from scratch.

Hi mrmazda,
All good and thanks for the reassurances. For reasons I don’t yet understand but which are mentioned at length in an earlier thread I was not able to install the /boot/efi on the raid array on that machine. It all seems OK on this machine, so when this installation has been completed and if it works OK I shall revisit the other machine.

Sorry I have been making a meal of this. Please could I have help with creating a permanent mount of my old multimedia partition on the new system.
The drives and blkid of the partition I am trying to mount is /dev/sda5 as shown:-

alastair@ibmserver2:~> lsblk -l
NAME      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda         8:0    0  5.5T  0 disk 
sda1        8:1    0  156M  0 part /boot/efi
sda2        8:2    0    2G  0 part /boot
sda3        8:3    0   40G  0 part 
sda4        8:4    0  512G  0 part 
sda5        8:5    0  4.9T  0 part 
sdb         8:16   1 28.9G  0 disk 
sdb1        8:17   1 28.9G  0 part 
sr0        11:0    1  146M  0 rom  
nvme0n1   259:0    0  1.8T  0 disk 
nvme0n1p1 259:1    0  1.8T  0 part /var
alastair@ibmserver2:~> sudo blkid /dev/sda5
[sudo] password for root: 
/dev/sda5: UUID="4272b75a-ea72-4068-8826-e2dfc5611fd5" BLOCK_SIZE="4096" TYPE="xfs" PARTLABEL="primary" PARTUUID="53a507f9-eccf-40a1-b90f-d48cf5227450"
alastair@ibmserver2:~>

I have created a directory in my home directory /home/alastair/multimedia which is now on the NVMe partition and edited /etc/fstab as follows:-

alastair@ibmserver2:~> cat /etc/fstab
UUID=d49782e2-1df9-4013-a8c9-6136ff257446  /           btrfs  defaults             0  0
UUID=f6190f68-a732-46c1-97ed-1bd670763810  /boot       ext4   data=ordered         0  2
UUID=d49782e2-1df9-4013-a8c9-6136ff257446  /var        btrfs  subvol=/@/var        0  0
UUID=d49782e2-1df9-4013-a8c9-6136ff257446  /usr/local  btrfs  subvol=/@/usr/local  0  0
UUID=d49782e2-1df9-4013-a8c9-6136ff257446  /tmp        btrfs  subvol=/@/tmp        0  0
UUID=d49782e2-1df9-4013-a8c9-6136ff257446  /srv        btrfs  subvol=/@/srv        0  0
UUID=d49782e2-1df9-4013-a8c9-6136ff257446  /root       btrfs  subvol=/@/root       0  0
UUID=d49782e2-1df9-4013-a8c9-6136ff257446  /opt        btrfs  subvol=/@/opt        0  0
UUID=d49782e2-1df9-4013-a8c9-6136ff257446  /home       btrfs  subvol=/@/home       0  0
UUID=B738-D576                             /boot/efi   vfat   utf8                 0  2
UUID=4272b75a-ea72-4068-8826-e2dfc5611fd5  /multimedia xfs    defaults             0  2
alastair@ibmserver2:~> 
alastair@ibmserver2:~> sudo mount -a
[sudo] password for root: 
alastair@ibmserver2:~> 


This mounted /dev/sda5 to /multimedia and I then intended to symlink this to the directory I created for it in /home/alastair/multimedia but this was refused:-

alastair@ibmserver2:~> ln -s /multimedia /home/alastair/multimedia
ln: failed to create symbolic link '/home/alastair/multimedia/multimedia': Permission denied
alastair@ibmserver2:~> 

I am not sure if this was the rightv approach or should I have put the mount directly into /home/alastair/?

More importantly I am unsure about permmissions and ownerships but the mounted /multimedia is firmly owned by root!:-

total 1
drwxr-xr-x  1 alastair users    0 Sep  1 16:42 bin
drwxr-xr-x  1 alastair users   70 Sep  1 16:47 Desktop
drwxr-xr-x  1 alastair users    0 Sep  1 16:47 Documents
drwxr-xr-x  1 alastair users  150 Sep  1 18:47 Downloads
drwxr-xr-x  1 root     root     0 Sep  1 20:12 multimedia
drwxr-xr-x  1 alastair users    0 Sep  1 16:47 Music
drwxr-xr-x 27 alastair users 4096 Aug 31 21:30 pCloudDrive
drwxr-xr-x  1 alastair users    0 Sep  1 16:47 Pictures
drwxr-xr-x  1 alastair users    0 Sep  1 16:47 Public
drwxr-xr-x  1 alastair users    0 Sep  1 16:47 Templates
drwxr-xr-x  1 alastair users    0 Sep  1 16:47 Videos
alastair@ibmserver2:~> 

and similarly :-

alastair@ibmserver2:~> cd /home/alastair
alastair@ibmserver2:~> ls -l
total 1
drwxr-xr-x  1 alastair users    0 Sep  1 16:42 bin
drwxr-xr-x  1 alastair users   70 Sep  1 16:47 Desktop
drwxr-xr-x  1 alastair users    0 Sep  1 16:47 Documents
drwxr-xr-x  1 alastair users  150 Sep  1 18:47 Downloads
drwxr-xr-x  1 root     root     0 Sep  1 20:12 multimedia
drwxr-xr-x  1 alastair users    0 Sep  1 16:47 Music
drwxr-xr-x 27 alastair users 4096 Aug 31 21:30 pCloudDrive
drwxr-xr-x  1 alastair users    0 Sep  1 16:47 Pictures
drwxr-xr-x  1 alastair users    0 Sep  1 16:47 Public
drwxr-xr-x  1 alastair users    0 Sep  1 16:47 Templates
drwxr-xr-x  1 alastair users    0 Sep  1 16:47 Videos
alastair@ibmserver2:~> 

Am I on the right lines?

That’s what I would have suggested unless you have specific reason to share that folder outside your user’s home. I think that should also solve your permissions problem. Otherwise, just become root and make it yours. :wink: I have to admit being lazy in such things. I mostly just start dolphin as root and edit the permissions in the folder properties after entering “alt+return”. Good thing, you can easily adopt these changes to all files and subfolders. Dolphin warns you of being used by root and of course it can be done in terminal using chown with the -R option.

As long as root owns a real directory /home/alastair/multimedia, there’s no way for /home/alastair/multimedia to be created as a symlink to /multimedia, no matter what the permissions are on either directory or either’s parent. Don’t forget about case sensitivity. ln -s /multimedia /home/alastair/Multimedia would be OK, though IMO unwise, assuming appropriate permissions on /multimedia.

This is an extremely bad idea, in my opinion of course. Stay away from RAID unless you have a very compelling reason for doing so. You may show your current drives and post vendor and model of any new ones to be added to the openSUSE machine:

**erlangen:~ #** inxi -D 
**Drives:    Local Storage:****total:** 6.38 TiB **used:** 1.53 TiB (24.0%)  
           **ID-1:** /dev/nvme0n1 **vendor:** Samsung **model:** SSD 950 PRO 512GB **size:** 476.94 GiB  
           **ID-2:** /dev/sda **vendor:** Crucial **model:** CT2000BX500SSD1 **size:** 1.82 TiB  
           **ID-3:** /dev/sdb **vendor:** Western Digital **model:** WD40EZRX-22SPEB0 **size:** 3.64 TiB  
           **ID-4:** /dev/sdc **vendor:** Samsung **model:** SSD 850 EVO 500GB **size:** 465.76 GiB  
**erlangen:~ #**

Ok, I like your suggestion better than what I had but why is ln -s /multimedia /home/alastair/Mastermedia which is slightly different from what you suggest above unwise?

I understand but the RAID array is an hardware array of 8 disks, one of which is an hot spare. I tend to use this approach whenever possible. So far so good.

Because your homedir would have an apparent duplication, and consequently opportunity for confusion, something like:

alastair@ibmserver2:~> cd /home/alastair
alastair@ibmserver2:~> ls -l
...
drwxr-xr-x  1 root     root     0 Sep  2 07:52 Multimedia
drwxr-xr-x  1 root     root     0 Sep  1 20:12 multimedia
...
alastair@ibmserver2:~>

Unless one was a symlink of the other, you’d be apt to find files expected to be in one in the other and vice versa, accidentally putting files elsewhere than intended.

OK, yes, that was why I changed my symlink to Mastermedia.
If you have time I would also like to consider the implications of my symlink. At present, as far as I understand it, although my /home/alastair/Mastermedia is owned by me, all the contents are still owned by root because this is their source.
If I am correct and I wish to change or edit these directories and files I would have to elevate my status. This might be cumbersome in use. What is the correct way to solve this? Should I just change the ownership of /multmedia?

P.S. Good to see you use OS/2 Warp4/eComStation etc. Sadly I had to give up on this when I moved to Linux but great to know I was in good company.

Hi
Why in your home directory and why owned by root?

So I have another drive (partition) mounted as /stuff then some directories under this partition owned by root and my user…


ls -lah /stuff/

drwxr-xr-x 4 root     root  107 Jul 28 21:43 .
drwxr-xr-x 1 root     root  140 Jul 28 13:48 ..
drwxr-xr-x 2 root     root   29 Aug 20 14:44 harvester
drwxr-xr-x 7 username users 119 Aug 15 23:01 vagrantd

Hi Malcolm,
Many thanks but your point is too subtle for me. I was just trying to keep things simple whilst bringing a loaded drive into my system. Other than the permissions I am not anxious to change it further.
Now I have the second server with NVMe installed, all I am waiting for are the new processors which are coming from China. The system is working and already much faster.

Meanwhile I want to re-visit the first machine and try again to put the efi and boot partitions on the hard drive.

If I am able to copy the two partitions, /efi and /boot/efi from the USB stick to new partitions on the hard drive, how do I then activate them in the new positions please?
Should I start a new thread on this?

Hi
Yes, new thread :wink: