niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » Linux » powerpc
How do I "see" a hard drive?
Post new topic   Reply to topic Page 1 of 2 [16 Posts] View previous topic :: View next topic
Goto page:  1, 2 Next
Author Message
Unruh
*nix forums Guru


Joined: 22 Mar 2005
Posts: 1166

PostPosted: Sat Apr 29, 2006 6:24 pm    Post subject: Re: How do I "see" a hard drive? Reply with quote

"JohnW" <news@removethisbittoreplyhardcafe.co.uk> writes:


Quote:
"JohnW" <news@removethisbittoreplyhardcafe.co.uk> wrote in message
news:tF73g.11885$4k5.11524@newsfe4-gui.ntli.net...
I have a problem with my MacMini that I have a feeling is actually a dead
hard drive but before I send it away for repair (it's still under warranty
so I don't want to try to crack it open myself) I want to try to recover as
much data from it as possible (I've been using it as a "media" computer and
there are quite a few radio recordings on there that I haven't listened to
yet and that are now completely unavailable).

I have one more test I want to run that I don't have enough knowledge to
do - hopefully somebody can help.

My first hope was to try to reinstall OSX but I get halfway through the
setup procedure and it fails to list any possible destinations to install
it to. I also ran the Hardware test (on the Mac Install CD) which reported
that all hardware is working correctly!

I thought I'd try to run a Live Linux CD (ROCK Linux) which is successful
and have got KDE going but I still can't "see" any hard drives (the file
manager program lists a "hard drive" but that appears to be the CD that
I've booted from. This is roughly where my Linux knowledge ends!

The questions are these:

1. Having booted the Mac with Linux, should I be able to "see" the Mac
hard drive?

2. If I should be able to "see" it, how do I go about that? ie do I need
to mount it from the command prompt before starting Xwindows? If so,
exactly what should I type in?



Thanks for all your help so far - I've only just managed to get enough time
to have another shot at this...
I've now logged in as root so there's no need for anyone to shout at me
anymore;-)

Having now successfully entered many of the suggestions I think I know where
this is heading but I'll add here the results of what I've done.
I type: mkdir /mnt/hda2

You should have typed
mkdir /mnt/hda

Quote:
I simply get another command prompt
I type: mount /dev/hda3 /mnt/hda
response: mount point /mnt/hda does not exist

Because you did not create the mount point /mnt/hda in the previous
command.


Quote:
I type: cat /etc/fstab
response:
/dev/root / auto defaults 0 1
none /proc proc defaults 0 1
none /dev devfs defaults 0 1
none /dev/pts devpts defaults 0 1
none /dev/shm ramfs defaults 0 1
none /sys sysfs defaults 0 1
none /tmp tmpfs defaults 0 1

You have no hard disk in the /etc/fstab. This is celarly a Live
distribution.



Quote:
I type: mount /dev/hda2 -t ext3 -o ro /mnt/hda2
response: special device /dev/hda2 does not exist

ls /dev/hda*
If you see something then the system "knows" about your hard drive. If not,
then not.

fdisk -l /dev/hda
to see if the partition table can be read.

Quote:
I type: mount dev/hda2

you need the leading / and there is no entry for dev/hda2 in /etc/fstab so
mount has no idea what you want it to do.

Quote:
response:
mount: can't find /dev/hda3 in /etc/fstab or /etc/mtab

And now you are mistyping, since it would have said
can't fine dev/hda2 in /etc/fstab or /etc/mtab


Quote:
I type: mount /dev/hda3 /mnt/hda3
response:
mount point /mnt/hda3 does not exist

As I previously said, if I run cat /proc/partitions it appears that I can
actually see the drive.

And what is the ouput of this command? We need information to help you.

Again, you make it very hard for us to help you, but withholding
information, by mistyping, etc. What you type here is the only insight we
have to your machine. Believe me, none of us can see into your machine from
afar.


Quote:
Have I done all I can? If so, am I likely to have any utilities on my Linux

No, post the above information.

