[SOLVED] Lilo double boot Windows/Linux

You have a problem with Salix? Post here and we'll do what we can to help.
User avatar
jsfarinet
Posts: 305
Joined: 23. Nov 2014, 07:32

[SOLVED] Re: Lilo double boot Windows/Linux

Post 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!
Last edited by jsfarinet on 30. Nov 2016, 14:30, edited 2 times in total.
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Lilo double boot Windows/Linux

Post 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
User avatar
jsfarinet
Posts: 305
Joined: 23. Nov 2014, 07:32

Re: Lilo double boot Windows/Linux

Post 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 ...
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Lilo double boot Windows/Linux

Post 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:

Code: Select all

sudo mount /dev/sda4 somedir
2. Remove the home directory you put there:

Code: Select all

sudo rm -rf somedir/jsfarinet
3. Put it back:

Code: Select all

sudo cp -a ~/ somedir
so if you do

Code: Select all

ls somedir
you should see:

Code: Select all

jsfarinet
4. Edit fstab, and reboot
User avatar
jsfarinet
Posts: 305
Joined: 23. Nov 2014, 07:32

Re: Lilo double boot Windows/Linux

Post 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:

Code: Select all

sudo mount /dev/sda4 somedir
2. Remove the home directory you put there:

Code: Select all

sudo rm -rf somedir/jsfarinet
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:

Code: Select all

sudo cp -a ~/ somedir
so if you do

Code: Select all

ls somedir
you should see:

Code: Select all

jsfarinet
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 ... :oops: :oops:
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Lilo double boot Windows/Linux

Post 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.
User avatar
jsfarinet
Posts: 305
Joined: 23. Nov 2014, 07:32

Re: Lilo double boot Windows/Linux

Post by jsfarinet »

Just a response: It worked! Thanks mimosa!
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Lilo double boot Windows/Linux

Post 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.
Post Reply