Mounting harddrives - help needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • camperjohn64
    Confirmed User
    • Feb 2005
    • 1531

    #1

    Mounting harddrives - help needed

    I bought a new 500 GIG harddrive for my server and installed it, formatted it an mounted it at /img1. My script now saves all image data to /img1

    ...I think...

    You see, it now says the harddrive is 100% full.

    How can I confirm that I did it correctly? Somehow I think I have not mounted the /img1 folder to the 500gig harddrive. Somehow I suspect the /img1 folder is really on the main 160GB harddrive and that the new 500G harddrive is not being used.

    How can I confirm that the /img1 folder is really my new 500 gig harddrive and not simply a folder on the old drive?

    Code:
    fdisk -l
    
    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1       60801   488384001   83  Linux
    
    Disk /dev/sdb: 160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1          13      104391   83  Linux
    /dev/sdb2              14        2624    20972857+  83  Linux
    /dev/sdb3            2625        4582    15727635   83  Linux
    /dev/sdb4            4583       19457   119483437+   5  Extended
    /dev/sdb5            4583        4713     1052226   82  Linux swap
    /dev/sdb6            4714        4844     1052226   83  Linux
    /dev/sdb7            4845       19457   117378891   83  Linux
    Code:
    du --max-depth 1
    
    16828        ./sbin
    16           ./lost+found
    8            ./misc
    299480       ./root
    0            ./sys
    12736        ./tmp
    10429532     ./var
    3945384      ./usr
    18020        ./etc
    920885       ./proc
    4346884      ./backup
    8068         ./scripts
    8            ./selinux
    152          ./dev
    8            ./opt
    21593880     ./home
    82526980     ./img1         <-- this is the folder in question
    8            ./media
    8            ./initrd
    55576        ./lib
    5772         ./bin
    8            ./mnt
    8            ./srv
    5293         ./boot
    124185642    .
    PS - I am using CPanel, and CPanel shows the option under "Main >> Disk Drives >> Format/Mount a new Hard Drive"

    I really really want to click the button to [Partition,Format and Mount], but I think I already did this when I mounted the drive to /img1. I obviously don't want to lose my data.

    Code:
     
    Main >> Disk Drives >> Format/Mount a new Hard Drive
    
    Disk Setup
    
    Found Disk: sda  [Partition,Format and Mount] ALL DATA WILL BE LOST
    www.gimmiegirlproductions.com
  • Scott-Mc
    Registered User
    • Nov 2007
    • 20

    #2
    df -h will show if it is mounted or not.

    Looking at the space from the du it's unlikely that it's mounted but before you mount it i'd suggest you rename the current /img1 directory to something like /img1.old then mkdir /img1 and

    mount /dev/sda1 /img1

    Then copy the contents from /img1.old -> /img1 using something like rsync -av /img1.old/ /img/1

    Then you can delete /img1.old otherwise the data you have already copied till now will not be on the new drive. Secondly you will want to add your new drive to /etc/fstab so it mounts on boot.
    Linux Server Management - AdminGeekZ.com
    Is your website Sluggish? Unavailable? Insecure?
    Why not call us? United Kingdom(Toll Free): 0800 8620073 // United States: 585 563 1729 // Australia: 02 9037 2448 // International: +44.1412800134

    Comment

    • camperjohn64
      Confirmed User
      • Feb 2005
      • 1531

      #3
      Is it possible that the img1 directory has been mounted already, but was not added to fstab so it is mounted again at boot?

      As you can see I don't really understand the process well enough to experiment with my data...
      www.gimmiegirlproductions.com

      Comment

      • Scott-Mc
        Registered User
        • Nov 2007
        • 20

        #4
        It is possible it was mounted and you rebooted and it's not mounted anymore.

        You have data in your /img1 directory just now hence why I mentioned to copy it before mounting.
        Linux Server Management - AdminGeekZ.com
        Is your website Sluggish? Unavailable? Insecure?
        Why not call us? United Kingdom(Toll Free): 0800 8620073 // United States: 585 563 1729 // Australia: 02 9037 2448 // International: +44.1412800134

        Comment

        • camperjohn64
          Confirmed User
          • Feb 2005
          • 1531

          #5
          Here is what is in my fstab:

          Code:
          # This file is edited by fstab-sync - see 'man fstab-sync' for details
          LABEL=/                 /                       ext3    defaults,usrquota        1 1
          LABEL=/boot             /boot                   ext3    defaults        1 2
          none                    /dev/pts                devpts  gid=5,mode=620  0 0
          none                    /dev/shm                tmpfs   defaults        0 0
          none                    /proc                   proc    defaults        0 0
          none                    /sys                    sysfs   defaults        0 0
          LABEL=/tmp              /tmp                    ext3    defaults        1 2
          LABEL=/usr              /usr                    ext3    defaults,usrquota        1 2
          LABEL=/var              /var                    ext3    defaults,usrquota        1 2
          LABEL=SWAP-sda5         swap                    swap    defaults        0 0
          #/dev/sda1 /img1 ext2 defaults,usrquota 1 2
          www.gimmiegirlproductions.com

          Comment

          • camperjohn64
            Confirmed User
            • Feb 2005
            • 1531

            #6
            I notice the last line in fstab, where it is commented out.

            Would that have been done by "fstab-sync"? It appears so. Don't know what that program is.

            I think am ready to try renaming the folder then mounting it. I just want to make 100% sure this is right...
            www.gimmiegirlproductions.com

            Comment

            • Scott-Mc
              Registered User
              • Nov 2007
              • 20

              #7
              To make it easier, open /etc/fstab and uncomment the line

              #/dev/sda1 /img1 ext2 defaults,usrquota 1 2

              Then run
              mv /img1 /img.old
              mkdir /img1
              mount /img1
              rsync -av /img.old/ /img1/

              Then that's you done, you can verify your data is fine and copied then remove /img.old
              Linux Server Management - AdminGeekZ.com
              Is your website Sluggish? Unavailable? Insecure?
              Why not call us? United Kingdom(Toll Free): 0800 8620073 // United States: 585 563 1729 // Australia: 02 9037 2448 // International: +44.1412800134

              Comment

              • camperjohn64
                Confirmed User
                • Feb 2005
                • 1531

                #8
                Ok I will try that. Thanks. I hate it when my server is not 3 feet from my desk and I can't just pop in another harddrive, copy it over then, then experiment like crazy.

                l will post results. Thanks.
                www.gimmiegirlproductions.com

                Comment

                • camperjohn64
                  Confirmed User
                  • Feb 2005
                  • 1531

                  #9
                  mount /img1

                  This command says

                  mount: wrong fs type, bad option, bad superblock on /dev/sda1,
                  or too many mounted file systems

                  I suspect this suggests that it is not even formatted...
                  www.gimmiegirlproductions.com

                  Comment

                  • Scott-Mc
                    Registered User
                    • Nov 2007
                    • 20

                    #10
                    Originally posted by camperjohn64
                    mount /img1

                    This command says

                    mount: wrong fs type, bad option, bad superblock on /dev/sda1,
                    or too many mounted file systems

                    I suspect this suggests that it is not even formatted...
                    Yeap it would, which means you don't have any data on it so format it

                    mkfs.ext3 /dev/sda1

                    You may however want to double check you have never had any data on it (and it's not just corrupt, but the chances of that are minimal so formatting would be the right choice) then repeat the steps above.
                    Linux Server Management - AdminGeekZ.com
                    Is your website Sluggish? Unavailable? Insecure?
                    Why not call us? United Kingdom(Toll Free): 0800 8620073 // United States: 585 563 1729 // Australia: 02 9037 2448 // International: +44.1412800134

                    Comment

                    • camperjohn64
                      Confirmed User
                      • Feb 2005
                      • 1531

                      #11
                      Thanks. It in fact never had data on it, and I formatted it and mounted it correctly.

                      ...I think...

                      Now du does show that I have 160G + 500G of space, and that the 500 is mapped to /img1. I can't believe that I had a 500G harddrive installed for almost a year and it wasn't being used.

                      Thanks for the unix help. I need to stick to PHP.
                      www.gimmiegirlproductions.com

                      Comment

                      Working...