how do i mount separate partitions and not loose data?
i have a new debian installation with separate partitions (images) for:
/ /swap /home /usr /var and /tmp
/ and /swap are created automatically when you install a new linode image.
the problem occurs when i add the partitions i create to fstab and restart.
they mount, but there is no data.
so the question is:
how can i mount partitions without loosing the data?
pr
how can i have separate partitions in one setup?
(what is the correct procedure)
6 Replies
## assuming /dev/xvdc is your new /usr
mount /dev/xvdc /mnt
cp -a /usr/* /mnt/
umount /mnt
mount /usr
Note that in the case of /var and /tmp, rebooting afterward is recommended. Also, once you're sure things are working fine, you can remove the unneeded copies in the root fs like so:
mount --bind / /mnt
rm /mnt/usr/* -rf ## don't remove /usr itself!
umount /mnt
Be sure to copy everything, and make sure it comes back on a reboot, first, of course
:~# quotaon -avug
/dev/xvda [/]: group quotas turned on
/dev/xvda [/]: user quotas turned on
/dev/xvdc [/usr]: group quotas turned on
/dev/xvdc [/usr]: user quotas turned on
/dev/xvde [/var]: group quotas turned on
/dev/xvde [/var]: user quotas turned on
alpha1:~# #i hit tab to show available programs here
Display all 702 possibilities? (y or n)
If it didnt work my list of available programs would have been 152 instead of 702 or something like that.