6

I'm pretty new to Linux. I've bought myself an old PC on which I installed Ubuntu. I followed a tutorial and managed to install it. I should note that the PC came with an old HDD.

Now I have my movie collection on /home which takes around 1.2TB of space in total. Because the HDD is old, the PC is quite slow. I decided to buy myself an SSD on which to reinstall Ubuntu to make things faster. Now this is my problem which i don't know how to resolve: If I reinstall the OS on another drive I will need to delete Ubuntu from the old HDD but I don't want to erase my movie collection. I want to keep it on that HDD without the OS, which I would reinstall on the new SSD. How can I do that without formatting the HDD? Thanks in advance and sorry if I posed a silly question!

Zanna
  • 70,465
King1212
  • 71
  • 4

2 Answers2

7

You can keep the hdd as storage and install Ubuntu to the SSD.

First, to be safe, you can unplug the HDD and just do the installation for the SSD while the HDD is unplugged.

Then, make sure the SSD is the first boot device in your BIOS settings to prevent the HDD from booting your old installation.

After installation, plug in both drives and when you boot Ubuntu, you will be able to access the HDD as a storage device.

You can either leave your old Ubuntu installed on the HDD and it won't make a difference or you can delete the old system files individually. Just be careful not to delete your movie files (and probably make a backup first just in case). However, the old system files really won't take up much space.

If you have any trouble or if you're about something let me know. Thanks!

mchid
  • 43,546
  • 8
  • 97
  • 150
  • Thanks for the help! But after i reinstall the os on the ssd and boot up with both drives on, will there be an option on boot to mark the hdd just for storage space? – King1212 Jun 11 '20 at 15:22
  • 2
    @Kiningston I don't think so. The BIOS settings should allow you to select which disk to boot from or which disk should have priority over the other during the boot process. After you boot, the HDD should show up as an extra storage device. – mchid Jun 11 '20 at 15:28
  • 1
    @Kiningston It will act as storage space unless you boot directly from that disk. Later on (after some updates), you might end up with the option to boot from the HDD on your GRUB menu but you can just ignore the option. – mchid Jun 11 '20 at 15:32
  • Ok thank you very much! So in summary i can't delete the os altogether? I just need to delete the files separately? Thanks again! – King1212 Jun 11 '20 at 15:50
  • 1
    After you install Ubuntu in the SSD and boot from it, and can access the old HDD, you can delete all the folders in the old HDD except /home. All your (and other users') personal files are in that folder. You can delete the rest folder by folder not file by file. – user68186 Jun 11 '20 at 16:08
  • 1
    @Kiningston It is often said in linux that "everything is a file" so if you delete the system files, you will essentially delete the OS. Assuming your movies are in your home directory, just delete all the files except for all the files under /home like user68186 said. – mchid Jun 11 '20 at 16:15
  • That's slightly imprecise and depends on how the disk for original Ubuntu installation was partitioned. An insight into partitioning is necessary. – Pawel Debski Jun 12 '20 at 08:07
4

That's perfectly possible:

  • as mentioned in the other answer for safety unplug the old drive,
  • install new drive
  • install Ubuntu on the new drive, make sure it works, update it
  • advanced option is to use LVM during installation - it will give you most flexibility and your skills will have grown
  • this question discusses advantages and disadvantages and gives good overview: What is LVM and what is it used for?
  • once you're satisfied with your new Ubuntu installation plug-in old drive and mount selected partitions
  • if your old install was using LVM you may need to import volume group before you can see the old partitions (logical volumes in LVM terminology)
  • details here: http://tldp.org/HOWTO/LVM-HOWTO/
  • after you can see the partitions and you are able to mount them manually you can add entries in /etc/fstab so selected partitions get mounted when the system boots up
  • here is the detailed guide: https://help.ubuntu.com/community/Fstab

For example my data drive is mounted over /home/user/data

This way your old drive is accessible in this directory while everything else resides on the new one.

If during the process you do not understand anything or something does not work as expected I encourage you to ask separate questions or enhance this one.

While fiddling with the old drive is all too easy to break the drive structures and loose the data.

Later you can also delete old Ubuntu installation from the 2nd drive and reclaim the space - the exact process depends on how the old Ubuntu was installed and whether you used LVM.

Once you have your both drives up and running describe the install and post the output of sudo fdisk -l command so we can help you reclaim the space.

Pawel Debski
  • 2,704
  • 8
  • 28
  • 40
  • Ok will do! I will update you next week i think. Thank you very much! Also should i install xubuntu to make things even faster? – King1212 Jun 11 '20 at 16:06
  • Better ask a separate question - it is not advisable to mix two topics in one question. – Pawel Debski Jun 11 '20 at 16:09
  • Ok so i've just done it. It works fine. But now i have another problem. Because the old hdd is 2 tb i want to install things in it through qbittorrent. Whenever i want to specify the place i want my downloaded torrents to go( to the old hdd) qbittorrent says access denied. Also I want to share it on my network with samba. I've managed to get it working but after I rebooted the pc I can't access the share anymore... So what can I do to resolve these 2 problems? Thanks! – King1212 Jun 25 '20 at 11:09
  • Most probably you need to chown (change owner) of the directories of old drive, as user ids probably differ between installations. There are numerous other relevant questions on this site plus other guides in the Internet. – Pawel Debski Jun 25 '20 at 20:48