Posted on Leave a comment

Install and Use nmon Tool To Monitor Linux Systems Performance – nixCraft

Source: Install and Use nmon Tool To Monitor Linux Systems Performance – nixCraft

 

Sample outputs:

Command to analyze Linux server performance - cpu / memory / network / disk and much more
Fig.01: nmon startup screen

nmon keyboard shortcuts

  • q – To stop and exit nmon.
  • h – To see quick help (hint) screen and press h again to remove the hints.
  • Use the following command to turn on or off stats:
    • c – See cpu stats.
    • m – See memory stats.
    • d – See disk stats.
    • k – See kernel stats.
    • n – See network stats.
    • N – See NFS stats.
    • j – See file system stats.
    • t – See top process.
    • V – See virtual memory stats.
    • . – See only busy disks/procs.
    • v – Verbose mode (display as Ok/warning/danger on screen).

Sample output from my home server:

nmon Command Examples
Fig.02: nmon command in action

How do I set default monitoring options for nmon?

To see the memory, network, disk and processor statistics immediately after the nmon command is started, run (or add in your shell startup file):
# export NMON=mndc
Run the nmon command:
# nmon

Capturing and analyzing data with nmon

You can capture the data to a file for later analysis and graphing. Type the following command:
# nmon -f -s2 -c 30
OR
# nmon -ft -s 30 -c 120
nmon will run as a daemon in the background and you can log out. nmon will complete the data file capture and it will save in a file *.nmon file such as nas02_120806_0202.nmon. Where,

  1. -f : Start data collect mode and output in spreadsheet format.
  2. -s 2 : Wait between 2 seconds refreshing the screen.
  3. -c30 : Total number of refreshes (30).
  4. -t : Spreadsheet includes top processes.
  5. -d disks : to increase the number of disks [default 256]
  6. -x : Capacity planning (15 min for 1 day = -fdt -s 900 -c 96)

You need to download nmonanalyser which is an Excel spreadsheet that takes an output file from nmon and produces some nice graphs to aid in analysis and report writing.

Check out related media

See a quick installation and demo of nmon command:

Posted on Leave a comment

Epson WF3640/CUPS Problems – Raspberry Pi Forums

This is a little late, but I was able to get my WF-3640 working by compiling the epson drivers from source.

Download src files from http://download.ebz.epson.net/dsc/du/02 … 16bfac03be
or

Code: Select all

wget https://download3.ebz.epson.net/dsc/f/03/00/06/06/12/5102fbe4d3ad88f52f9648d234fa24a19ba7ccfc/epson-inkjet-printer-escpr-1.6.14.tar.gz

sudo apt-get install libcups2-dev libcupsimage2 libcupsimage2-dev

gunzip epson-inkjet-printer-escpr-1.6.14.tar.gz
tar -xf epson-inkjet-printer-escpr-1.6.14.tar
cd epson-inkjet-printer-escpr-1.6.14

sudo ./configure
sudo make
sudo make install

The colors were coming out faded (draft mode) so I also had to set the printer media-type option to high, to fix this.

Source: Epson WF3640/CUPS Problems – Raspberry Pi Forums

Posted on Leave a comment

Printing from Canon MF4150 printer using CUPS – Raspberry Pi Forums

I’m trying to print Canon ImageClass from my raspberry pi running raspbian jessie and from my iPad running iOS 10 using the manufacturers latest linux driver but I’m not having any luck. I have setup up the printer using CUPS, samba, avahi-daemon and avahi discover on the raspberry pi and used the manufacturers linux driver 3.31 of the CNCUPSMF4100ZS.ppd file in the CUPS configuration. I have shared the printer and installed the windows driver in a Windows 10 machine and I have no problem printing from windows 10 machine. At first I went to check the status of the printer in the CUPS printers page, it said ” IDLE – “File “usr/lib/cups/filter/pstoufr2cpca” not available: no such file or directory.” Then I copied the pstoufr2cpca directory from the manufacturers 3.31 linux driver to the /usr/lib/cups/filter/pstoufr2cpca and now I get this message ” Idle – “File “/Usr/lib/cups/filter/pstoufr2cpca” not available: Too many levels of symbolic links”.
Any suggestions? I would gladly appreciate it.

