LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Mounting hard drives.. (https://www.linuxquestions.org/questions/linux-hardware-18/mounting-hard-drives-713406/)

Skillz 03-21-2009 12:30 PM

Mounting hard drives..
 
I know this is an easy task, especially using cPanel. However I want to do this without formatting the drive, since there is sensitive data already on the hard drives. So how would I mount a hard drive, but not format/lose any of the data already on it?

I've looked and everything seems to lead me to believe that I'll lose data if I do it that way.

camorri 03-21-2009 12:39 PM

You mount a directory on a HD into your existing file system. You do not have to format, if the partition has a supported file system You did not say what file system you would like to mount.

Physically add the drive. If it is an internal drive, you may need to go into the BIOS to set up the BIOS for the hardware.

You need to make a mount point in your file system. This is done with the mkdir command. Most systems have a /mnt directory. Open a konsile as root, use CD to go there. 'cd /mnt'. Then use mkdir, 'mkdir /newpart ( or what ever you want to call it ).

Now as root run the mount command. If you need help with mount, then see man mount. If you want to make the mount so it will occur what you boot, edit the /etc/fstab file as root, and add the mount command there.

Skillz 03-21-2009 12:52 PM

Basically this is what happened. Sometime last night the data center my server is hosted at lost power. Upon getting the power back on, the hard drives in the system had corrupted file(s) so they put a new hard drive in my server, loaded the same OS on the same file system. Then once that had completed, they plugged in my other two hard drives so I can do data recovery on them.

I typed this command

mount /dev/hdd /mnt/disk1

Then I got a message saying
mount: you must specify the filesysyem type

Not sure what to do or if this is the right way to mount it, without losing data.

Skillz 03-21-2009 01:01 PM

Ok I managed to get it mounted, now I am just copying files. Thanks camorri.

camorri 03-21-2009 01:05 PM

That is the correct command and you do have to specify the file system type. You can have a look in the man page for fstab. Here is part of it, describing various file system types.

Quote:

The third field, (fs_vfstype), describes the type of the filesystem.
Linux supports lots of filesystem types, such as adfs, affs, autofs,
coda, coherent, cramfs, devpts, efs, ext2, ext3, hfs, hpfs, iso9660,
jfs, minix, msdos, ncpfs, nfs, ntfs, proc, qnx4, reiserfs, romfs,
smbfs, sysv, tmpfs, udf, ufs, umsdos, vfat, xenix, xfs, and possibly
others. For more details, see mount(8). For the filesystems currently
supported by the running kernel, see /proc/filesystems. An entry swap
denotes a file or partition to be used for swapping, cf. swapon(8). An
entry ignore causes the line to be ignored. This is useful to show
disk partitions which are currently unused. An entry none is useful
for bind or move mounts.
Linux supports a lot of different file systems. You have to find out what you have to mount it.

TITiAN 03-21-2009 02:04 PM

Quote:

Originally Posted by camorri (Post 3483304)
That is the correct command and you do have to specify the file system type. You can have a look in the man page for fstab. Here is part of it, describing various file system types.



Linux supports a lot of different file systems. You have to find out what you have to mount it.

I disagree. /dev/hdd is a drive not a partition, but you mount partitions. mount usually autodetects the file system type. So Skillz does not have to specify the file system type.

Skillz 03-21-2009 11:17 PM

Yea I didn't have to specify any file system types. I just created a directory, then mounted the hard drives to it.

Although I had to mount the partitions within' the hard drives.

Either way, I was able to recover all the data that I needed. Thanks for the help guys!

Skillz 04-04-2009 09:26 AM

Ok, why would a server reboot drop/delete the mounted hard drives?

I had to remount the hard drives upon a forceful system reboot. Not sure why that would be, scared the heck out of me though when I went to one of the sites and got a file not found, then logged into the server and the directory the hard drive was mounted in was completely empty.

For future references, for myself. I typed:

mount /dev/hdc1 /home2

To mount the hard drive to the home2 directory. Now my question is, why would it erase it like that?


All times are GMT -5. The time now is 05:21 PM.