Two into One
December 24, 2017 at 9:31 pm #14680
Hi all, long time no speak, but a bit of advice would be appreciated.
After a few hardware problems, I have just installed Linux Mint 18.3 Cinamon 64bit. Courtesy of Dave, I now have a 60GB solid state drive, so my idea was to use that for OS, and a second spinner of 250GB where I want to keep my documents.
I was hoping to get HOME containing this drive somehow, but it appears as a separate drive, and navigating to a folder to for example save a new document is a real PITA. I had previously tried without success, so this install had the “data” drive still with documents on it (but backed up expecting it to be blanked) so it was already one continuous Ext 4 formatted space. See screenshot.
On the previous trial I had tried dragging the various folders (Pictures, Videos etc) across, but could no do anything, other than have similar folders (Pictures, Videos etc.) over on “Data” drive with the info copied there and a PITA to navigate to.
Surely an easy way?
July 19, 2018 at 9:04 am #23261
DrezhaParticipant@drezhaForumite Points: 349
A bit late to the party perhaps, but can’t the spinner be mounted to a folder within the Home drive?
So if it’s purely for the documents, it could be added to the documents folder? So mounted in /etc/fstab to ~/Documents?00July 19, 2018 at 9:02 pm #23274
I THINK I may be finally understanding what you (Dan) are saying. I could not find etc/fstab previously but I now realise (and you said 8 months ago) that I should find it via COMPUTER – File System, not searching in vain in the home folder.
I will study it further, then may “have a go” over the weekend. A full backup first, but maybe NOT blank the HDD and not need to copy back.
EDP, a few years ago I mastered the business of copying the .thunderbird from the home directory and using it to replace the .thunderbird of the previously opened and closed thunderbird, so OK there. Most important as I keep my emails back to the year dot (plus a bit, some early ones gone awol back in early widoze days.
Drezha, No idea if you are onto something, but it is better if I just follow one procedure. Dan’s it will be, I hope. Too easily confused with computers (software stuff, anyway, but I must be a dozen years out of date on hardware since retiring in 2006.
I will report back
Thanks all, , Les00July 19, 2018 at 10:10 pm #23275
If you don’t do a destructive mount (i.e. copy, and not move) you don’t even need a full backup – just one file – /etc/fstab. Back that up, and if it all goes pear shaped, provided you can get to the filesystem (Which you can do with a liveCD) then you can just write the old fstab back, reboot, and nothing has changed.
I should clarify – if you mount a device to an existing directory, the new device takes over the address. Nothing will be written to the “physical” directory on disk. If you want to test before you proceed, create a directory in /home, copy some files to it, then mount a device to it. The files are gone and whatever is on the device is there instead.
Reboot (or sudo umount) , and whatever was there before will still be there.
The Linux filesystem (usually ext4) does not see the hardware, just the mount points pointing to different hardware.
00July 19, 2018 at 10:18 pm #23277
- This reply was modified 1 month ago by D-Dan.
Let me expand on my last reply. Imagine a tree without roots and leaves, just placeholders for them, and that’s your filesystem. There’s nothing to it except names.
Separately, you have some roots and leaves. You mount the leaves to the placeholders on the tree, and you mount the roots to the placeholder on the tree. Suddenly, as far as everyone and everything is concerned, you have a tree.
Then you decide it should be a different tree. You can unmount the leaves, and mount different leaves. New tree, job done, and the old leaves are perfectly fine if you want them back.
I probably just confused you :/
00July 21, 2018 at 6:59 pm #23309
- This reply was modified 1 month ago by D-Dan.
As my other new post will show, I have made a start with this topic. I copied everything from my data drive (the 250GB spinner) to backup drive first of course, together with the .mozilla and .thunderbird. After the install, the DATA drive was still there and fully intact as before. Good.
I then looked at both the new HOME and the DATA HDD side by side, with “Show hidden” for each. If I am to use the Data drive as Home, I guess it will need all of the hidden files taking across, so I selected all of them in home and attempted to copy to Data. Two folders, .dconf and .dbus refused to copy, telling me I did not have permission. Solution please, or just tell me it does not matter.
I will now investigate further all of DAN’s suggestions to complete the required transfer.
Les00July 21, 2018 at 9:50 pm #23316
Now on second install, after screwing a few things.I suspect that inability to copy or move .dbus will not screw things up, but of course will probably be wrong. I managed to copy the UUID of my daat disc (spinner), and (maybe) of Home. When I tried to copy Home as Home.bak, it just made it a sub folder of Home, effectively screwing up the install (for me at any rate), hence the second install.
Dan, I think I need a bit more hand holding to get this right.
I will delete all those hidden files I copied across to Data, and copy the current ones. I assume they must be different at least because the sda and sdb are changed.
Les.00July 22, 2018 at 11:11 am #23329
You should be able to do a complete copy using sudo via the terminal. To preserve all the permissions:
sudo cp -rav * /spinner/home
Assuming that you cd to your existing /home directory, and you will of course have to modify the destination to suit your system. “r” means recursive, “a” means archive (which should preserve ownership etc.) and “v” means verbose. You can leave “v” off if you don;t want to see progress, but I guess given your problems you probably do.00July 22, 2018 at 11:26 am #23334
I should add, you can possibly achieve it more reliably with rsync:
sudo rsync -a * /spinner/home
Which will not choke on larger files.
I am bothered, however, that files in your /home are owned by root. They shouldn’t be.00July 22, 2018 at 12:14 pm #23335
I just “replied” but it has gon AWOL. I suspect I was logged out. It was written BEFORE seeing Dan’s last (confusing) message.
Anyway, I had already followed earlier advice:-
Open terminal in HOME
which gave me the UUID.
Next, I opened terminal in Data:-
sudo cp -rav /home /adc7188d-8052-4574-83ee-c383faf28db4
where I watched everything being copied (would that just be directory entries, it seemed quick?)
It looked OK, so I made a link from Docs onto the desktop.
I attach a screenshot, then I will start another message.
Attachments:You must be logged in to view attached files.00July 22, 2018 at 12:17 pm #23337
If you cd to the mount point of the destination and then ls, you should see all the files. The mount point won’t, by default, be on your desktop.
And yes, -r means recursive, so all directories including contents.
How did you create the link on the desktop?
I just did a quick test in a VM with Mint. On the desktop, right click create launcher, and then in the command, select thunar path/to/new/home
NB. I use xfce4, and so it may vary between desktop managers, but that got me a working link.00July 22, 2018 at 12:18 pm #23338
Oh, and rsync can be used instead of cp. cp sometimes has problems with larger files, which rsync shouldn’t.00July 22, 2018 at 12:30 pm #23342
This is how my link looks. This is to an NFS drive.00July 22, 2018 at 12:33 pm #23343
OK, a number of things. When I saved that screenshot, it put it into “pictures” in the Home directory, not in Data. I must have done something wrong. Any ideas?
I have opened both Home and Data, made them both to show hidden, and taken another screenshot. Notice that dbus folder once more had refused to be copied to Data.
I can live with things for now, but it seems I am exactly where I was late December, except for an updated Op Sys. I have held back from opening my emails, the .thunderbird folder in home is just the “open and close” entry, but I need to see my own stuff soon.
Attachments:You must be logged in to view attached files.00July 22, 2018 at 12:38 pm #23345
You look to have copied everything successfully. To get TB working with the new drive, you simply need to make the new drive/home, which is done via an fstab entry00July 23, 2018 at 9:46 am #23388
Yesterday I had some “private coaching” from D-Dan, so some progress made, but final step still to make. He wrote:-
First things first – there are system users as well as just you, so let’s just move all of /home. Unless you already did it, copy (with -a) /home/* to the big drive (with sudo)
if it will take a while to copy, just set it going, and then add: UUID=adc7188d-8052-4574-83ee-c383faf28db4 /home ext4 defaults,user_xattr,noatime,discard 0 0
However I get this:–
# /etc/fstab: static file system information.
# Use ‘blkid’ to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=0d3eec39-c333-4589-aa4f-5b85a18b0365 / ext4 errors=remount-ro 0 1
/swapfile none swap sw 0 0
/dev/disk/by-uuid/adc7188d-8052-4574-83ee-c383faf28db4 /mnt/adc7188d-8052-4574-83ee-c383faf28db4 auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/sda1: UUID=”0d3eec39-c333-4589-aa4f-5b85a18b0365″ TYPE=”ext4″ PARTUUID=”51e1be8c-01″
/dev/sdb1: LABEL=”Data” UUID=”adc7188d-8052-4574-83ee-c383faf28db4″ TYPE=”ext4″ PARTUUID=”00088499-01″
les@les-SN78S:/mnt/adc7188d-8052-4574-83ee-c383faf28db4$ UUID=adc7188d-8052-4574-83ee-c383faf28db4 /home ext4 defaults,user_xattr,noatime,discard 0 0
bash: /home: Is a directory
What am I doing wrong there?
to fstab, reboot (or issue a sudo mount -a command) and you should be good to go00July 23, 2018 at 9:59 am #23391
Silly error, the LAST line after “Les” should be at end of 6th line, but you all worked that out!
Les.00July 23, 2018 at 8:23 pm #23411
In fstab, you reference either /dev/sdXN OR UUID=, not both. Remove the references to /dev/sda1 and /dev/sdb1 – the lines should start from UUID=.
But honestly, if that’t the contents of /etc/fstab it’s hard to work out exactly what’s going on (I don’t think the forum formatting is helping). Can you perhaps post to pastebin and add a link?
00July 24, 2018 at 8:36 pm #23427
- This reply was modified 3 weeks, 6 days ago by D-Dan.
I carefully read thro the thread and other stuff last night and tried to get it all finished. When I tried to write to/etc/fstab, I was informed I did not have permission. Eventually, I threw in the towel for the night, an unsatisfactory conclusion to yet another birthday. (But I want a LOT more even if equally uneventful). I even used the birthday as an excuse (to myself) not to attend a funeral I had originally inked in.
I have left well alone today whilst working outside (underground ware supply problems), and will not go near for a few days to try to clear my head. Then I will systematically go thro it all, with plenty of screenshots. They can’t be easily screwed up. Never heard of pastebin, but may have a look.
You must be logged in to reply to this topic.