Quote:
CD that might attempt some sort of disk repair? I don't need to get at
everything from the drive just a couple of folders that I don't back up as
often as I clearly should!

Yes, it is still possible especially if you say cat /proc/partitions gives
results.





>Thanks again
Back to top
Anton Ertl
*nix forums addict


Joined: 20 Feb 2005
Posts: 91

PostPosted: Sat Apr 29, 2006 7:40 am    Post subject: Re: How do I "see" a hard drive? Reply with quote

"JohnW" <news@removethisbittoreplyhardcafe.co.uk> writes:
Quote:
I thought I'd try to run a Live Linux CD (ROCK Linux) which is successful
and have got KDE going but I still can't "see" any hard drives (the file
manager program lists a "hard drive" but that appears to be the CD that
I've booted from. This is roughly where my Linux knowledge ends!

The questions are these:

1. Having booted the Mac with Linux, should I be able to "see" the Mac
hard drive?

You should certainly be able to see it with fdisk and
/proc/partitions. I don't know enough about Rock Linux and its KDE
setup to tell you if you should be able to see the hard drive there.

Quote:
I type: mkdir /mnt/hda2
I simply get another command prompt

That means it worked.

Quote:
I type: mount /dev/hda3 /mnt/hda
response: mount point /mnt/hda does not exist

Well, you have created /mnt/hda2, not /mnt/hda

Quote:
I type: cat /etc/fstab
response:
....
none /dev devfs defaults 0 1
....
I type: mount /dev/hda2 -t ext3 -o ro /mnt/hda2
response: special device /dev/hda2 does not exist

Hmm, your system seems to be using devfs, so it should exist or be
created on demand or somesuch. Also, AFAIK your file system is not
ext3, so you should not try to mount it as ext3.

Well, since that does not appear to work, you can also do

mknod /tmp/hda3 b 3 3
mkdir /mnt/hda3
mount /tmp/hda3 -t hfs -o ro /mnt/hda3

This assumes that your file system is HFS (doesn't MacOS X also use a
variant of UFS?).

Quote:
I type: mount dev/hda2
response:
mount: can't find /dev/hda3 in /etc/fstab or /etc/mtab

You would have to put an entry into /etc/fstab for that to work.

Quote:
I type: mount /dev/hda3 /mnt/hda3
response:
mount point /mnt/hda3 does not exist

You have to create it first with mkdir.

Quote:
If so, am I likely to have any utilities on my Linux
CD that might attempt some sort of disk repair?

If the drive hardware is broken, the fix is to replace the drive. If
the hardware is ok, but the file system is corrupted for some reason,
the only way Linux could be used for repair is to back up the files
that you can access, reformat the drive, and play them back. However,
I would not use Linux to do this for MacOS file systems. BTW, if the
file system is corrupted, my suggestion of copying the raw partition
and playing it back won't help you.

Quote:
I don't need to get at
everything from the drive just a couple of folders that I don't back up as
often as I clearly should!

You may be able to do that, but you should try to understand what you
are doing (which apparently you did not for the commands that you
tried above), e.g., by reading the man pages about the commands (e.g.,
type "man mount"). We probably won't have the patience to give you
all the commands you need with all the arguments for your specific
case; plus, consider the possibility of someone giving you malicious
"advice".

- anton
--
M. Anton Ertl Some things have to be seen to be believed
anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html
Back to top
JohnW
*nix forums beginner


Joined: 24 Apr 2006
Posts: 4

PostPosted: Sat Apr 29, 2006 7:24 am    Post subject: Re: How do I "see" a hard drive? Reply with quote

