GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Mounting harddrives - help needed (https://gfy.com/showthread.php?t=860641)

camperjohn64 10-09-2008 03:05 AM

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


Scott-Mc 10-09-2008 04:25 AM

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.

camperjohn64 10-09-2008 04:45 AM

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

Scott-Mc 10-09-2008 04:47 AM

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.

camperjohn64 10-09-2008 04:48 AM

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


camperjohn64 10-09-2008 04:51 AM

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

Scott-Mc 10-09-2008 04:55 AM

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

camperjohn64 10-09-2008 04:58 AM

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.

camperjohn64 10-09-2008 09:07 AM

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

Scott-Mc 10-09-2008 09:28 PM

Quote:

Originally Posted by camperjohn64 (Post 14874076)
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.

camperjohn64 10-09-2008 11:41 PM

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.


All times are GMT -7. The time now is 09:36 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123