LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-13-2006, 09:31 PM   #1
cbxroger
LQ Newbie
 
Registered: May 2006
Location: Hawaii
Distribution: Ubuntu
Posts: 15

Rep: Reputation: 0
Copying Files From HDB to HDA


I am currently running Ubuntu 5.10. Previously I had different versions of Ubuntu on different computers. I installed two hard drives on this box and want to copy data files from hdb to hda. All prior attempts have failed. I have a Damn Small Linux live CD and tried to use that for the transfer. No luck.

I went through most of the answers about dual drives and dual boots without finding the proper process. Can some one help me?

The box is a 450 mhz pentium clone and both hard drives are Westen Digital, 40G and 120G.

Thanks,
Roger in Hawaii
 
Old 08-14-2006, 02:11 AM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo on headless; Arch on everything that requires a GUI
Posts: 6,942

Rep: Reputation: 136Reputation: 136
Roger,

Welcome to LQ!

Please post the output of "fdisk -l" issued in a terminal as root.
And if you would be so kind as to put [_code_] without the underscores
before your output, and [_/code_] without the underscores after your
output, that would make it easier for us to read.

Bruce in China
 
Old 08-14-2006, 12:20 PM   #3
cbxroger
LQ Newbie
 
Registered: May 2006
Location: Hawaii
Distribution: Ubuntu
Posts: 15

Original Poster
Rep: Reputation: 0
Bruce in China

This is the output from fdisk -l

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 4772 38331058+ 83 Linux
/dev/hda2 4773 4865 747022+ 5 Extended
/dev/hda5 4773 4865 746991 82 Linux swap / Solaris

Disk /dev/hdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 1275 10241406 83 Linux
/dev/hdb2 12834 14593 14137200 5 Extended
/dev/hdb3 1276 3825 20482875 83 Linux
/dev/hdb4 * 11247 12833 12747577+ 83 Linux
/dev/hdb5 14551 14593 345366 82 Linux swap / Solaris
/dev/hdb6 14508 14550 345334+ 82 Linux swap / Solaris
/dev/hdb7 14465 14507 345334+ 82 Linux swap / Solaris
/dev/hdb8 14422 14464 345334+ 82 Linux swap / Solaris
/dev/hdb9 12834 14421 12755547 83 Linux

Roger in Hawaii
 
Old 08-14-2006, 02:32 PM   #4
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
My guess is that you just haven't mounted one of the drives. What actual actions/commands did you attempt to perform the copy? Assuming that both drives are being mounted, you can just drag and drop the files from the source directory to the target directory.

Could you also post your fstab (in the /etc directory) and the output of "df" (no quotes)
 
Old 08-14-2006, 09:22 PM   #5
cbxroger
LQ Newbie
 
Registered: May 2006
Location: Hawaii
Distribution: Ubuntu
Posts: 15

Original Poster
Rep: Reputation: 0
The results of my /etc/fstab are as follows:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0

The results of my drive free (df) follow:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda1 37729628 4122376 31690700 12% /
tmpfs 193412 0 193412 0% /dev/shm
tmpfs 193412 12588 180824 7% /lib/modules/2.6.12-10-386/volatile


I see that hard drive 'B' is not in either file.

I printed Tyler Burns tutorial "/etc/fstab broken down and explained" and attempted to edit the fstab file. My results were less than encouraging, and when I locked myself out of Ubuntu, I learned how to use the rescue boot. I also had to learn how to edit with vim. But I now have things back as they were.

How do I proceed to get hard drive 'B' into the system?

Roger in Hawaii
 
Old 08-15-2006, 04:35 AM   #6
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo on headless; Arch on everything that requires a GUI
Posts: 6,942

Rep: Reputation: 136Reputation: 136
You can edit /etc/fstab with a more intuitive editor, such as pico
or nano, if you have those on Ubuntu.

This is my server's fstab using four drives:
Code:
root@paul:/home/mingdao# cat /etc/fstab
/dev/sda1        swap             swap        defaults         0   0
/dev/hda1        swap             swap        defaults         0   0
/dev/hda2        /                reiserfs    defaults         1   1
/dev/hda3        /tmp             reiserfs    defaults         1   2
/dev/hda5        /home            reiserfs    defaults         1   2
/dev/sdb1        /backup          reiserfs    defaults         1   2
/dev/sda2        /var             reiserfs    defaults         1   2
/dev/hdc1        /backup2         reiserfs    defaults         1   2
/dev/cdrom       /mnt/cdrom       iso9660     noauto,owner,ro  0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
The first field, (fs_spec), describes the block special device or remote
filesystem to be mounted. Yours would be /dev/hdbx where x is whichever
partition(s) you would like to mount.

