You are not logged in.
Warning:
Please note that this procedure can easily result in permanent data loss. Be sure to have a backup before taking the plunge. Other than that, enjoy!
If you have installed Devuan to one partition and you are regretting that fact, be informed that you can easily assign a separate partition for /home, or any other directory you deem deserve to be transferred to a separate partition. This can be done without reinstalling because conventional GNU/Linux doesn't hide its operational 'secrets' from its users.
If not already present create a directory under /mnt, say my_home:
mkdir /mnt/my_home
cd /mnt/my_home
The first thing to do is obviously to find enough free space for the new partition. Then, use a tool (gparted) to format the new partition to some native Linux filesystem like ext3 or ext4. Other filesystems exist but you have to inform yourself about the pros and cons in using them instead of ext3 and ext4. Once you have a separate formatted partition, you will need to copy the contents of the /home directory to the new partition. This can be done using various CLI tools under root. You can use cp -a and rsync. I use cp -a although in the past I used rsync. Make sure to mount the new partition before attempting to write to it and pay special attention to the mount point you will be using because you don't want to corrupt the existing partition.
Let us say, the new partition to hold the contents of /home is /dev/sda10:
The Procedure:
To mount the partition:
# mount /dev/sda10 /mnt/my_home
To copy /home to the new partition:
# cp -a /home/* /mnt/my_home
Unmount the partition:
# umount /mnt/my_home
After that, you will need to edit the /etc/fstab file so that at boot the new partition is mounted on /home. This can be done by adding a new entry to the file as root. To find the uuid of the partition, use the blkid command to list the uuids of the partitions.
Add the new entry to the fstab file as shown:
UUID=the_long_long_uuid /home ext4 defaults,noatime 0 2
Save the file.
Reboot to test whether the installation uses the new partition. Use mount without parameters for that.
When you are 100% sure that the installation is using the new partition, you can delete the data under /home which is hidden when /home is used as a mount point. Don't do this while your installation is running, instead use a LiveCD for that. Be cautious because you can easily delete your valuable data especially if you dare to do this procedure without making a backup. A backup is very strongly recommended.
Using a Live Devuan CD, issue this command as root although it shouldn't be necessary to be root.
Create a temporary directory under mount for the Live Linux CD session as follows:
mkdir /mnt/my_devuan_installation
Mount the root partition of the installation of which you want to purge the contents of /home.
mount /dev/sda2 /mnt/my_devuan_installation
I assumed /dev/sda2 contains the blessed installation.
Perform the dangerous cleanup:
rm -rf /mnt/my_devuan_installation/home/*
Unmount the partition:
# cd /
umount /mnt/my_devuan_installation
NOTE:
This same procedure can be used to transfer any directory to a dedicated partition. However, different mount parameters have to be used in /etc/fstab because /home does not have the same permissions as system directories and you don't want to render your system insecure or unusable.
Enjoy!
Offline
Hi edbarx,
Since you mention using a Live CD starting from step 7, why not do everything from the Live CD? I think it also makes it easier for the preparation of the partitions, since it's not possible to shrink some FS (ext4, for instance) online. And if during the reboot the /home does not mount correctly, it's still possible to log in as root and fix the /etc/fstab.
Offline
Hi edbarx,
Since you mention using a Live CD starting from step 7, why not do everything from the Live CD?
Modifying my method as a result of understanding the reasons behind it is a good thing that I fully encourage. I cannot and I do not intend to shackle independent problem solving.
Offline
You can just boot single-user to do all this.
Offline