"JohnW" <news@removethisbittoreplyhardcafe.co.uk> wrote in message
news:tF73g.11885$4k5.11524@newsfe4-gui.ntli.net...
Quote:
I have a problem with my MacMini that I have a feeling is actually a dead
hard drive but before I send it away for repair (it's still under warranty
so I don't want to try to crack it open myself) I want to try to recover as
much data from it as possible (I've been using it as a "media" computer and
there are quite a few radio recordings on there that I haven't listened to
yet and that are now completely unavailable).

I have one more test I want to run that I don't have enough knowledge to
do - hopefully somebody can help.

My first hope was to try to reinstall OSX but I get halfway through the
setup procedure and it fails to list any possible destinations to install
it to. I also ran the Hardware test (on the Mac Install CD) which reported
that all hardware is working correctly!

I thought I'd try to run a Live Linux CD (ROCK Linux) which is successful
and have got KDE going but I still can't "see" any hard drives (the file
manager program lists a "hard drive" but that appears to be the CD that
I've booted from. This is roughly where my Linux knowledge ends!

The questions are these:

1. Having booted the Mac with Linux, should I be able to "see" the Mac
hard drive?

2. If I should be able to "see" it, how do I go about that? ie do I need
to mount it from the command prompt before starting Xwindows? If so,
exactly what should I type in?



Thanks for all your help so far - I've only just managed to get enough time
to have another shot at this...
I've now logged in as root so there's no need for anyone to shout at me
anymore;-)

Having now successfully entered many of the suggestions I think I know where
this is heading but I'll add here the results of what I've done.
I type: mkdir /mnt/hda2
I simply get another command prompt
I type: mount /dev/hda3 /mnt/hda
response: mount point /mnt/hda does not exist
I type: cat /etc/fstab
response:
/dev/root / auto defaults 0 1
none /proc proc defaults 0 1
none /dev devfs defaults 0 1
none /dev/pts devpts defaults 0 1
none /dev/shm ramfs defaults 0 1
none /sys sysfs defaults 0 1
none /tmp tmpfs defaults 0 1

I type: mount /dev/hda2 -t ext3 -o ro /mnt/hda2
response: special device /dev/hda2 does not exist
I type: mount dev/hda2
response:
mount: can't find /dev/hda3 in /etc/fstab or /etc/mtab
I type: mount /dev/hda3 /mnt/hda3
response:
mount point /mnt/hda3 does not exist

As I previously said, if I run cat /proc/partitions it appears that I can
actually see the drive.

Have I done all I can? If so, am I likely to have any utilities on my Linux
CD that might attempt some sort of disk repair? I don't need to get at
everything from the drive just a couple of folders that I don't back up as
often as I clearly should!

Thanks again
Back to top
Anton Ertl
*nix forums addict


Joined: 20 Feb 2005
Posts: 91

PostPosted: Wed Apr 26, 2006 6:56 am    Post subject: Re: How do I "see" a hard drive? Reply with quote

"JohnW" <news@removethisbittoreplyhardcafe.co.uk> writes:
Quote:
Do I
really have to copy everything across or can I select certain directories.

You can certainly try to copy individual directories (mount the
partition, and use an appropriate tool; I usually use tar, but I don't
back up MacOS stuff), but:

- MacOS files can have resource forks, that Unix tools like tar do not
necessarily see (and back up), so I consider it safer to work on the
raw disk or raw partition.

- It's more work, and there's more risk of you forgetting something.
If you don't have enough space on your USB drive, I would
buy another drive for this reason alone.

On the other hand, working with files instead of raw disk/partition
data allows you to change the partition sizes.

BTW, for the raw-partition approach, it's better not to mount the file
system (or at least only read-only) while copying it.



- anton
--
M. Anton Ertl Some things have to be seen to be believed
anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html
Back to top
Unruh
*nix forums Guru


Joined: 22 Mar 2005
Posts: 1166

PostPosted: Tue Apr 25, 2006 9:42 pm    Post subject: Re: How do I "see" a hard drive? Reply with quote

"JohnW" <news@removethisbittoreplyhardcafe.co.uk> writes:


Quote:
"Unruh" <unruh-spam@physics.ubc.ca> wrote in message
news:e2ls7a$g$2@nntp.itservices.ubc.ca...
"JohnW" <news@removethisbittoreplyhardcafe.co.uk> writes:


"Keith Keller" <kkeller-usenet@wombat.san-francisco.ca.us> wrote in
message
news:7dtvh3xoue.ln2@goaway.wombat.san-francisco.ca.us...
On 2006-04-24, Lew Pitcher <Lew.Pitcher@tdsecurities.com> wrote:

Safer would be to
cat /proc/partitions

but if you /must/ use fdisk to see partitions, use
fdisk -l /dev/hda

Catting /proc/partitions might be safer, but fdisk -l seems more
informative to me e.g. fdisk -l will show you partition types, which
might help determine the filesystem currently on the partition, and also
shows the actual start and end of the partition.

--keith

Thanks - I'm a bit more hopeful of recovering my data - the longer it
takes
and the harder it is the more I learn so as far as I'm concerned, every
cloud has a silver lining!

Here's what I've managed-
If try to run fdisk in any of the forms that anyone has mentioned so far I
simply get "bash: fdisk: command not found"

Run as root, not as user.
It is in /sbin/fdisk

The most useful thing I've managedso far is catting /proc/partitions to
which I get the following:

Major minor blocks name
7 0 425552 loop0
3 0 78150744 hda
3 1 31 hda1
3 2 131072 hda2
3 3 78019635 hda3
3 4 5 hda4

I assume that loop0 is the bytes on the CDROM and, the 78150744 is the
size
of the hard drive (its an 80G drive)

now I think I have two more questions:
1. Can I actually get a directory listing? 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

So you have to tell it where to mount the stuff.

mkdir /mnt/hda
mount /dev/hda3 /mnt/hda


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

YOU ARE NOT RUNNING AS ROOT!!!
Do so.

I thought I might have to do that - my Linux experience is limited to
setting up a web server about 10 years ago and I've forgotton most of what I
learnt then. As I said above - the more I have to do now - the more I will
(re)learn.

When you are doing sysadmin stuff you almost always have to log on as root.
The system is protected from ordinary users doing things to the system and
messing everything up.
Everything you want to do is a system admin thing, so you need to be root.



Quote:
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. This is my backup disk - will I be able to do what I

Then that would be a complete disaster. Buy a new hard drive with the same
size as the old one and do that. But do not do it to a hard drive with
content, or that content will be lost.

That is the way forensic auditors do it, to make sure then do not damage
or
alter the original.


need to without destroying the data that's already on there? Do I need any
more switches? 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?

What usb drive?

The external drive that I'm hoping I can copy the data onto is USB. Do I
really have to copy everything across or can I select certain directories. I
have most stuff already backed up - I've just been a bit slack in backing up
certain other bits.

Ah. Well, I am not sure at all what you would hope to gain by copying over.
That is generally done so that you cannot mess up the original. But then
you really need to do it properly and go out and buy another drive, install
it into the machine and then make a clone.

But first do what was suggested. ( And do not use dd for anything)

post here
cat /etc/fstab
and the output of
fdisk -l /dev/hda
Then we can see what you have and tailor the advice to what you have,
instead of having to guess.
Back to top
JohnW
*nix forums beginner


Joined: 24 Apr 2006
Posts: 4

PostPosted: Tue Apr 25, 2006 9:01 pm    Post subject: Re: How do I "see" a hard drive? Reply with quote

"Unruh" <unruh-spam@physics.ubc.ca> wrote in message
news:e2ls7a$g$2@nntp.itservices.ubc.ca...
Quote:
"JohnW" <news@removethisbittoreplyhardcafe.co.uk> writes:


"Keith Keller" <kkeller-usenet@wombat.san-francisco.ca.us> wrote in
message
news:7dtvh3xoue.ln2@goaway.wombat.san-francisco.ca.us...
On 2006-04-24, Lew Pitcher <Lew.Pitcher@tdsecurities.com> wrote:

Safer would be to
cat /proc/partitions

but if you /must/ use fdisk to see partitions, use
fdisk -l /dev/hda