http://www.openprinting.org/printer/Can … imageCLASS

Source: Printing from Canon MF4150 printer using CUPS – Raspberry Pi Forums

Posted on Leave a comment

HD Partition questions – Raspberry Pi Forums

HD Partition questions Quote Sun Apr 02, 2017 2:20 pm I’ve setup one of my Pi 3’s to boot from a Hard Disk,a WD 1TB PiDrive. I’m trying to get my second one to boot from an externally powered WD 4 TB drive. When I try to partition it (following the instructions on the RP.org site) I get errors. I think I know the answer, but am looking for affirmation. SInce the drive is 4TB, the msdos/FAT32 partition type cannot understand the large size and corrupts the partition table. Does that sound correct? Or has

Source: HD Partition questions – Raspberry Pi Forums

Posted on Leave a comment

How to Partition and Format Drives on Linux – Pi My Life Up

Partitioning a Drive on Linux via Command Line

1. For most of this tutorial, we will be making use of a piece of software called parted. Parted is the CLI (Command-Line Interface) version of its GUI brother, gparted.

Parted will allow us to do numerous things such as being able to format drives as well as creating different partitions.

Before we get too far ahead of ourselves, we must first work out what drive we want to partition and format. For that purpose, we can use a tool such as blkid to find the drive we want to format.

Enter the command below to get information on your available drives.

sudo blkid

Below we have included a sample of what the command provided for us. The drive that we are interested in is located at the bottom of the list mounted at /dev/sda.

/dev/mmcblk0p1: LABEL="boot" UUID="6228-7918" TYPE="vfat" PARTUUID="76b5801c-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="6bfc8851-cf63-4362-abf1-045dda421aad" TYPE="ext4" PARTUUID="76b5801c-02"
/dev/mmcblk0: PTUUID="76b5801c" PTTYPE="dos"
/dev/sda: PTUUID="09c74626" PTTYPE="dos"

2. Now that we have our mount location for our USB drive available to us we can go ahead and start interacting with it using the parted software.

Now before we go ahead and start formatting our drive, we must first create the partition table for the drive. If your drive already has a partition table, then you can skip to the next step.

To create a partition table we can use a straightforward command, we need to reference the mount path, in our case /dev/sda, the mklabel command and the type of partition table we want to create.

In this case we are going to be using the more modern GPT table type. However, if you want or need you can utilize the much older msdos partition table (It’s also known as MBR or Master Boot Record)

To set this, run the following command. Swap out the mount path and table type where required.

sudo parted /dev/sda mklabel gpt

If a boot label already exists you will be shown a warning asking if you want to continue.

3. To create a partition on our new drive, we need to know the file format we intend on using, and the starting and ending position for that partition.

For example, if we wanted to create a 2GB partition on our empty 4GB USB, we would set the start position at 0 and the end position at 2GB.

Also if you want the partition to cover a percentage of the drive or the whole drive, you can specify sizes in %. For instance, 100% would fill the remaining space after the starting position.

Since we want to do that with our USB, we will be running the following command on it. Referencing its mount position of /dev/sda, the filesystem we want to use, fat32, and our starting and ending positions for the partition.

The parted tool also supports other filesystems such as ext2ext3ext4fat16fat32NTFS and more.

sudo parted /dev/sda mkpart primary fat32 0G 2G

4. Now that we have created our first partition on the drive, it should now be displayed using the blkid tool.

Just run the following command in your terminal on the Raspberry Pi to list all available partitions.

sudo blkid

Below you can see what the output looks like now, with our partition at /dev/sda1 now being shown.

