Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2002
    Posts
    1,926

    Commands for mounting harddrive

    I had a tech mount my second harddrive in my server recently, but I had an OS restore and need to do it again. The tech was going to send me an email with the commands I had to use using SSH to mount it, but I never received this email. I'm in a bit of a hurry with this, so any help would be appreciated. The second drives contains site backups I need to reimplement.

  2. #2
    Join Date
    Dec 2001
    Location
    Ponchatoula, LA
    Posts
    497
    First you'll need a directory to mount the filesystem on. If you don't already have one, you'll need to create it:

    mkdir /drive2

    Then you'll need to know the device. My guess would be either hdb or hdc. You can use the dmesg command to view the kernel output from boot and look for where it assigns devices to your drives or you just try each one

    You may need to know the filesystem type. It can usually detect the filesystem type. It's probably ext2.

    Then the mount command:

    mount /dev/hdb /drive2

    or

    mount -t ext2 /dev/hdb /drive2

    Hope that helps.

    Richard
    Enigma Hosting
    "I wasn't speeding, I was qualifying!"

  3. #3
    Join Date
    Feb 2002
    Posts
    1,926
    Didn't realise it was that simple. I did try this myself, only I forgot to reference the directory to mount it to. Thanks for the help.

  4. #4
    Join Date
    May 2001
    Location
    Dayton, Ohio
    Posts
    4,962
    Also, you may want to add the drive to /etc/fstab....

  5. #5
    Join Date
    Feb 2002
    Posts
    1,926
    Would this look about right if I added it to fstab (haven't as yet as I'm in the process of installing Ensim LS 3.1)

    LABEL=/ / ext3 defaults 1 1
    LABEL=/boot /boot ext3 defaults 1 2
    none /dev/pts devpts gid=5,mode=620 0 0
    LABEL=/home /home ext3 defaults 1 2
    none /proc proc defaults 0 0
    none /dev/shm tmpfs defaults 0 0
    LABEL=/usr /usr ext3 defaults 1 2
    LABEL=/var /var ext3 defaults 1 2
    /dev/hda3 swap swap defaults 0 0
    /dev/hdb1 /backups ext3 defaults 1 2

  6. #6
    Join Date
    Feb 2002
    Posts
    1,926
    Well, I mounted the drive successfully, sort of. I can't seen to access the folder with the website backups on it, yet I can access the folder that has the database backups on it. Here's what I'm getting in SSH:

    [[email protected] root]# mount -t ext2 /dev/hdb1 /BACKUP
    mount: /dev/hdb1 already mounted or /BACKUP busy
    mount: according to mtab, /dev/hdb1 is already mounted on /BACKUP
    [[email protected] root]# cd /BACKUP
    [[email protected] BACKUP]# dir
    databases lost+found sites
    [[email protected] BACKUP]# cd /BACKUP/sites
    bash: cd: /BACKUP/sites: No such file or directory
    [[email protected] BACKUP]#
    There must be a way to get into the 'sites' folder. It is clearly on the disk, I just can't access it. Any suggentions?

  7. #7
    Join Date
    Mar 2002
    Posts
    1,003
    You're suppose to create the filesystem for the hard drive.

    mkfs I think is the command for linux.

  8. #8
    Join Date
    Feb 2002
    Posts
    1,926
    yes, that is the command, pitty it wiped the directory I couldn't access and I lost all the data *SIGH*

    Guess I'm spending the next few days helping people reconstruct their sites. Lucky for me there's only 10 of them and I have the mySQL databases backed up. Am I glad I don't make these people pay me, or I would be in real trouble...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •