LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   backup issues (https://www.linuxquestions.org/questions/linux-desktop-74/backup-issues-703433/)

siawash 02-09-2009 03:36 PM

backup issues
 
Hi my pclinux grub kept giving error tmp directories full. Same thing for root and user.

I want to backup my home directory to my usb music player. When I boot into as text mode. I have an external usb drive with two ntfs partitions.
I also have an 18 gig COWON IAUDIO7 media player.

When I can use

cd /media

I get

disk/ disk-1/ disk-2/ I AUDIO7/ I AUDIO7-1

I can cd into disk, disk-1, disk-2 and don't recognize anything on the ntfs drive.

When I try to cd into I AUDIO7 i get "no such file or directory"

Please help I have to got to backup my /home directory

w1k0 02-09-2009 03:50 PM

I AUDIO7 directory's name has a space inside. Try cd "I AUDIO7" command (put directory's name in quotes).

siawash 02-09-2009 04:01 PM

that's great! Now I can go into the I AUDIO7 directory.

But now when I do

cp /home/username /media/"I AUDIO7"

I get

cp: omitting directory '/home/username'

siawash 02-09-2009 04:05 PM

and the strange thing is when I cd into I AUDIO7 and I AUDIO7-1 it does not show any of the files I recognize.

I did not deliberately create two partitions. So what is I AUDIO7-1?

repo 02-09-2009 04:05 PM

Use
Code:

cp -R

siawash 02-09-2009 04:06 PM

In fact none of the disks show any files?????

siawash 02-11-2009 11:50 AM

could some body help me with this?

I cannot boot into kde

I have the console but don't know how to copy my home directory to external usb hard drive.

I can see the the drive when I do

cat /proc/scsi/scsi

i just don't know what the name of the drive is when I write to it.

Please help

repo 02-11-2009 11:56 AM

What is the output from
Code:

dmesg
when, you plugin the drive?
What is the output from
Code:

fdisk -l
with the drive attached?

jschiwal 02-11-2009 12:10 PM

You could start by logging into the terminal as root and deleting all of the files in /tmp. Then reboot and see if you can login normally.,

To write to an ntfs filesystem, use the ntfs-3g filesystem. This is a fuse module. You may need to install the fuse & ntfs-3g filesystems.

You can try mounting your external drive manually. First you need to know which device it is. Monitor /var/log/messages while inserting the external drive. See which partition(s) is(are) detected.
sudo tail -f /var/log/messages

Another way is to use "fdisk -l" and see which partitions are ntfs:
Code:

/dev/sda4          23198      24322    9027584  17  Hidden HPFS/NTFS

You can look up details about a particular partition using "udevinfo".
Code:

udevinfo -q env -n sda4
ID_VENDOR=ATA
ID_MODEL=TOSHIBA_MK2049GS
ID_REVISION=LC00
ID_SERIAL=SATA_TOSHIBA_MK2049G_48CYT01OT
ID_SERIAL_SHORT=48CYT01OT
ID_TYPE=disk
ID_BUS=scsi
ID_ATA_COMPAT=TOSHIBA_MK2049GSY_48CYT01OT
ID_PATH=pci-0000:00:1f.2-scsi-0:0:0:0
ID_FS_USAGE=filesystem
ID_FS_TYPE=ntfs
ID_FS_VERSION=3.1
ID_FS_UUID=7CEC8E10EC8DC4BC
ID_FS_UUID_ENC=7CEC8E10EC8DC4BC
ID_FS_LABEL=HDDRECOVERY
ID_FS_LABEL_ENC=HDDRECOVERY
ID_FS_LABEL_SAFE=HDDRECOVERY

Suppose that the external drive is /dev/sdb and the first ntfs partition is /dev/sdb1.
Code:

# make sure the fuse kernel module is loaded
sudo /sbin/modprobe fuse

# create a mount point under /mnt
sudo mkdir /mnt/ntfs_1

# mount the ntfs filesystem
sudo mount -t ntfs-3g /dev/sdb1 /mnt/ntfs_1 rw,uid=<yourusername>,fmask=0117,dmask=0007,utf8

# backup your /home directory
tar -C / -cxzf /mnt/ntfs_1/home_bu.tar.gz /home

Here I used the tar program. Since you are backing up to an ntfs filesystem, it won't save the permissions, attributes or acls for the files. Creating an archive backup, this metadata is saved as well.

You might want to read Section 5.2 of the "tar" info manual. It covers using the -g option for incremental dumps. You could use this option and backup only new files in the future.

siawash 02-11-2009 12:52 PM

