How do I allocate Hard Disk space
How do I allocate Hard Disk space
I've searched many threads but cant find the answer. I have a new hd installed 500g. Frsh install of zm 1.23. Two cameras. Right now it reads 0 events for both cameras, but the load is 1.27 and disk space 27%. Is zm using the entire 500g-that what i want-this is dedicated only to zm nothing else. How do I know zm is setup to use all 500 g? if not, how do i allocate the entire hd or at least the majority of it?
Thanks.
Thanks.
Thanks for all the Help.
New to Linux
New to Linux
-
- Posts: 247
- Joined: Sun Jan 16, 2005 11:26 am
Hard Drive Allocation
I installed it with a PCLOS liveCD from 2008. I can got to the PCC and see what the hard drive allocation is and it reads as follows:
Mount Point: / hdd1 journalised FS: ext3, 7.8GB
Mount Point: Swap hdd5 Linux swap 3.8GB
Mount Point: /home hdd6 journalised FS ext3 454GB
I would like to use at least 400GB for the ZM storage space.
How do I get ZM to use that space?
Mount Point: / hdd1 journalised FS: ext3, 7.8GB
Mount Point: Swap hdd5 Linux swap 3.8GB
Mount Point: /home hdd6 journalised FS ext3 454GB
I would like to use at least 400GB for the ZM storage space.
How do I get ZM to use that space?
Thanks for all the Help.
New to Linux
New to Linux
-
- Posts: 440
- Joined: Sat Sep 25, 2004 12:45 am
- Location: Fulton, MO
I don't know if I agree with _all_ of /var instead of just the directory that Zoneminder is storing files. If you create a new partition for /var you _will_ want to boot into single user mode and copy the log files (or make sure you stop mysql) and then make sure /var is mounted in fstab during startup or really bad things will happen.bb99 wrote:I assign a whole partition using the /var mount point as the storage location. The location of /var is the key.
-
- Posts: 247
- Joined: Sun Jan 16, 2005 11:26 am
Well it is fixable, but depends how comfortable you are with linux, and how risk averse you are.
Your first task is to resize /home - you will have to google to see how but the best way is likely to be to use a livecd like ubuntu and its partitioner, but ENSURE you DONT go past the partition page into the install page, and ensure you dont format anything. I believe the ubuntu partitioner can resize linux filesystems - I know it can windows ones.
Once you've done that you'd have to stop zm etc.
create a new partition with rest of space
mount it somewhere temporerily
copy -rp /var/www to new partition
mv original /var/www to /var/www.old
change mountpoint of your new partition to /var/www
I guess you'll have to decide for yourself how comfortable you are with all of that, and whether you want to risk it.
Your first task is to resize /home - you will have to google to see how but the best way is likely to be to use a livecd like ubuntu and its partitioner, but ENSURE you DONT go past the partition page into the install page, and ensure you dont format anything. I believe the ubuntu partitioner can resize linux filesystems - I know it can windows ones.
Once you've done that you'd have to stop zm etc.
create a new partition with rest of space
mount it somewhere temporerily
copy -rp /var/www to new partition
mv original /var/www to /var/www.old
change mountpoint of your new partition to /var/www
I guess you'll have to decide for yourself how comfortable you are with all of that, and whether you want to risk it.
Allocating HDD space fro ZM
So, it's really no bother for me to start from scratch. I can reinstall PCLOS from the live cd and ZM anew, but during the partitioning process, instead of going with what the package suggests, what partitions should I enhance for ZM to use the max amount of HD space?
Thanks for all the Help.
New to Linux
New to Linux
SOLVED-Allocating HDD space for ZM
Well. I followed some other advice regarding assigning a port to ZM because I couldn't get the WIFI to work unless I disconnected the LAN. That suggestion ened up trashing everything so I did a new install and manually allocated the 400GB to /var and all appears to be well. I hope this is correct.
It appears it s best to do this at initial install, after the fact can get troublesome unless you're a guru.
Thanks all.
It appears it s best to do this at initial install, after the fact can get troublesome unless you're a guru.
Thanks all.
Thanks for all the Help.
New to Linux
New to Linux
I agree with Flashheart....
**Flashheart has the best solution for migrating storage to another hard disk issue. It is the best and quickest way to manage your memory without reinstalling everything.
My version is 1.24.2 but this thread is the only one that is directly related that I am aware of.
It is also my opinion not to break off the entire /var root just for this purpose, although that will work to an extent.
I just finished putting in my new hard drive to use for the zm grunt work instead of my system hard drive.
Here is a "little" breakdown in case you could use the help....
I want to encompass what you will be doing before you begin. It is really quite easy. You need to get the new drive formatted and ready to mount and install it. Copy over the specified directories, delete the old ones and sym-link the new ones on the new drive.
First, format your new drive in another computer(or whatever one is handy) using a SATA to USB converter. You can use whatever file system you feel to be best. For a program on Ubuntu, I used "Disk Utility". I stuck to EXT4. Now with a freshly formatted and labeled drive, find the UUID of the drive to configure the fstab in the machine it is going in ahead of time before the restart. To do this, run:
This shows the drives on your system including the UUID of the soon to be installed drive currently plugged in via a SATA to USB device. Deduce what UUID is the drive you are working with and copy the UUID down for editing the fstab on the ZM machine(if its different).
Next, edit the fstab on the ZM machine so that the hard disk will be available right after the first boot and ready to go.
Make a new directory in your /mnt folder by:
I used "/mnt/security" This is only an example.
Next edit your fstab: (example is if you know vi; you can use whatever editor you want.... nano, joe, gedit if you're on the machine locally...)
Next, add these lines to the bottom of the file: (change directory names and UUID to your scenario...)
Here is an example of mine:
Now, when you shut down your ZM system, plug in the new drive via SATA, and fire it back up, it will be mounted and ready to go at /mnt/whatever_you_called_the_directory
Next you want to shut down ZM. Do this from the web page or from the command line. From the web page you simply click "running" in the top center and click apply in the little window that pops up. From the command line, type:
At least this is how my Linux distro works (Ubuntu 10.04) **see your own Linux distro documentation for details on starting and stopping services if different from mine.**
Next you want to stop any other service that are using mysql on a regular basis. My machine is actually Mythbuntu obviously running mythtv services as well which use mysql very heavily. Stop these other services in the same way. You can even stop apache2 service to be totally sure.
After you have all mysql dependencies stopped, stop mysql itself by:
Now everything is quiet and you are ready to migrate over to the new hard disk for the ZM grunt work.
There are two methods to doing this. Trash all your ZM security camera footage and start fresh (much much much faster) or keep all your existing data by copying everything over (much much much slower.... and the route I will cover because that is what I did).
First, verify your new disk is read and mounted properly where it is supposed to be. You can list your attached hard disks and their mount points by:
Look for your new disk. It should be pointing to the directory you made in /mnt
If all is well so far, copy all your previous camera footage from the current location to the new drive. You want to copy a total of 3 folders and all their contents. Assuming that you haven't moved anything previously, this code should work nicely for you:
then:
Now you can take a break. Have a pizza or maybe even make a pizza.... from scratch. Depending on how many cameras you have, resolution and frames per second, this is going to take some time.
.....
After the copying is all completed, verify the data is all there by:
You should see your copied data there, all accounted for. Make sure that the ownership is all correct, which it should be. If "root" user owns the copied directories, do this:
Now everything should be under the correct ownership for ZM to function.
We aren't done yet though. The final things we need to to is delete the old directories we copied with their contents (free up some serious system space) and create symbolic links from /var/cache/zoneminder/* to the new hard drive.
Delete the three directories: (make sure this is correct for your system, an error could be catastrophic...)
Now create the symbolic links to the new drive. You need to do these one at a time for each folder you copied earlier. Lets do events first.
Now the images directory:
And finally temp:
Great job! You're all finished! Now its just a matter of starting up your services in reverse order that you had to stop them.
Lets start mysql first since ZM in dependent on it:
Then start up ZoneMinder:
(or from the zm web console)
Don't forget to start up any other service you had to shut down earlier. Once again, my system is also a MythTV system so I had to start up mythtv-backend as well:
That's it! I know I went into crazy detail on this so I'm sure most of you will skip through it (maybe even pick out a mistake or inefficiency...)
Let me know if you have any more questions or need me to edit my post for some reason.
As a positive note, this also dropped my zma service from 24% down to 12%! Having a separate HDD for ZM grunt work makes systems happy!
I hope this helps!!!
ps... After going back into ZoneMinder, I had an extra event at the beginning with a crazy huge number dating to year 1906 or something. I simply selected the event from the ZM webpage and deleted it. Thankfully that cleared that up!
Happy spying... * cough*... I mean... securing![/code]
My version is 1.24.2 but this thread is the only one that is directly related that I am aware of.
It is also my opinion not to break off the entire /var root just for this purpose, although that will work to an extent.
I just finished putting in my new hard drive to use for the zm grunt work instead of my system hard drive.
Here is a "little" breakdown in case you could use the help....
I want to encompass what you will be doing before you begin. It is really quite easy. You need to get the new drive formatted and ready to mount and install it. Copy over the specified directories, delete the old ones and sym-link the new ones on the new drive.
First, format your new drive in another computer(or whatever one is handy) using a SATA to USB converter. You can use whatever file system you feel to be best. For a program on Ubuntu, I used "Disk Utility". I stuck to EXT4. Now with a freshly formatted and labeled drive, find the UUID of the drive to configure the fstab in the machine it is going in ahead of time before the restart. To do this, run:
Code: Select all
ls -l /dev/disk/by-uuid/
Next, edit the fstab on the ZM machine so that the hard disk will be available right after the first boot and ready to go.
Make a new directory in your /mnt folder by:
Code: Select all
sudo mkdir /mnt/whatever_you_want_to_call_the_directory
Next edit your fstab: (example is if you know vi; you can use whatever editor you want.... nano, joe, gedit if you're on the machine locally...)
Code: Select all
sudo vi /etc/fstab
Code: Select all
#security_cams
UUID=your_harddisk's_uuid_from_earlier /mnt/your_directory_from_earlier your_choosen_file_system relatime,errors=remount-ro 0 2
Code: Select all
#security_cams
UUID=0adc4b6b-0bb4-44be-bf0f-860b06e28b23 /mnt/security ext4 relatime,errors=remount-ro 0 2
Next you want to shut down ZM. Do this from the web page or from the command line. From the web page you simply click "running" in the top center and click apply in the little window that pops up. From the command line, type:
Code: Select all
sudo service zoneminder stop
Next you want to stop any other service that are using mysql on a regular basis. My machine is actually Mythbuntu obviously running mythtv services as well which use mysql very heavily. Stop these other services in the same way. You can even stop apache2 service to be totally sure.
After you have all mysql dependencies stopped, stop mysql itself by:
Code: Select all
sudo service mysql stop
There are two methods to doing this. Trash all your ZM security camera footage and start fresh (much much much faster) or keep all your existing data by copying everything over (much much much slower.... and the route I will cover because that is what I did).
First, verify your new disk is read and mounted properly where it is supposed to be. You can list your attached hard disks and their mount points by:
Code: Select all
df
If all is well so far, copy all your previous camera footage from the current location to the new drive. You want to copy a total of 3 folders and all their contents. Assuming that you haven't moved anything previously, this code should work nicely for you:
Code: Select all
cd /var/cache/zoneminder
Code: Select all
sudo cp -Rvp events/ images/ temp/ /mnt/whatever_you_called_the_directory
.....
After the copying is all completed, verify the data is all there by:
Code: Select all
ls -l /mnt/whatever_you_called_the_directory
Code: Select all
sudo chown -R www-data:www-data /mnt/whatever_you_called_the_directory
We aren't done yet though. The final things we need to to is delete the old directories we copied with their contents (free up some serious system space) and create symbolic links from /var/cache/zoneminder/* to the new hard drive.
Delete the three directories: (make sure this is correct for your system, an error could be catastrophic...)
Code: Select all
sudo rm -R /var/cache/zoneminder/*
Code: Select all
sudo ln -s /mnt/whatever_you_called_the_directory/events /var/cache/zoneminder/events
Code: Select all
sudo ln -s /mnt/whatever_you_called_the_directory/images /var/cache/zoneminder/images
Code: Select all
sudo ln -s /mnt/whatever_you_called_the_directory/temp /var/cache/zoneminder/temp
Lets start mysql first since ZM in dependent on it:
Code: Select all
sudo service mysql start
Code: Select all
sudo service zoneminder start
Don't forget to start up any other service you had to shut down earlier. Once again, my system is also a MythTV system so I had to start up mythtv-backend as well:
Code: Select all
sudo service mythtv-backend start
Let me know if you have any more questions or need me to edit my post for some reason.
As a positive note, this also dropped my zma service from 24% down to 12%! Having a separate HDD for ZM grunt work makes systems happy!
I hope this helps!!!
ps... After going back into ZoneMinder, I had an extra event at the beginning with a crazy huge number dating to year 1906 or something. I simply selected the event from the ZM webpage and deleted it. Thankfully that cleared that up!
Happy spying... * cough*... I mean... securing![/code]
Time never ceases to accelerate.