The second field, (fs_file), describes the mount point for the filesystem.
Since you don't have any, you would need to make them and give them the
proper permissions.

The third field, (fs_vfstype), describes the type of the filesystem.

The fourth field, (fs_mntops), describes the mount options associated
with the filesystem.

The fifth field, (fs_freq), is used for these filesystems by the dump
command to determine which filesystems need to be dumped. If the fifth
field is not present, a value of zero is returned and dump will assume
that the filesystem does not need to be dumped.

The sixth field, (fs_passno), is used by the fsck program to determine
the order in which filesystem checks are done at reboot time.

You can read these by issuing "man fstab" in a terminal. I've never seen
a "fdisk -l" output such as your hdb. I thought everything after the extended
partition automatically started at 5 -- guess I was wrong. I don't even see
how that can work. You have:
/dev/hdb1 from 1 to 1275
/dev/hdb2 from 12834 to 14593 (as extended)
/dev/hdb3 from 1276 to 3825
/dev/hdb4 from 11247 to 12833 (but where are blocks 3826 to 11246?)
then /dev/hdb5 through /dev/hdb9 are in reversed order.

I don't know what systems you have in hdb, or which ones you want to mount.
But if you could share that, we'd be glad to give you an example. This is just
a for instance, but might help you to proceed.

Say that /dev/hdb1 is the previous Ubuntu / (root) filesystem, /dev/hdb3 is the
previous Ubuntu /home filesystem. You could use:
Code:
/dev/hdb1        /Ubuntu-root            reiserfs    defaults         1   2  <-- if not reiserfs, change it appropriately
/dev/hdb3        /Ubuntu-home            reiserfs    defaults         1   2  <-- if not reiserfs, change it appropriately
How to mount if other than "defaults" depends upon the filesystem of the
partition and you're intended use, i.e., read/write, read-only.

If you just need to temporarily copy files, you could issue as root:
mount -t reiserfs /dev/hdb1 /mnt/hd
again, assuming reiserfs is the filesystem, and you have the mount point
of /mnt/hd in your system.

Then you could issue as root:
cp -a /mnt/hd/file /destination/mount/point/
and it would copy the files and keep the timestamp and permissions intact.
 
Old 08-15-2006, 04:03 PM   #7
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
Quote:
Originally Posted by Chinaman
If you just need to temporarily copy files, you could issue as root:
mount -t reiserfs /dev/hdb1 /mnt/hd
again, assuming reiserfs is the filesystem, and you have the mount point
of /mnt/hd in your system.

Then you could issue as root:
cp -a /mnt/hd/file /destination/mount/point/
and it would copy the files and keep the timestamp and permissions intact.
Chinaman's above advice ought to do the trick. If /dev/hdb1 refuses to mount, then its possible that a basic problem with the hard drive is the trouble, such as a bad jumper setting or that a cable isn't plugged in correctly
 
Old 08-19-2006, 02:31 AM   #8
cbxroger
LQ Newbie
 
Registered: May 2006
Location: Hawaii
Distribution: Ubuntu
Posts: 15

Original Poster
Rep: Reputation: 0
Chinaman and J.W.

I used the temporary mounting that Chinaman suggested for hdb and 'mount' showed that it was mounted. But copy (cp) ignored my efforts to actually copy files from hdb3 to hda1.

Tonight I loaded Damn Small Linux and got both hdb3 and hda1 mounted again. With your suggestions printed out in front of me, I kept trying cp. I realized that I must not have the syntax right. So I tried many variations. Suddenly the light bulb came on! I had not been properly identifying the different hard drive partitions correctly.

Thus I tried cp -a /mnt/hdb3/home/roger /mnt/hda1/home/roger and the computer proceeded to copy all my data files and pictures from hard drive b3 to hard drive b1.

Originally I had these two hard drives in two different computer boxes and had many versions of Ubuntu loaded in many partitions. I installed both hard drives in a different box and now want to move files around. Ultimately, I want to clear most of drive "B" and make partitions for photos, OO files, PDF files, Music, and etc. That will make it easier to back up data to a USB external drive.

Thank you very much for your patience and you willingness to provide your expertise with the newbies.

Roger in Hawaii
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
hda hdb hdc aydindemirci Linux - Newbie 7 02-16-2006 01:55 AM
transfering files from xp on hda to fc2 on hdb. dr_zayus69 Linux - Hardware 2 01-31-2005 06:44 AM
Accessing files on hdb from hda mimsmall Linux - Newbie 4 02-10-2004 12:43 PM
tried to move files from hdb to hda... sirpelidor Linux - Newbie 2 01-16-2004 02:44 AM
moving the HD from hdb to hda NGraphiX Linux - General 2 10-07-2002 04:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:02 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