/dev/mmcblk0p1: LABEL="boot" UUID="6228-7918" TYPE="vfat" PARTUUID="76b5801c-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="6bfc8851-cf63-4362-abf1-045dda421aad" TYPE="ext4" PARTUUID="76b5801c-02"
/dev/mmcblk0: PTUUID="76b5801c" PTTYPE="dos"
/dev/sda1: PARTLABEL="primary" PARTUUID="47470959-981d-4fe9-bb58-84bafeddbab5"

5. With our first partition now created we still have 2GB of spare space available on our 4GB drive.

We can now go ahead and format that partition using the various available mkfs tools if you don’t need to know how to handle multiple partitions you can move onto our “Formatting a partition” section.

To help give you more of an idea on how to use parted we will make another three partitions, two 512 MB partitions, and one 1 GB partition.

One thing to remember when creating additional partitions is that your new partitions must allocate space that isn’t already allocated. For example, the first partition we created filled from 0MB to 2 GB meaning that any additional partition must fill space after the first 2 GB of data.

The starting and ending positions are something that you will see more of in the three commands below.

Additionally our examples below we will be using the filesystem formats, NTFS, ext2, ext4. We are using a variety of filesystem formats to give you an idea of how each of these will be formatted.

sudo parted /dev/sda mkpart primary ntfs 2GB 3GB
sudo parted /dev/sda mkpart primary ext2 3000MB 3500MB
sudo parted /dev/sda mkpart primary ext4 3.5G 100%

6. Now that we have successfully created all our partitions lets go ahead and rerun the blkid tool to see our new partitions show up.

sudo blkid

Below is the output of the command.

/dev/mmcblk0p1: LABEL="boot" UUID="6228-7918" TYPE="vfat" PARTUUID="76b5801c-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="6bfc8851-cf63-4362-abf1-045dda421aad" TYPE="ext4" PARTUUID="76b5801c-02"
/dev/mmcblk0: PTUUID="76b5801c" PTTYPE="dos"
/dev/sda1: PARTLABEL="primary" PARTUUID="47470959-981d-4fe9-bb58-84bafeddbab5"
/dev/sda2: PARTLABEL="primary" PARTUUID="07e3d328-3fb7-4a09-8ded-cf74178bde2a"
/dev/sda3: PARTLABEL="primary" PARTUUID="82d3de54-07e2-42de-94b6-825bf8dcfe7a"
/dev/sda4: PARTLABEL="primary" PARTUUID="df1af8e1-5e8b-4909-b754-f3a54aa4c2ac"

7. Now that we are all done with creating our partitions, and can see them, we should now proceed onto actually formatting these partitions.

 Formatting Partitions on Linux via Command Line

1. Now that we have created all our partitions, we need to format them. The parted tool only creates the partitions themselves and sets a few bytes so that the system can understand what format to expect on that partition

To format these partitions, we will be making use of a tool called mkfs. This tool is primarily designed to format partitions and has support for a wide range of filesystems.

Thankfully mkfs is very easy to use. Basically you need to call it with the filesystem type you want to use and the device that it should be formatting.

Let’s begin by formatting our first partition. This partition is located at /dev/sda1. For this partition, we will be formatting it in the fat32 filesystem type. For mkfs this means we need to use vfat as the filesystem type.

To do this we can use a shorthand version of the mkfs command, you can see below that we simply need to call mkfs.vfat followed by the partitions mount location.

sudo mkfs.vfat /dev/sda1

2. As you can see with the previous command it is very easy to format your partitions, and is a much simpler process then creating partitions.

Below we will showcase a few examples of other filesystems you can format using this method.

sudo mkfs.ntfs /dev/sda2
sudo mkfs.ext2 /dev/sda3
sudo mkfs.ext4 /dev/sda4

3. Now that we have formatted all of our partitions, we can now mount them if we choose to do so.

If you want to verify that each partition has actually been formatted we can again make use of the blkid tool to show us all the partitions and their formatted filesystem type.