Catting /proc/partitions might be safer, but fdisk -l seems more
informative to me e.g. fdisk -l will show you partition types, which
might help determine the filesystem currently on the partition, and also
shows the actual start and end of the partition.

--keith

Thanks - I'm a bit more hopeful of recovering my data - the longer it
takes
and the harder it is the more I learn so as far as I'm concerned, every
cloud has a silver lining!

Here's what I've managed-
If try to run fdisk in any of the forms that anyone has mentioned so far I
simply get "bash: fdisk: command not found"

Run as root, not as user.
It is in /sbin/fdisk

The most useful thing I've managedso far is catting /proc/partitions to
which I get the following:

Major minor blocks name
7 0 425552 loop0
3 0 78150744 hda
3 1 31 hda1
3 2 131072 hda2
3 3 78019635 hda3
3 4 5 hda4

I assume that loop0 is the bytes on the CDROM and, the 78150744 is the
size
of the hard drive (its an 80G drive)

now I think I have two more questions:
1. Can I actually get a directory listing? 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

So you have to tell it where to mount the stuff.

mkdir /mnt/hda
mount /dev/hda3 /mnt/hda


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

YOU ARE NOT RUNNING AS ROOT!!!
Do so.

I thought I might have to do that - my Linux experience is limited to
setting up a web server about 10 years ago and I've forgotton most of what I
learnt then. As I said above - the more I have to do now - the more I will
(re)learn.

Quote:
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. This is my backup disk - will I be able to do what I

Then that would be a complete disaster. Buy a new hard drive with the same
size as the old one and do that. But do not do it to a hard drive with
content, or that content will be lost.

That is the way forensic auditors do it, to make sure then do not damage
or
alter the original.


need to without destroying the data that's already on there? Do I need any
more switches? 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?

What usb drive?

The external drive that I'm hoping I can copy the data onto is USB. Do I
really have to copy everything across or can I select certain directories. I
have most stuff already backed up - I've just been a bit slack in backing up
certain other bits.
Back to top
Anton Ertl
*nix forums addict


Joined: 20 Feb 2005
Posts: 91

PostPosted: Tue Apr 25, 2006 8:51 pm    Post subject: Re: How do I "see" a hard drive? Reply with quote

"JohnW" <news@removethisbittoreplyhardcafe.co.uk> writes:
Quote:
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".

Quote:
1. Can I actually get a directory listing?

You would have to mount the partition first.

Quote:
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.

Quote:
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.

Quote:
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.

Quote:
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

Quote:
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@mips.complang.tuwien.ac.at Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html
Back to top
Unruh
*nix forums Guru


Joined: 22 Mar 2005
Posts: 1166

PostPosted: Tue Apr 25, 2006 7:10 pm    Post subject: Re: How do I "see" a hard drive? Reply with quote

"JohnW" <news@removethisbittoreplyhardcafe.co.uk> writes:


Quote:
"Keith Keller" <kkeller-usenet@wombat.san-francisco.ca.us> wrote in message
news:7dtvh3xoue.ln2@goaway.wombat.san-francisco.ca.us...
On 2006-04-24, Lew Pitcher <Lew.Pitcher@tdsecurities.com> wrote:

Safer would be to
cat /proc/partitions

but if you /must/ use fdisk to see partitions, use
fdisk -l /dev/hda

Catting /proc/partitions might be safer, but fdisk -l seems more
informative to me e.g. fdisk -l will show you partition types, which
might help determine the filesystem currently on the partition, and also
shows the actual start and end of the partition.

--keith

Thanks - I'm a bit more hopeful of recovering my data - the longer it takes
and the harder it is the more I learn so as far as I'm concerned, every
cloud has a silver lining!

Here's what I've managed-
If try to run fdisk in any of the forms that anyone has mentioned so far I
simply get "bash: fdisk: command not found"

Run as root, not as user.
It is in /sbin/fdisk

Quote:
The most useful thing I've managedso far is catting /proc/partitions to
which I get the following:

