Linux-Noob Forums
Switch OS and keep my files - Printable Version

+- Linux-Noob Forums (https://www.linux-noob.com/forums)
+-- Forum: Linux Noob (https://www.linux-noob.com/forums/forum-3.html)
+--- Forum: How Do I? (https://www.linux-noob.com/forums/forum-60.html)
+--- Thread: Switch OS and keep my files (/thread-112.html)



Switch OS and keep my files - John8547 - 2013-03-17

I'd like to switch from my Crunchbang (Dabien) distro to a Ubunto. Although, I wouldn't like to have to lose all my files and get them again. Is there a way I could change Linux operating systems, but keep all my files? I was thinking about the possibility of doing a dualboot, moving all my files manually to the UBunto partition, then getting rid of Crunchbang. Will this work? If not, I'm open to suggestions.



Switch OS and keep my files - inittux - 2013-03-19


Hello John and welcome to the forums!! :)  Do you keep your /home partition on  a seperate partition or do you have everything under /. Or how do you have your partitioning setup? If you open the terminal you can type the following command. And then paste the output here. Then we can see what your partitioning looks like.

 

Code:
df -h
 

Mine for example looks like this:


 

Code:
]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              16G  2.3G   13G  16% /
tmpfs                 1.8G     0  1.8G   0% /dev/shm
/dev/sda1              54G  246M   51G   1% /home
 

You can see here that /home is on a a seperate partition.

 

if you got /home on a seperate partition you can just reinstall your system. During the installation you'll have to select to manually setup your partitions. During partition setup you can select the partition that you had your system installed on before, you can then just select and edit it: filesystem: ext4 and mount location: / and then somewhere you have an option to select format partition, then you can click finish. Then you can also see your home partition from before, you can select it and open it. You'll have an option to ask where you want it mounted, you can then select /home, then somewhere you have an option, select filesystem type, here you have a drop down option where you can select DO NOT FORMAT. Then you can click finish and continue installation of your system. Be sure to make  a backup of all your important files just incase.
 




Switch OS and keep my files - John8547 - 2013-03-20

Filesystem                                              Size  Used Avail Use% Mounted on
rootfs                                                   71G   22G   45G  33% /
udev                                                     10M     0   10M   0% /dev
tmpfs                                                   203M  628K  202M   1% /run
/dev/disk/by-uuid/24b86282-c79a-42a9-bd61-8055d1239933   71G   22G   45G  33% /
tmpfs                                                   5.0M     0  5.0M   0% /run/lock
tmpfs                                                   1.1G   84K  1.1G   1% /run/shm
/dev/sr0                                                2.9G  2.9G     0 100% /media/cdrom0
 



Switch OS and keep my files - inittux - 2013-03-20


From the results of that I can see that you have your / and your /home on the same partition, so it's  not gonna be possible to reinstall your system without losing your data.  I would just copy all your important data to an external hard drive. The reinstall the system. have your file system on one partition and your data(/home on another seperate partition, so if you were to reinstall next time you could just reinstall your system and not having to move your data.

 

Code:
Filesystem                      Size  Used Avail Use% Mounted on
rootfs                           15G  3.2G   11G  23% /
udev                             10M     0   10M   0% /dev
tmpfs                           365M  704K  364M   1% /run
/dev/mapper/sda3_crypt           15G  3.2G   11G  23% /
tmpfs                           5.0M     0  5.0M   0% /run/lock
tmpfs                           730M     0  730M   0% /run/shm
/dev/sda1                       368M   27M  322M   8% /boot
/dev/mapper/sda4_crypt          441G  2.0G  416G   1% /home
 

 

As you can see my root file system(/) is on sda3 and my data(/home) is on sda4.  You can set this up by selecting manual partitioning via the installer. If you need help with that? I can talk you through it.  Other option is putting in a second hard drive installing ubuntu on there so that you can mount your crunchbang /home(data) in your ubuntu installation then installed on your second disk. Then copying the data over to the ubuntu /home(data). And the last option there is to srhink your filesystem. I see that you have 45GB of free space available, you can shrink your / partition to 24GB (71GB-22(24)(just to be safe)=47GB. Then you could could reinstall your ubuntu on that free space, and then mount your crunchbang data(/home) there and copy your data over to ubuntu. Numbers might no be exactly accurate but I think you get the idea.That's about all the options you have. Hope that helps you some. But always be sure to make a backup of your important before you try anything. :)
 




Switch OS and keep my files - John8547 - 2013-03-21

Alright, thank you