View Full Version : linux server backup
BubikolRamios
10-13-2009, 12:39 PM
[root@linux ~]# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 60801 488279610 8e Linux LVM
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 60801 488384001 8e Linux LVM
1, have two HD-s on system, each 500GB, as I'm win man, it annoys me I can't see if one of disks is emty or not, as I want it to be, reserved for backup. How can I get that info ?
2.recomendations how/ with _what to backup things to enable
total restore of ewerything , possibly via ssh.
2.1. yeh I googled there http://www.thefreecountry.com/utilities/backupandimage.shtml, but need info if anything of those, or other things are simple and made for beginners.
Thanks.
drhowarddrfine
10-13-2009, 02:58 PM
1) You want to use df or du.
2) rsync
Spookster
10-13-2009, 09:57 PM
There are also GUI based tools that come with most linux distros that show you resource usage like processor, memory and file system usage.
BubikolRamios
10-14-2009, 12:42 AM
yeah I was googling and found one for kde, it has file system usage , but not disk usage.
[root@linux ~]# df -h -T
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
ext3 898G 15G 837G 2% /
/dev/sda1 ext3 99M 12M 82M 13% /boot
tmpfs tmpfs 2.0G 0 2.0G 0% /dev/shm
hmm I can see there is total of 898 GB of space (somewhere near expected), and there is then on (disk1 = /dev/sda1) something.
how come '/dev/sdb' from first post does not appear here ?
I mean, basic thing here is: if I create a folder how can I tell to the OS, that it must be on disk /dev/sdb ?
oracleguy
10-14-2009, 01:55 AM
Well based on your previous post you are using LVM which looks like it has spanned the disks so they appear as one disk. I'm not sure if there is any way to force files to be on a specific disk. I haven't used LVM before, perhaps Spook can offer additional insight.
BubikolRamios
10-14-2009, 02:15 AM
hmm google educated me - on linux you create folder on file system and then mount disk to that folder, something like that ...
wiki says:
The LVM can:
Resize volume groups online by absorbing new physical volumes (PV) or ejecting existing ones
http://www.centos.org/docs/4/html/rhel-sag-en-4/s1-disk-storage-lvm.html
there they are: 2 pysical HD-s
[root@linux ~]# lvm lvmdiskscan
/dev/ramdisk [ 16.00 MB]
/dev/root [ 926.25 GB]
/dev/ram [ 16.00 MB]
/dev/sda1 [ 101.94 MB]
/dev/VolGroup00/LogVol01 [ 5.16 GB]
/dev/ram2 [ 16.00 MB]
/dev/sda2 [ 465.66 GB] LVM physical volume
/dev/ram3 [ 16.00 MB]
/dev/ram4 [ 16.00 MB]
/dev/ram5 [ 16.00 MB]
/dev/ram6 [ 16.00 MB]
/dev/ram7 [ 16.00 MB]
/dev/ram8 [ 16.00 MB]
/dev/ram9 [ 16.00 MB]
/dev/ram10 [ 16.00 MB]
/dev/ram11 [ 16.00 MB]
/dev/ram12 [ 16.00 MB]
/dev/ram13 [ 16.00 MB]
/dev/ram14 [ 16.00 MB]
/dev/ram15 [ 16.00 MB]
/dev/sdb1 [ 465.76 GB] LVM physical volume
3 disks
16 partitions
0 LVM physical volume whole disks
2 LVM physical volumes
drhowarddrfine
10-14-2009, 04:07 AM
We call them directories, not folders.
du is for disk usage as I mentioned above but I don't know anything about lvm (I'm a BSD guy).
Spookster
10-14-2009, 04:24 PM
Well based on your previous post you are using LVM which looks like it has spanned the disks so they appear as one disk. I'm not sure if there is any way to force files to be on a specific disk. I haven't used LVM before, perhaps Spook can offer additional insight.
I didn't notice that until you pointed that out. After a few bad experiences with LVM (Logical Volume Management) I will never use it again. Just as you said it allows you to make multiple disks appears as one so you can create large partitions that span more than one drive. The problem arises when that LVM gets corrupted which apparently is not hard to do. Once it's corrupted good luck trying to retrieve your data. It is suppose to allow you to shrink or grow the volumes whenever you need. Tried that and the application locked up in the process and my volume got corrupted and there was no way to recover from it. It used to be enabled on some distros by default but I always disable that option when installing.
Spookster
10-14-2009, 04:30 PM
yeah I was googling and found one for kde, it has file system usage , but not disk usage.
[root@linux ~]# df -h -T
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
ext3 898G 15G 837G 2% /
/dev/sda1 ext3 99M 12M 82M 13% /boot
tmpfs tmpfs 2.0G 0 2.0G 0% /dev/shm
hmm I can see there is total of 898 GB of space (somewhere near expected), and there is then on (disk1 = /dev/sda1) something.
how come '/dev/sdb' from first post does not appear here ?
I mean, basic thing here is: if I create a folder how can I tell to the OS, that it must be on disk /dev/sdb ?
In Linux/Unix world we don't care about disk usage so much as we do filesystem usage. In Linux you will likely have multiple partitions on one drive with different filesystems attached to each such as /(root), /boot, /var, /home, /swap, etc.
A plan I always use is to put /home which is all my user directories on it's own partition and in my case I always put it on a separate drive so whenever you want/need to reinstall your current distro of Linux or other distros you don't have to worry about backing up your user directories each time.
primefalcon
10-14-2009, 04:54 PM
A plan I always use is to put /home which is all my user directories on it's own partition and in my case I always put it on a separate drive so whenever you want/need to reinstall your current distro of Linux or other distros you don't have to worry about backing up your user directories each time.
That's actually very good advice, I do that all the time myself, saves a lot of hassle with backing up and restoring, this way you keep all your bookmarks and all your other preferences, really does save a lot of time, not to mention hassle.
It really helps too when you upgrade distro's which depending on the one you use can be pretty regular....
I used to do something similar way back when I used windows as well, as I got sick of restoring when something happened.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.