sudo blkid

Below you can see what the output looks like now, with our four different partitions being formatted with four different filesystem types.

/dev/mmcblk0p1: LABEL="boot" UUID="6228-7918" TYPE="vfat" PARTUUID="76b5801c-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="6bfc8851-cf63-4362-abf1-045dda421aad" TYPE="ext4" PARTUUID="76b5801c-02"
/dev/sda1: UUID="DCF5-DDF6" TYPE="vfat" PARTLABEL="primary" PARTUUID="d7e89b84-3817-4393-b348-75f47618dd3e"
/dev/mmcblk0: PTUUID="76b5801c" PTTYPE="dos"
/dev/sda2: UUID="656268AC53B5530D" TYPE="ntfs" PTTYPE="dos" PARTLABEL="primary" PARTUUID="07e3d328-3fb7-4a09-8ded-cf74178bde2a"
/dev/sda3: UUID="9887c8c7-f5f9-4440-9ec1-b84793877366" TYPE="ext2" PARTLABEL="primary" PARTUUID="82d3de54-07e2-42de-94b6-825bf8dcfe7a"
/dev/sda4: UUID="3d8b1983-4a46-4c7d-9c97-e4adb233dcb7" TYPE="ext4" PARTLABEL="primary" PARTUUID="df1af8e1-5e8b-4909-b754-f3a54aa4c2ac"

4. You should hopefully now have an idea on how you can use tools that come with an operating system such as Raspbian to create new partitions and also format those partitions in various filesystem types.

If you are interested in what various filesystems that are supported by default you can look at our list below.

These can vary depending on what Linux distribution you are running, additionally you can add support for NTFS and exFAT by installing certain packages

Supported Filesystem types: msdos, bfs, cpm, ext2, ext3, ext4, minix, fat, vfat, hfs, vxfs, rf, rk, dec, NTFS.

I hope by the end of this tutorial you will now have an idea on how to partition and format drives using your Raspberry Pi or your Linux device.

How to Partition and Format Drives on Linux

Source: How to Partition and Format Drives on Linux – Pi My Life Up

Posted on Leave a comment

[SOLVED] Owncloud 8.0 – Data directory permissions to 0770 – ownCloud Forums

Hi!

I habe now install my raspi Pi 1GB new with the iso from rasperry pi wheezy 15.05.2015 and the tuturial here http://www.freiesoftwareog.org/downloads/OwnCloudAufRaspberryPi.pdf and everything worked fine but now after I switched the path to

/media/usb-hdd/ownCloud/data

and I open the intern side of

http://192.168.178.25/owncloud/data

or

http://192.168.178.25/owncloud/

it will shows this

Data directory ( / media / USB-HDD / ownCloud / data ) can be read by other users
Please change the permissions to 0770 so that the directory can not be viewed by other users .

Here are my terminal orders

pi@OWNCloud /media/usb-hdd/ownCloud/data $ ls
admin index.html owncloud.db owncloud.log

pi@OWNCloud /media/usb-hdd/ownCloud/data $ ls -ld /media/usb-hdd/
drwxrwxrwx 1 root root 4096 Jun 14 19:48 /media/usb-hdd/

pi@OWNCloud /media/usb-hdd/ownCloud/data $ ls -ld /media/usb-hdd/ownCloud/
drwxrwxrwx 1 root root 0 Jun 14 19:16 /media/usb-hdd/ownCloud/

pi@OWNCloud /media/usb-hdd/ownCloud/data $ ls -ld /media/usb-hdd/ownCloud/data
drwxrwxrwx 1 root root 4096 Jun 14 20:46 /media/usb-hdd/ownCloud/data

The order rights I give again via

pi@OWNCloud /media/usb-hdd/ownCloud/data $ sudo chown -R www-data:www-data /media/usb-hdd/ownCloud/

pi@OWNCloud /media/usb-hdd/ownCloud/data $ sudo chown -R www-data:www-data /media/usb-hdd/ownCloud/data/

