I'm a new linux user and when I was installing Ubuntu, I have created 2 partitions: first (50gb) for /root folder (not sure but something like that) and second one for /usr folder (I thought all the user files stored there as seen that programmes are being installed there. So I'm facing a problem where my Downloads folder is on a first partition which is only 50gb. Is there a way to resize them / delete second partition and extend first one without losing /usr data?
Since you are a new Linux user, as hschou stated, please avoid creating a suite of partitions. It will only cause you grief. Get comfortable with Linux first, then play with partitioning schemes.
At this point, to be honest the simplest option is for you to start over. Back up whatever you want to keep and re-install Ubuntu with only two partitions: swap and for / (everything else).
To answer your question: no, that would wipe out /usr. For example if you have something like this:
----------------------------- | sda1 | sda2 | -----------------------------
And you delete sda2 in order to make sda1 larger you'll erase whatever is in sda2.
Now, if the contents of sda2 can fit into the filesystem in sda1, then it'd be possible to do what you're asking, but it's a delicate task; not recommended for those new to Linux.
For completeness, you cannot add space to the front of a partition. You can only add to the back. For example, using the same partitioning example, if you wanted to remove sda1 to enlarge sda2 into it, that won't work at all. You'd have to backup/restore to address that.
In conclusion, your best bet is to reinstall Ubuntu.
You can use bind mounts to mount directories. Assuming your
Downloads directory is
/home/jbwz/Downloads you can create a directory
/usr/JbwzDownloads (or whatever name you want, but it must be under
/usr) and move all the files in
/home/jbwz/Downloads into it.
Then add to
/home/jbwz/Downloads /usr/JbwzDownloads none bind
The key thing to remember is that if you delete
/usr/JbwzDownloads the files in
/home/jbwz/Downloads will get deleted too. While it will look like you have two copies of every file, you do not.
Slightly better would be to bind mount
/home, but moving all files from
/usr/home is a bit tricky as some files might be locked. The easiest way is probably to log in as root in a tty.
The best way is to fix your partitions by carefully moving things around. It can be a good learning experience, but make sure you have a backup of all your data and a live cd to recover from. The steps are something like
- Boot into a live cd
- Mount your two partitions
- Move everything in the 2nd partition into a directory called
- Move everything in the 1st partition to the 2nd partion (assuming there is space)
- Delete the 1st partition
- Resize the 2nd partition
- Edit fstab
Where's your /home partition?? and why was the reason to create only two partitions??
Usually when you installing Manually an OS Linux must create four partitions:
/dev/sxx - / (root)
/dev/sxx1 - /home (The directory that you have your user files Music, pictures)
/dev/sxx2 - /boot (The booteable option if you have both OS)
/dev/sxx3 - SWAP (The partition that support to you OS' process)
I think you're some confused about partitions for Linux. Check this link: https://en.wikipedia.org/wiki/Disk_partitioning
And about the partition resizing I got my own way: you must emulate an OS from live-storage (Live USB, etc) save the necessary files, and erase the partition that you want resize through Gparted, cfdisk and finally reinstall the OS with the partitions that I told you before.
I hope this answer gonna be clear some questions about your trouble. Greetings!