Page 2 of 2
[SOLVED] Re: Lilo double boot Windows/Linux
Posted: 27. Nov 2016, 12:35
by jsfarinet
DidierSpaier wrote: ...If you want to change the filesystem of your /home partition, you will have to first back up its content, change the file system, then restore the backup.
...
Doing so, i have a problem with the correct rights of $HOME. What i did is this:
- i created - internally - a second partition
- copied the original home partition over there (by 'dd if=/dev/sda4 of=/dev/sda3')
- formatted then /dev/sda4 to xfs
But, it's not clear to me, a) how to mount the re-formatted /dev/sda4 as user - not as root? And i can only mount it as root how should i copy back the userfolder so that the rights are respected? I did it by hand, but when i boot up with this $HOME i get a warning about wrong rights and owner of $HOME/.dmrc. I changed them manually - as the login screen suggested ('chown <username>:users .dmrc, 'chmod 644 .dmrc) - but that did not change.
Many thanks in advance for any pointer!
Re: Lilo double boot Windows/Linux
Posted: 27. Nov 2016, 13:11
by mimosa
You just have to put the correct line in /etc/fstab to mount it as you wish - presumably, on /home. If your user still has the same name, you shouldn't need to change the permissions.
Here is what I have, though I don't vouch for its correctness, it works:
Code: Select all
mimosa[~]$ cat /etc/fstab
/dev/sda1 / ext2 defaults 1 1
/dev/sda3 /home ext2 defaults 1 2
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro,comment=x-gvfs-show 0 0
/dev/fd0 /mnt/floppy auto noauto,users,rw,umask=00 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
Re: Lilo double boot Windows/Linux
Posted: 27. Nov 2016, 14:12
by jsfarinet
My fstab looks like this:
Code: Select all
/dev/sda2 swap swap defaults 0 0
/dev/sda1 / xfs defaults 1 1
/dev/sda3 /home ext4 defaults 1 2
#/dev/sda4 /home xfs defaults 1 2
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro,comment=x-gvfs-show 0 0
/dev/fd0 /mnt/floppy auto noauto,users,rw,umask=00 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/dev/sda4 is the home i'd like to use, but which does not work due to the problem i described. The moved /home on /dev/sda3 works for the moment, fortunately ...
Re: Lilo double boot Windows/Linux
Posted: 27. Nov 2016, 14:54
by mimosa
Assuming the contents of sda4 are an exact copy of sda3, all you should need to do is uncomment and comment the corresponding lines.
EDIT Ah, but it looks as though you mean that isn't working. It may be best to start again:
1. Mount sda4:
2. Remove the home directory you put there:
3. Put it back:
so if you do
you should see:
4. Edit fstab, and reboot
Re: Lilo double boot Windows/Linux
Posted: 28. Nov 2016, 15:55
by jsfarinet
mimosa wrote:Assuming the contents of sda4 are an exact copy of sda3, all you should need to do is uncomment and comment the corresponding lines.
EDIT Ah, but it looks as though you mean that isn't working. It may be best to start again:
1. Mount sda4:
2. Remove the home directory you put there:
Up to here question: So /dev/sda4 is mounted by root. Doesn't that mean it belongs to root (and not to: <username>:users)? As for deleting the malformed home it's pretty much okay. BUT:
mimosa wrote:3. Put it back:
so if you do
you should see:
Wouldn't the new home created belong to root? Or will 'cp -a' respect the properties of all copied files? Sorry for my limited linux knowledge ...

Re: Lilo double boot Windows/Linux
Posted: 28. Nov 2016, 17:12
by mimosa
No, that should work fine. You have mounted it as root for the copying, but in use, you will mount it as your user. I think cp -a covers this case, though I am prepared to stand corrected.
If in doubt, you could try searching and look at recommendations (make your choice between them judiciously). Also, have a look at the man page for cp.
Re: Lilo double boot Windows/Linux
Posted: 29. Nov 2016, 17:04
by jsfarinet
Just a response: It worked! Thanks mimosa!
Re: Lilo double boot Windows/Linux
Posted: 30. Nov 2016, 11:32
by mimosa
Great! Please can you mark the topic as solved? To do this, edit the title of your first post.
The reason it works is because although when you do the copying everything is mounted as root, the correct ownerships and permissions remain intact, and are copied over.