Re: How do I "see" a hard drive?



"JohnW" <news@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> writes:
If try to run fdisk in any of the forms that anyone has mentioned so far I
simply get "bash: fdisk: command not found"

Maybe it's not in the path. On my Debian box I have "/sbin/mac-fdisk".

1. Can I actually get a directory listing?

You would have to mount the partition first.

I've tried most of the "mount"
options you've all suggested here's a few of the results:-
I type: mount /dev/hda3
response: mount: can't find /dev/hda3 in /etc/fstab or /etc/mtab

Then you have to specify at least also the mount point (e.g.,
/mnt/hda3), i.e.,

mount /dev/hda3 /mnt/hda3

Add -t <fstype> and -o ro as appropriate.

I type: mkdir /mnt/hda2
response: mkdir: cannot create directory '/mnt/hda2': Permission Denied

You probably need to be root to do this, and to mount the partition.

2. Anton suggested using dd if=/dev/hda of=/dev/sda to copy the whole lot to
an external hard drive. I have a big enough drive with plenty of space on it
but it's not empty.

That command will destroy what's on the drive.

This is my backup disk - will I be able to do what I
need to without destroying the data that's already on there?

You can do that by mounting a partition from the backup drive with
enough free space, and then copying the hard disk contents to a file.

If you want compression, you can do it with

dd if=/dev/hda|gzip -c >/mnt/sda1/hda-image.gz

The USB drive is formatted as FAT32 (so that I can use it on
a variety of computers in the house) is this a problem?

I believe that FAT32 does not support files >2GB (not sure, though),
so you may want to split the file into, say, 1GB chunks, with
something like:

dd if=/dev/hda|gzip -c|split -b 1024m - /mnt/sda1/hda-image.gz.

The reverse operation is:

cat /mnt/sda1/hda-image.gz.*|gzip -cd|dd of=/dev/hda

You might want to check that it works while you still have the old disk:

cat /mnt/sda1/hda-image.gz.*|gzip -cd|diff --report-identical-files - /dev/hda

Caution: all untested.

- anton
--
M. Anton Ertl Some things have to be seen to be believed
anton@xxxxxxxxxxxxxxxxxxxxxxxxxx Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html
.



Relevant Pages

  • Re: Clone HDD
    ... Partition the new hard disk in the SAME ORDER, such that, the device ... rewriting of the boot sector on the ... Once partitioned, each partition must be "formatted" before mounting. ... may be mounted under a mount point, and the content copied on to them. ...
    (comp.os.linux.misc)
  • Re: small linux build advanceCD combined with rw partition
    ... hard disk, ... There's a bug in the "install to disk" function, ... In this script it would be possible to mount a fat32 partition ...
    (comp.os.linux.misc)
  • mounting fat32 IDE hard disk error: "does not contain valid partition table"
    ... I am among those bloody linux beginners and I am stuck with ... I have tried to mount my 2nd IDE hard disk which contains only data ... It is a 13.5 GB HD from IBM and it is only one partition. ...
    (comp.os.linux.setup)
  • Re: Problem with random disks mount sequence
    ... I'll get random mount sequences. ... At the beginning the USB ... nautilus remember that 'storage3' was 1st partition, ... SCSI drives are listed by order of discovery. ...
    (Fedora)
  • Re: Relabel partition didnt work
    ... > You're confusing disk lables with mount points. ... > When installing etch, at some point partman asked for a mount point for ... > that partition and I entered /xyz. ... There's nothing to do to the second hard disk. ...
    (Debian-User)