LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-11-2015, 12:58 PM   #1
willc86
Member
 
Registered: Dec 2014
Posts: 56

Rep: Reputation: Disabled
linux server out of space; what is best option


Hey guys,

From researching, I came across 3 different methods to do this; however, just need some recommendations.

my drive @ 150GB is out of memeory

-I have a spare 150GB memory that I can add for free. can I combine the 2 drives? or use a raid 5?

-but a new 1TB hard drive, use clonezilla to back it up and restore it back on the 1TB

-add the 2nd 150gb HD and use LVM?

what do you guys recommend
 
Old 05-11-2015, 01:09 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
1 - You can't combine them without reinstalling the OS. You can split up your directories though, put some of them on one drive, some on another. It depends on how your space is being used right now. Is the 150 GB more or less split between 2+ locations, or is it all being used in one directory (movie archive or something)?

2 - Possible, but I would recommend just installing from scratch on the 1 TB and using the current drive to re-load your files/settings once the new OS is up

3 - Unless you're already using LVM, that would require you to reinstall the OS as in #1.

RAID 5 requires 3+ drives. You could do RAID 0, but again you're back to reinstalling the OS, loading your files from a backup, etc.

Last edited by suicidaleggroll; 05-11-2015 at 01:10 PM.
 
Old 05-12-2015, 10:08 AM   #3
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,479

Rep: Reputation: Disabled
As you have been happy with your current set up, I would just add the extra disk, move some data off your current drive, change your fstab to use/point to the new disk.
 
Old 05-12-2015, 11:20 AM   #4
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,672

Rep: Reputation: 486Reputation: 486Reputation: 486Reputation: 486Reputation: 486
As fatmac says, assuming your second 150Gb drive is going to be for data; music, video, pictures, or whatever you can just mount it somewhere in your system's home directory.

For example, if you make a directory within your home directory called, say, My_stuff then mount your second disk to My_stuff.
Code:
 mount /dev/sdx /home/My_stuff
where "sdx" is your new drive.

Then, when you access the My_stuff folder in your home directory you're actually on your "new" disk.

In Linux the file system is a tree and everything on the tree is a file, even a disk. Like a Christmas tree bauble, you can hang it anywhere you want on the tree. (though some places are obviously more logical than others!!)

Play Bonny!

 
Old 05-12-2015, 11:45 AM   #5
willc86
Member
 
Registered: Dec 2014
Posts: 56

Original Poster
Rep: Reputation: Disabled
ah ok!

so, I was thinking about just buying a 1TB hard drive. this server is mainly a backup for all my virtualization VDI, clonezilla images, and samba share applications.

so, I can just add a 1tb to the current desktop server, then just move it over to the 1tb? but I am going to have to mount it first; """"mount /dev/sdb /files/backup""" that is where I keep all my back up in the current /dev/sda.

I wont have to alter all my rsync scripts or anything like that, right? it will just point right to it? I am just going to keep my 150gb plus add a 1tb.
 
Old 05-12-2015, 12:20 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Pretty much, yes. You'll want to mount it somewhere else temporarily, copy over the files, and then remount it in its final home, eg:

Code:
mkdir /mnt/temp
mount /dev/sdb1 /mnt/temp
rsync -av /files/backup/ /mnt/temp/
mv /files/backup /files/backup.old
mkdir /files/backup
umount /mnt/temp
rmdir /mnt/temp
mount /dev/sdb1 /files/backup
Make sure you understand what each of these commands is doing and pay attention to the output. Don't remove /files/backup.old until you're sure the files have been copied over correctly, etc.
 
Old 05-12-2015, 01:09 PM   #7
kc5hwb
Member
 
Registered: Jun 2001
Location: Grapevine, Texas
Distribution: Ubuntu 14.04, CentOS 7
Posts: 102

Rep: Reputation: 15
Set it up as a logical volume, then you can add more space to it whenever you want. You'll have to backup, repartition your current drive (assuming it isn't LVM partitioned, currently) then restore everything. But the next time this issue comes up, you can just run a lvextend command and add as much space to it as you want without disrupting any of your current files.
 
Old 05-12-2015, 05:56 PM   #8
standards
Member
 
Registered: May 2015
Posts: 54

Rep: Reputation: Disabled
I like 1 and 2,BUT i think you should see if there is anything you can delete.
 
Old 05-12-2015, 06:55 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I agree with @kc5hwb - if this is an unused drive going in, and there is the prospect of this needing more space in the future (like adding that 1T), LVM is absolutely made for this.
No need for reinstall of anything - just create the lv, copy the data and extend when necessary. All simple commands, mostly "one off".
 
Old 05-12-2015, 08:42 PM   #10
willc86
Member
 
Registered: Dec 2014
Posts: 56

Original Poster
Rep: Reputation: Disabled
ok guys, this is what I did

I just added my 1tb hard drive, and also keeping my 150gb

I created a whole partition for /dev/sdb1 and mounted it to /backups
I also edited to /etc/fstab

As of now, I am going to change the paths of all my rsync scripts to point to /backups instead.
so right now, I have /backups. I am thinking of moving all my files over there now and keeping the 150gb free for swap and home user stuff.

would you say this was a good idea?

I do have one question,

how do I know /backups is linked to /dev/sdb1 ?
I tried stat backups but nothing shows up. I know I can use df -h and I see it there, but is there another sure way?

thanks for all of your help! Ill also keep you guys updated! and run a clonezilla from /backups to make sure it works
 
Old 05-12-2015, 09:14 PM   #11
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
Quote:
how do I know /backups is linked to /dev/sdb1 ?
Your entry in fstab would do that.
 
Old 05-13-2015, 05:05 AM   #12
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
1. Just use the bare 'mount' cmd (no args) and it'll show you current mounts
2. cat /etc/mtab
3. lsblk
 
Old 05-13-2015, 05:20 AM   #13
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
As this thread is about evaluating the different options, I hope this isn't too OT...
Quote:
Originally Posted by kc5hwb View Post
Set it up as a logical volume, then you can add more space to it whenever you want. You'll have to backup, repartition your current drive (assuming it isn't LVM partitioned, currently) then restore everything. But the next time this issue comes up, you can just run a lvextend command and add as much space to it as you want without disrupting any of your current files.
So if an LV spans several disks and one fails, you loose the lot?
Or is it possible to (fairly easily) rebuild / salvage what is on the unfailed disks?

Most info I've found in my (so far pretty cursory) searching assumes or recommends running LVM on top of RAID for any sort of redundancy/fault tolerance.
 
Old 05-13-2015, 05:42 AM   #14
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Yep, LVM on its own is a bit like RAID0; its all good until breaks ...
I'd just mount it at a given dir and ensure I've got backups.
 
Old 05-13-2015, 05:57 AM   #15
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
You always need backups. No RAID level can protect you from "rm ..." or "mkfs ..."

snapshot - then backup the snap at your leisure.
Personally I reckon the OP missed a great opportunity to add some flexibility.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Why does Gparted give the option to delete my drive space? LAPIII Linux - Hardware 5 02-15-2011 10:12 AM
How to free up space on a Linux Red Hat Server running Kerio Mail Server ohioguy47 Linux - Newbie 6 08-04-2008 08:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration