Thursday, March 17, 2016

Dual-booting with 2 Linux distributions: Ubuntu and Arch and a separate partition for Home

On my laptop I have 2 Linux OS, Ubuntu and Arch,  and a separate partition for the home directory which is convenient for sharing files between them. It's recommended, however, not to share the home directory completely because even the same applications from the different OS can spoil each others files such as configuration ones. Thus I've given a different name to my default user in Arch. That way, in Ubuntu I have the user Alex and in Arch I have the user Arch. Here's what my home partition look like:

    /home (/dev/sda5)

Each of them has his own directory for Document, Downloads, etc.  That's not wise and I'm going to change that and intertwine those directories by linking them so there won't redundant copies:

    ln -s /home/alex/Documents /home/arch/Documents 
    ln -s /home/alex/Downloads /home/arch/Downloads 

And no avail. The error occurred because the 2nd arguments, the folders of the arch, those folders were real and existed. It's impossible to do relink 2 real directories because the whole idea of the command link is to create a link from a virtual directory to real and here we had 2 directories being real. Let's fix that:

    rm -rf /home/arch/Documents
    rm -rf /home/arch/Downloads

Now we can go back to square one and create the sym links all over again:

    ln -s /home/alex/Documents /home/arch/Documents 
    ln -s /home/alex/Downloads /home/arch/Downloads 

The same way we can create the links for the Music, Videos, .ssh and other directories.

No comments :

Post a Comment