takes no change.

Please help!

Last edited by gwdu398rz093e on Tue Jun 16, 2015 10:52 pm, edited 1 time in total.

JoHoffmann

Newbie
Posts: 6
Joined: Fri Jun 12, 2015 8:20 am
ownCloud version: 8.0.2
Webserver: Apache
Database: MySQL
OS: Linux

Re: Owncloud 8.0.4 – Data directory permissions to 0770 How

Postby JoHoffmann » Mon Jun 15, 2015 8:10 am

You´ve only changed the user and group, to which the files/directory belongs.

You change permissions with

CODE: SELECT ALL

chmod 770 DIRECTORY-TO-CHANGE

or recursive with

CODE: SELECT ALL

chmod 770 -R DIRECTORY-TO-CHANGE

RealRancor

ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: Owncloud 8.0.4 – Data directory permissions to 0770 How

Postby RealRancor » Mon Jun 15, 2015 8:42 am

Hi,

@gwdu398rz093e

instead of creating a new thread (without even linking to your old one) you could have a look at the suggestion here:

viewtopic.php?f=31&t=28734&p=89375#p89377

and follow this instructions as Linux permissions won’t apply on NTFS filesystems.

*gone*

gwdu398rz093e

Beginner
Posts: 20
Joined: Wed Jun 10, 2015 9:57 pm
ownCloud version: 8.2.2
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: PHP 5.4.41-0+deb7u1

[SOLVED] Owncloud 8.0.4 – Data directory permissions to 0770

Postby gwdu398rz093e » Tue Jun 16, 2015 10:51 pm

So thanks for reply!

Now after many sides that I read in the internet I found the solution for my problem.

I have to put this information into my etc/fstab

via

sudo nano /etc/fstab
UUID=3488A17988A139EE /media/usb-hdd ntfs defaults,nls=utf8,uid=1000,gid=1000,dmask=007,windows_names 0 0
uid=1000 -> for the user pi
gid=1000 -> for the group pi

dmask = 007 –> the answer was here by Drenriza
http://ubuntuforums.org/showthread.php?t=1453342
and here at Step 5
http://www.techjawab.com/2013/06/how-to-setup-mount-auto-mount-usb-hard.html
but only it was dmask (for directions) and not with umask (for files).

Then after a sudo reboot was my error 0770 gone!

Now I can reach my owncloud via http://192.168.178.25/owncloud/index.php/apps/files/

regards

 

Source: [SOLVED] Owncloud 8.0 – Data directory permissions to 0770 – ownCloud Forums

Posted on Leave a comment

Field Note to setup OwnCloud + SSL

Here is summarized step to install those on the RaspberyPI Streach 

wget -nv https://download.owncloud.org/download/repositories/production/Debian_9.0/Release.key -O Release.key

echo ‘deb http://download.owncloud.org/download/repositories/production/Debian_9.0/ /’ | sudo tee /etc/apt/sources.list.d/owncloud.list

sudo apt install apache2 libapache2-mod-php mariadb-server mariadb-client php-bz2 php-mysql php-curl php-gd php-imagick php-intl php-mbstring php-xml php-zip

sudo a2enmod rewrite

wget https://download.owncloud.org/community/owncloud-10.2.0.tar.bz2

cd /var/www/html

sudo tar -xjf ~/owncloud-10.2.0.tar.bz2 ( Plese download this from the website )

sudo chown -R www-data:www-data owncloud

sudo chmod -R 755 owncloud

Following is to make openSSL

in my case:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -out /etc/apache2/ssl/server.crt -keyout /etc/apache2/ssl/server.key


https://www.snu.net/index.php/2020/01/30/enable-ssl-for-apache-server-in-5-minutes/


Using Differnt port other than https 443
https://www.snu.net/index.php/2020/01/30/apache-2-with-ssl-virtual-host-on-different-port-8080-or-8081-in-linux-super-user/