On 7/24/22 09:22, Rich Shepard wrote:
> On Sun, 24 Jul 2022, Mark Phillips wrote:
>
>> My apologies for not being clear. What you describe is exactly what I have
>> and want to accomplish.
>> * 1 TB drive just for OS  - currently a fresh install of Ubuntu 20.04 with
>> nothing in /home/mark
>> * 4TB drive holds the back up of home/mark - i.e. all "my stuff"  (about
>> 2.1 TB). I want to just keep adding to this backup of my old /home/mark
>> directory.
>

Hello Mark and Rich

You are both making this more difficult that is has to be.  You don't
need "bind" or symlink...yadda yadda.  From what I am to understand Mark
as 2 drives:

/dev/sda1  with the new Linux OS
/dev/sdb1  with the old Linux OS and the old /home/mark with all the
important data.

First, clear out all the kruft on sda2 you no longer need: old OS files,
configs etc. Be aware that /dev/sda1/home/mark is NOT empty after you
installed the new OS. This is were all the new user specific stuff is
for the user you created during the install and for the GUI desktop
stuff.  Clear out all the old OS stuff on /dev/sdb1 you no longer need.
Then mount /dev/sdb1 to a temporary location, 'mv /home/mark  /mark'. 
Now bring over the new OS .config and .local (and whatever else Ubuntu
uses) to this /mark.  Now, you do NOT need to specify /home/mark since
/home already exists on sda1 after it is mounted.

You then simply need this in /etc/fstab to change the temporary sda2
mount to the already existing /home

/dev/sda1   /                ext4        defaults         1   1  # the
new Ubuntu OS
/dev/sda2   /home            ext4        defaults         1   2  # a big
empty drive with just 'mark' folder and all your stuff.

Replace "ext4" with the file system you are using, and look up whatever
'defaults' Ubuntu uses. [Aside: I use a more "pure" Linux distro that
has not been mangled by Canonical]

Also, UNbntu may used UUID or PARTUUID device naming.  I'll leave that
as an exercise for the reader.  On boot, you system will read /etc/fstab
and mount accordingly.  You don't put "mount" in fstab nor need the bind
option to mount a directory on a directory (which can have some weird
side effects in some cases).

Remember, in linux and unix "everything is file".   Here is a crazy
example from one of my systems.  Note how I mount on old 500 GB spinning
rust drive partitian as /tmp to ease wear and tear on my MVMe SSDs. (And
yes, I have WAY too many games...).

$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    1 465.8G  0 disk
├─sda1        8:1    1   256G  0 part /tmp
└─sda2        8:2    1 209.8G  0 part [SWAP]
sdb           8:16   1 931.5G  0 disk
└─sdb1        8:17   1 931.5G  0 part /games2
sdc           8:32   1 931.5G  0 disk
└─sdc1        8:33   1 931.5G  0 part /games
sdd           8:48   1 931.5G  0 disk
└─sdd1        8:49   1 931.5G  0 part /data2
sde           8:64   1 931.5G  0 disk
├─sde1        8:65   1 465.8G  0 part /HD_images
└─sde2        8:66   1 465.8G  0 part /HD_images/ISO_img
nvme1n1     259:0    0 931.5G  0 disk
└─nvme1n1p1 259:2    0 931.5G  0 part /library
nvme0n1     259:1    0 931.5G  0 disk
├─nvme0n1p1 259:3    0   100M  0 part /boot/efi
├─nvme0n1p2 259:4    0   100G  0 part /
└─nvme0n1p3 259:5    0 831.4G  0 part /home

-Ed.



Reply via email to