Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ Technical Support _ how to mount HD on dedicated server?

Posted by: gottadoit Mar 21 2009, 11:11 AM

Hey all,

I have a dedicated test server (based on Linux Sarge) with which I train myself as I'm a newbie ... but it's been cracked as it's not accessible by SSH anymore (password not recognized anymore), I asked my provider to set the rescue CD, so that I can mount my HD and clean and reinstall SSH with a new password. But I'm struggling with it:

after logging I'm on the CD driver

First I search the existing Hard Disk on my machine with:
rescuecd:~# fdisk -l | grep Disk
output:
Disk /dev/hda: 20.4 GB, 20404371456 bytes

I created a new directory "mnt/hd" on the root, and I asked to mount the HD with :
rescuecd:~# mount /dev/hda /mnt/hd
output:
mount: you must specify the filesystem type

I tried to get the filesystem by:
rescuecd:~# df -T /dev/hda
output:
Filesystem Type 1K-blocks Used Available Use% Mounted on
tmpfs tmpfs 10240 2568 7672 26% /dev

Apparently the file system is "tmpfs", so I called the mount command with this parameter:
rescuecd:~# mount -t tmpfs /dev/hda /mnt/hd

this time no output, so I guess everything is ok, I check the HD is well mounted with:
rescuecd:~# df
output:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda 257712 0 257712 0% /var/mnt/hd

Apparently it's mounted on /var/mnt/hd and not on /mnt/hd as I requested
but those folders are empty!

I'm not sure to use the right method, I tried to get a good tutorial for Linux sarge platform via Google but found nothing.
Does anyone know a good link or can give the right procedure?

Thanks in advance

Posted by: michaelk Mar 22 2009, 09:38 AM

/dev/hda represents the entire drive and can not be mounted. Now the drive is probably divided into one or more partitions which can be determined from the fdisk command.
fdisk -l (that is a small L) Post the output.

There is no standard but typically one has /boot, / and swap partitions. Anything that has an ID 82 or labeled as a swap partition can ignore for the moment. At this time there is basically no way to tell what partition is which. Partition numbers 1-4 are primary and anything >4 is a logical partition. If a partition type is shown as extended then it is in a nutshell a container for logical partitions and can be ignored at this point also.

Now depending on the kernel version many filesystems are temporary (tmpfs) like /dev which are created at boot time but does not represent the physical drive. Your actual filesystems on the hard drive are probably ext3. Use the following to determine the filesystem type:

file -s /dev/hda1 (use the partitions numbers from the output of the fdisk command)

You can mount them like the following example. Make sure you create a directory for each partition as well as using the correct partition number and filesystem type.
mount -t ext3 /dev/hda1 /mnt/hd1

You can mount any filesystem anywhere in the tree. I can not tell what the current work directory was from you post but at the moment it does not matter. You can use the cd command to change it to /mnt like
cd /mnt

If my current working directory was /var then the command "mkdir mnt/hd" will create a directory /var/mnt/hd versus "mkdir /mnt/hd"

I hope my quick explanation made some sense.
You can find more information on the web

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)