many thanks for all the replies. First of all to clarify a few changes since my initial post. I had a spare drive which I formatted in reiser fs and using as external usb drive.

When I do fdisk-1 I get


/dev/hda1 swap ( bootable ) (start at 1) end at 219 id 82 swap ( blocks 1759086 )
/dev/hda2 / start at 220 end at 1422 / ( blocks 9663097 )
/dev/hda3 start at 1423 end at 7296 ( blocks 47182905 ) id 5 extended
/dev/hda5 start at 1423 end 7296 ( blocks 47182873) id 83 linux


If i remember correctly hda2 is root partition.
Swap is self explanatory
I know I had left arount 48 gig for /home but don't if if that translates into had3 or hda5. The whole hard drive is no more than 60 gigs.

Lower down from the fdisk table i have:

Disk /dev/sda: 160 GB 160041885696

Device boot: /dev/sda1
start: 1
End: 19457
Blocks: 156288321
Id: 83
System: linux


I am logged in as root

cp -R /home/username/ /dev/sda1/my_backup

or

cp -R /home/username /dev/sda1

I get following error:

cp: accessing '/dev/sda1/my_backup': not a directory

siawash 02-11-2009 12:54 PM

BTW it was when I tried to delete the tmp files that now I am prevented logging in KDE. I now realize i deleted a couple of files with the .kde extension which I should have done.

I have to learn a good backup method for the future. I prefer the console method.

repo 02-11-2009 01:04 PM

you first need to mount the drive
Code:

mount /dev/sda1 /mount

siawash 02-11-2009 01:08 PM

When i do

mount /dev/sda1 /mount

I get

mount: mount point /mount does not exist

repo 02-11-2009 01:15 PM

then you need to create it
Code:

mkdir /mount

siawash 02-11-2009 01:19 PM

i am now getting

mkdir /mount
mkdir: cannot crate directory '/mount': No space left on device

This very strange because the internal hard drive should have plenty of space
I am under the [root@username /]# directory

repo 02-11-2009 01:25 PM

do ls, and mount on an existing directory like /temp or /tmp or /media or /mnt
Another option, cd to /var/log and delete all the backup logs, like syslog.0,syslog.1,messages.1.gz and so on to free up some space
what is the output from
Code:

df -h

siawash 02-11-2009 01:32 PM

i just did

df -h -T

and got

/dev/hda2 type ext3 size 9.1 gig available 0% use 100% /
/dev/hda2 type ext3 size 45 gig available 22 gig used 52% /home

so can i mount sda1 on the /home partition?

siawash 02-11-2009 01:37 PM

i just did

df -h -T

and am getting

/dev/hda2 type ext3 size 9.1 gig used 9.1 gig available 0% used 100% mounted on /
/dev/hda3 type ext3 size 45 gig used 23 gig available 22 gig used 52% mounted on /home

I am wondering if i can mame the mount directory on /home

let me check to boot logs

repo 02-11-2009 01:37 PM

yes
mount it on /home
then do
cp -R /home/user /home/mountpoint

siawash 02-11-2009 02:58 PM

i am doing that. I created a directory called mount on the home dir
then

cp -R /home/username /home/mount

After this is done, do i just

cp -R /home/mount /dev/sda1

?????

repo 02-11-2009 03:07 PM

You created the directory mount in your home directory.
So this will act as the mounting point.
Now issue the following command
Code:

mount /dev/sda1 /home/mount
this will attach your external drive at
/home/mount
now type
Code:

cd /home/mount
there you will see the drive
then type
cp -R /home/user /home/mount
This will copy your home directory to the drive

When finished, first unmount the drive before you remove it
Code:

umount /dev/sda1

siawash 02-11-2009 04:40 PM

i have a very slow pentium III. It is still copying files onto the external drive.

Thank you very much!!!

I will let you know how i get on.

Another thing you might like to do for me is give a simple explanation on the concept of attaching the external drive to /home to fstab.

BTW do you know any good online LPI courses?

I have been looking all over but very difficult finding one. I also heard LPI organization are updating the exams at April. So how can i be sure exam materials are up to date?

jschiwal 02-12-2009 10:07 PM

One thing I don't think you realize is that the files in /dev/ are special files and not the partitions themselves. You have been using them inappropriately in prior posts. See the manpage for mount and mknode for maybe a better understanding. The mounting is performed by the kernel. It it actually the major and minor numbers of the file (rather than the name) that the kernel uses. Unix (and Linux) has a single root filesystem and all other partitions are mounted over directories under the root (/) filesystem.


All times are GMT -5. The time now is 04:06 PM.