Major minor blocks name
7 0 425552 loop0
3 0 78150744 hda
3 1 31 hda1
3 2 131072 hda2
3 3 78019635 hda3
3 4 5 hda4

I assume that loop0 is the bytes on the CDROM and, the 78150744 is the size
of the hard drive (its an 80G drive)

now I think I have two more questions:
1. Can I actually get a directory listing? 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

So you have to tell it where to mount the stuff.

mkdir /mnt/hda
mount /dev/hda3 /mnt/hda


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

YOU ARE NOT RUNNING AS ROOT!!!
Do so.

Quote:
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. This is my backup disk - will I be able to do what I

Then that would be a complete disaster. Buy a new hard drive with the same
size as the old one and do that. But do not do it to a hard drive with
content, or that content will be lost.

That is the way forensic auditors do it, to make sure then do not damage or
alter the original.


Quote:
need to without destroying the data that's already on there? Do I need any
more switches? 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?

What usb drive?
Back to top
JohnW
*nix forums beginner


Joined: 24 Apr 2006
Posts: 4

PostPosted: Tue Apr 25, 2006 6:12 pm    Post subject: Re: How do I "see" a hard drive? Reply with quote

"Keith Keller" <kkeller-usenet@wombat.san-francisco.ca.us> wrote in message
news:7dtvh3xoue.ln2@goaway.wombat.san-francisco.ca.us...
Quote:
On 2006-04-24, Lew Pitcher <Lew.Pitcher@tdsecurities.com> wrote:

Safer would be to
cat /proc/partitions

but if you /must/ use fdisk to see partitions, use
fdisk -l /dev/hda

Catting /proc/partitions might be safer, but fdisk -l seems more
informative to me e.g. fdisk -l will show you partition types, which
might help determine the filesystem currently on the partition, and also
shows the actual start and end of the partition.

--keith

Thanks - I'm a bit more hopeful of recovering my data - the longer it takes
and the harder it is the more I learn so as far as I'm concerned, every
cloud has a silver lining!

Here's what I've managed-
If try to run fdisk in any of the forms that anyone has mentioned so far I
simply get "bash: fdisk: command not found"
The most useful thing I've managedso far is catting /proc/partitions to
which I get the following:

Major minor blocks name
7 0 425552 loop0
3 0 78150744 hda
3 1 31 hda1
3 2 131072 hda2
3 3 78019635 hda3
3 4 5 hda4

I assume that loop0 is the bytes on the CDROM and, the 78150744 is the size
of the hard drive (its an 80G drive)

now I think I have two more questions:
1. Can I actually get a directory listing? 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
I type: mkdir /mnt/hda2
response: mkdir: cannot create directory '/mnt/hda2': Permission Denied
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. This is my backup disk - will I be able to do what I
need to without destroying the data that's already on there? Do I need any
more switches? 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?
Back to top
Keith Keller
*nix forums Guru


Joined: 20 Feb 2005
Posts: 608

PostPosted: Mon Apr 24, 2006 9:43 pm    Post subject: Re: How do I "see" a hard drive? Reply with quote

On 2006-04-24, Lew Pitcher <Lew.Pitcher@tdsecurities.com> wrote:
Quote:

Safer would be to
cat /proc/partitions

but if you /must/ use fdisk to see partitions, use
fdisk -l /dev/hda

Catting /proc/partitions might be safer, but fdisk -l seems more
informative to me e.g. fdisk -l will show you partition types, which
might help determine the filesystem currently on the partition, and also
shows the actual start and end of the partition.

--keith

--
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
see X- headers for PGP signature information
Back to top
reid anderson
*nix forums beginner


Joined: 23 Feb 2006
Posts: 8

PostPosted: Mon Apr 24, 2006 9:26 pm    Post subject: Re: How do I "see" a hard drive? Reply with quote

Anton Ertl wrote:
Quote:
Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> writes:

On 2006-04-24, Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:

"JohnW" <news@removethisbittoreplyhardcafe.co.uk> writes:

1. Having booted the Mac with Linux, should I be able to "see" the Mac hard
drive?

Just type

fdisk /dev/hda

at a shell command line. By pressing "p", you can see the partitions.

This might not work if the Mini is PPC.


Hmm, it works with my iBook, which has a PPC (and I guess the OP has
one, too, given the newsgroup we are posting in. Ah, I see:

[b6:/etc:971]# ls -l /sbin/fdisk
lrwxr-xr-x 1 root root 9 Nov 12 2004 /sbin/fdisk -> mac-fdisk*

This might be a Debian specialty, so mac-fdisk is probably the generic
solution.

- anton
You would be better off using Disk Utility from an Install CD and

repairing permissions or verifying the disk.
Back to top
Anton Ertl
*nix forums addict


Joined: 20 Feb 2005
Posts: 91

PostPosted: Mon Apr 24, 2006 7:36 pm    Post subject: Re: How do I "see" a hard drive? Reply with quote

Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> writes:
Quote:
On 2006-04-24, Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
"JohnW" <news@removethisbittoreplyhardcafe.co.uk> writes:
1. Having booted the Mac with Linux, should I be able to "see" the Mac hard
drive?

Just type

fdisk /dev/hda

at a shell command line. By pressing "p", you can see the partitions.

This might not work if the Mini is PPC.

Hmm, it works with my iBook, which has a PPC (and I guess the OP has
one, too, given the newsgroup we are posting in. Ah, I see:

[b6:/etc:971]# ls -l /sbin/fdisk
lrwxr-xr-x 1 root root 9 Nov 12 2004 /sbin/fdisk -> mac-fdisk*

This might be a Debian specialty, so mac-fdisk is probably the generic
solution.

- anton
--
M. Anton Ertl Some things have to be seen to be believed
anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html
Back to top
Keith Keller
*nix forums Guru


Joined: 20 Feb 2005
Posts: 608

PostPosted: Mon Apr 24, 2006 7:19 pm    Post subject: Re: How do I "see" a hard drive? Reply with quote

On 2006-04-24, Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
Quote:
"JohnW" <news@removethisbittoreplyhardcafe.co.uk> writes:
1. Having booted the Mac with Linux, should I be able to "see" the Mac hard
drive?

Just type

fdisk /dev/hda

at a shell command line. By pressing "p", you can see the partitions.

This might not work if the Mini is PPC. Try

mac-fdisk -l /dev/hda

Quote:
2. If I should be able to "see" it, how do I go about that? ie do I need to
mount it from the command prompt before starting Xwindows? If so, exactly
what should I type in?

If your CD does not mount the partitions automatically, you can mount
them manually with

mkdir /mnt/hda2 #make a mount point
mount /dev/hda2 -t ext3 -o ro /mnt/hda2

That's assuming you have an ext3 file system on the partition hda2,
and you want to mount it read-only.

The OP mentioned that there's at least one OS X install on the disk.
It's probably HFS+, so -t hfs or -t hfs+ may or may not work. The
hfstools utilities might work for plain HFS, or his live CD might
include hfs+tools.

Quote:
However, what I would do is to get an USB disk of at least the size of
the internal disk, and then just copy it over as a whole, like this:

dd if=/dev/hda of=/dev/sda

Assuming the USB disk is known to Linux as sda (you can check this
with dmesg). After you get your new disk, just dump the data back on
the internal disk with

dd if=/dev/sda of=/dev/hda

This isn't a bad idea. If the OP has a spare OS X box lying around, he
can verify that the dd worked by trying to mount the USB disk on that
machine.

--keith

--
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
see X- headers for PGP signature information
Back to top
Lew Pitcher
*nix forums Guru


Joined: 21 Feb 2005
Posts: 675

PostPosted: Mon Apr 24, 2006 7:14 pm    Post subject: Re: How do I "see" a hard drive? Reply with quote

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Anton Ertl wrote:
Quote:
"JohnW" <news@removethisbittoreplyhardcafe.co.uk> writes:
1. Having booted the Mac with Linux, should I be able to "see" the Mac hard
drive?

Just type

fdisk /dev/hda

at a shell command line. By pressing "p", you can see the partitions.

Safer would be to
cat /proc/partitions

but if you /must/ use fdisk to see partitions, use
fdisk -l /dev/hda

which lists the partitions, and does not drop you into the fdisk command
interpreter. This is safer because it ensures that you don't
inadvertently repartition or reformat your hard disk.


Quote:
2. If I should be able to "see" it, how do I go about that? ie do I need to
mount it from the command prompt before starting Xwindows? If so, exactly
what should I type in?

If your CD does not mount the partitions automatically, you can mount
them manually with

mkdir /mnt/hda2 #make a mount point
mount /dev/hda2 -t ext3 -o ro /mnt/hda2

For Mac OSX filesystems, you likely should use hfs rather than ext3

[snip]



- --

Lew Pitcher, IT Specialist, Corporate Technology Solutions,
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed here are my own, not my employer's)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFETSN7agVFX4UWr64RAjzMAJ9LNkVye4Zgx55Dnh96akXYdRB/eQCgxAKg
G4bk2HVI+vhEn8ooW4ZUxs4=
=DDEo
-----END PGP SIGNATURE-----
Back to top
Anton Ertl
*nix forums addict


Joined: 20 Feb 2005
Posts: 91

PostPosted: Mon Apr 24, 2006 6:33 pm    Post subject: Re: How do I "see" a hard drive? Reply with quote

"JohnW" <news@removethisbittoreplyhardcafe.co.uk> writes:
Quote:
1. Having booted the Mac with Linux, should I be able to "see" the Mac hard
drive?

Just type

fdisk /dev/hda

at a shell command line. By pressing "p", you can see the partitions.

Quote:
2. If I should be able to "see" it, how do I go about that? ie do I need to
mount it from the command prompt before starting Xwindows? If so, exactly
what should I type in?

If your CD does not mount the partitions automatically, you can mount
them manually with

mkdir /mnt/hda2 #make a mount point
mount /dev/hda2 -t ext3 -o ro /mnt/hda2

That's assuming you have an ext3 file system on the partition hda2,
and you want to mount it read-only.

However, what I would do is to get an USB disk of at least the size of
the internal disk, and then just copy it over as a whole, like this:

dd if=/dev/hda of=/dev/sda

Assuming the USB disk is known to Linux as sda (you can check this
with dmesg). After you get your new disk, just dump the data back on
the internal disk with

dd if=/dev/sda of=/dev/hda

Or you could just take the drive from the USB enclosure and put it in
the Mac Mini.

Alternatively, if you have a file system on the USB drive that can
deal with large files, you can mount the file system like this:

mount /dev/sda1 -t ext3 /mnt

and then copy the contents of the internal disk on a file:

dd if=/dev/hda of=/mnt/copy-of-hda

In this case you cannot just put the drive in your Mac Mini.

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

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 2 [16 Posts] Goto page:  1, 2 Next
View previous topic :: View next topic
The time now is Wed Dec 03, 2008 7:51 pm | All times are GMT
navigation Forum index » *nix » Linux » powerpc
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Need help getting Sony DAT tape drive to work on Irix 6.5 trebor SGI/IRIX 1 Sun Apr 13, 2008 3:19 am
No new posts CD/DVD Drive Speed John Howell Suse 0 Fri Jul 21, 2006 10:43 am
No new posts tape drive sharing shuklameeta@yahoo.co.in Solaris 6 Thu Jul 20, 2006 10:32 am
No new posts USB Key Drive Patrick Ester Debian 2 Thu Jul 20, 2006 3:30 am
No new posts problems mounting external drive onetitfemme Setup 2 Wed Jul 19, 2006 4:54 pm

Camilo jose cela | Loans | Mortgage | Remortgages | Northern Rock
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.4181s ][ Queries: 16 (0.1690s) ][ GZIP on - Debug on ]