Thread: question: knopixx and postgresql on flash drive

question: knopixx and postgresql on flash drive

From
Mark
Date:
I would like to use postgresql with knopixx, Sounds like a simple
idea :-) and I would like to get full version of postgresql stored on
flash drive.

I remeber I've seen postgresql tar files before, but do not recall
the location - can anybody point?

Also, how big (in MB) postgresql takes after install?

If there is any better way to have postgresql installed on usb drive
and have it executebale from lnopixx - please let me know

Thanks,
Mark




____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html

Re: question: knopixx and postgresql on flash drive

From
James Neff
Date:
Mark wrote:
> I would like to use postgresql with knopixx, Sounds like a simple
> idea :-) and I would like to get full version of postgresql stored on
> flash drive.
>
> I remeber I've seen postgresql tar files before, but do not recall
> the location - can anybody point?
>
> Also, how big (in MB) postgresql takes after install?
>
> If there is any better way to have postgresql installed on usb drive
> and have it executebale from lnopixx - please let me know
>
> Thanks,
> Mark
>
>
>

That is not going to be very fast.

Have you considered maybe an external hard drive instead?



Re: question: knopixx and postgresql on flash drive

From
Vladimir Zelinski
Date:
SQLite database is much better choice for flash drive
from my point of view.


--- James Neff <jneff@tethyshealth.com> wrote:

> Mark wrote:
> > I would like to use postgresql with knopixx,
> Sounds like a simple
> > idea :-) and I would like to get full version of
> postgresql stored on
> > flash drive.
> >
> > I remeber I've seen postgresql tar files before,
> but do not recall
> > the location - can anybody point?
> >
> > Also, how big (in MB) postgresql takes after
> install?
> >
> > If there is any better way to have postgresql
> installed on usb drive
> > and have it executebale from lnopixx - please let
> me know
> >
> > Thanks,
> > Mark
> >
> >
> >
>
> That is not going to be very fast.
>
> Have you considered maybe an external hard drive
> instead?
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq
>


Re: question: knopixx and postgresql on flash drive

From
Mark
Date:
Since it's going to be a development environment I don't need it
fast.

So, I would still prefer to go ahead with USB drive.

Mark
--- James Neff <jneff@tethyshealth.com> wrote:

> Mark wrote:
> > I would like to use postgresql with knopixx, Sounds like a simple
> > idea :-) and I would like to get full version of postgresql
> stored on
> > flash drive.
> >
> > I remeber I've seen postgresql tar files before, but do not
> recall
> > the location - can anybody point?
> >
> > Also, how big (in MB) postgresql takes after install?
> >
> > If there is any better way to have postgresql installed on usb
> drive
> > and have it executebale from lnopixx - please let me know
> >
> > Thanks,
> > Mark
> >
> >
> >
>
> That is not going to be very fast.
>
> Have you considered maybe an external hard drive instead?
>
>
>




____________________________________________________________________________________
The fish are biting.
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php

Re: question: knopixx and postgresql on flash drive

From
"Merlin Moncure"
Date:
On 3/23/07, Mark <sendmailtomark@yahoo.com> wrote:
> I would like to use postgresql with knopixx, Sounds like a simple
> idea :-) and I would like to get full version of postgresql stored on
> flash drive.
>
> I remeber I've seen postgresql tar files before, but do not recall
> the location - can anybody point?
>
> Also, how big (in MB) postgresql takes after install?
>
> If there is any better way to have postgresql installed on usb drive
> and have it executebale from lnopixx - please let me know

postgresql is quite small for full installation, maybe 30mb or less
(on mine is 25mb for /usr/local/pgsql).  for extreme situations you
may want to explore .exe compression.  I would suggest compile from
source because then you can omit ssl which you probably don't need,
etc, and contrib, etc.

maybe instead of knoppix you can consider distro optmized for thumb:
http://flashlinux.org.uk/.

I disagree with others, postgresql on flash drive will not necessarily
suck, although it will eventually wear out a flash device
presumably...<2.0 usb will be painful however. Ideally you can mount
disk storage from the computer.  It is fun experiment at the very
least.  good luck!

merlin

Re: question: knopixx and postgresql on flash drive

From
Stephen Liu
Date:
Hi Mark,

> Since it's going to be a development environment I don't need it
> fast.
>
> So, I would still prefer to go ahead with USB drive.

I like your idea.  Last year I tested installing a complete Linux OS on
USB drive (thumb drive) of 1G size.  It worked booting direct on PC.
It has a compressed system compressing files on USB thumb drive.
Nowadays 2/4G thumb drives are available on market with their price
contiune dropping.

The advantage of running thumb drive is convenient to carry.  Its
disadvantage is having life-time.  I don't know how big will be your
database.  I'm sure a complete Linux OS can be installed on a thumb
drive of 1G size without sacrifying its features, not featherweight nor
damnsmall Linux.  I also tested the latter on thumb drive.  They worked
fantastically.


B.R.
Stephen Liu

>
> Mark
> --- James Neff <jneff@tethyshealth.com> wrote:
>
> > Mark wrote:
> > > I would like to use postgresql with knopixx, Sounds like a simple
> > > idea :-) and I would like to get full version of postgresql
> > stored on
> > > flash drive.
> > >
> > > I remeber I've seen postgresql tar files before, but do not
> > recall
> > > the location - can anybody point?
> > >
> > > Also, how big (in MB) postgresql takes after install?
> > >
> > > If there is any better way to have postgresql installed on usb
> > drive
> > > and have it executebale from lnopixx - please let me know
> > >
> > > Thanks,
> > > Mark
> > >
> > >
> > >
> >
> > That is not going to be very fast.
> >
> > Have you considered maybe an external hard drive instead?
> >
> >
> >
>
>
>
>
>
____________________________________________________________________________________
> The fish are biting.
> Get more visitors on your site using Yahoo! Search Marketing.
> http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq
>


Send instant messages to your online friends http://uk.messenger.yahoo.com

Re: question: knopixx and postgresql on flash drive

From
Raymond O'Donnell
Date:
On 24/03/2007 03:24, Stephen Liu wrote:

> The advantage of running thumb drive is convenient to carry.  Its
> disadvantage is having life-time.  I don't know how big will be your

Not to mention the danger of losing the confounded thing :) ..... I've
had a scare or two in the past with these devices.

Ray.


---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------

Re: question: knopixx and postgresql on flash drive

From
Mark
Date:
Ideally, I'd like to have all postgresql related files on flush
drive. and OS on another device (CD). Database data will be small and
I don't think I will run into the problem with a space.

But how can I install postgresql (including all libraries) on flash
drive? I remember that 7.4.X rpms always get installed into /usr
which is ramdrive in my case. Is it possible?

Thanks,
Mark
--- Merlin Moncure <mmoncure@gmail.com> wrote:

> On 3/23/07, Mark <sendmailtomark@yahoo.com> wrote:
> > I would like to use postgresql with knopixx, Sounds like a simple
> > idea :-) and I would like to get full version of postgresql
> stored on
> > flash drive.
> >
> > I remeber I've seen postgresql tar files before, but do not
> recall
> > the location - can anybody point?
> >
> > Also, how big (in MB) postgresql takes after install?
> >
> > If there is any better way to have postgresql installed on usb
> drive
> > and have it executebale from lnopixx - please let me know
>
> postgresql is quite small for full installation, maybe 30mb or less
> (on mine is 25mb for /usr/local/pgsql).  for extreme situations you
> may want to explore .exe compression.  I would suggest compile from
> source because then you can omit ssl which you probably don't need,
> etc, and contrib, etc.
>
> maybe instead of knoppix you can consider distro optmized for
> thumb:
> http://flashlinux.org.uk/.
>
> I disagree with others, postgresql on flash drive will not
> necessarily
> suck, although it will eventually wear out a flash device
> presumably...<2.0 usb will be painful however. Ideally you can
> mount
> disk storage from the computer.  It is fun experiment at the very
> least.  good luck!
>
> merlin
>




____________________________________________________________________________________
Get your own web address.
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL

Re: question: knopixx and postgresql on flash drive

From
"Merlin Moncure"
Date:
On 3/28/07, Mark <sendmailtomark@yahoo.com> wrote:
> Ideally, I'd like to have all postgresql related files on flush
> drive. and OS on another device (CD). Database data will be small and
> I don't think I will run into the problem with a space.
>
> But how can I install postgresql (including all libraries) on flash
> drive? I remember that 7.4.X rpms always get installed into /usr
> which is ramdrive in my case. Is it possible?


Install from source.  You get to omit ssl which you probably dont need
and set the prefix in the configure statement...you will need to set
up your own startup script though, add the binaries to the path
yourself, and set your own PGDATA.

merlin

Re: question: knopixx and postgresql on flash drive

From
Mark
Date:
Here results of what I've done.

Just a note all this was done on 7.4.16:

First of all problems:
1. cannot complete configure on flass drive
./configure --prefix=/media/sda1/app/psql/postgresql-7.4.16/bin
--without-readline

...

configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating src/Makefile.global
config.status: creating src/include/pg_config.h
config.status: linking ./src/backend/port/tas/dummy.s to
src/backend/port/tas.s
ln: creating hard link `src/backend/port/tas.s' to
`./src/backend/port/tas/dummy.s': Operation not permitted
config.status: error: cannot link src/backend/port/tas.s to
./src/backend/port/tas/dummy.s
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating src/Makefile.global
config.status: creating src/include/pg_config.h
config.status: linking ./src/backend/port/tas/dummy.s to
src/backend/port/tas.s
ln: creating hard link `src/backend/port/tas.s' to
`./src/backend/port/tas/dummy.s': Operation not permitted
config.status: error: cannot link src/backend/port/tas.s to
./src/backend/port/tas/dummy.s


2.Then I build the source in knopixx directory. Build was
successfull.
An attempt to init database on flash drive failed:

knoppix@Knoppix:/ramdisk/home/knoppix/test/build/bin$ ./initdb -D
/media/sda1/app/psql/rdata
The files belonging to this database system will be owned by user
"knoppix".
This user must also own the server process.

The database cluster will be initialized with locale C.


creating directory /media/sda1/app/psql/rdata/pg_xlog... ok
creating directory /media/sda1/app/psql/rdata/pg_clog... ok
selecting default max_connections... 100
selecting default shared_buffers... 1000
creating configuration files... ok
creating template1 database in /media/sda1/app/psql/rdata/base/1...
PANIC:  could not link file
"/media/sda1/app/psql/rdata/pg_xlog/xlogtemp.30300" to
"/media/sda1/app/psql/rdata/pg_xlog/0000000000000000" (initialization
of log file 0, segment 0): Operation not permitted
./initdb: line 644: 30300 Aborted                 "$PGPATH"/postgres
-boot -x1 $PGSQL_OPT $BOOTSTRAP_TALK_ARG template1

initdb: failed
initdb: removing data directory "/media/sda1/app/psql/rdata"
knoppix@Knoppix:/ramdisk/home/knoppix/test/build/bin$

However I made it work.



Here the work around:
=====================

tar build and data directories and copied over to flash drive. and
when knopix starts I copied it in any directory and it works

restart knopixx
untar data.tar and build.tar into the same directory (just to make it
easy)

Let's try to run:
knoppix@Knoppix:~/db/build/bin$ psql test
psql: error while loading shared libraries: libpq.so.3: cannot open
shared object file: No such file or directory
knoppix@Knoppix:~/db/build/bin$

Opps! missing library, fixing it by setting LD_LIBRARY_PATH. Since
the old value not (in my case) set doing it like this:
knoppix@Knoppix:~/db/build/bin$ export
LD_LIBRARY_PATH=/ramdisk/home/knoppix/db/build/lib

knoppix@Knoppix:~/db/build/bin$ psql test
Welcome to psql 7.4.16, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

test=# \d
       List of relations
 Schema | Name | Type  |  Owner
--------+------+-------+---------
 public | the  | table | knoppix
      (1 row)

test=# select * from the;
 name
-------
abcde
(1 row)

test=# \q
knoppix@Knoppix:~/db/build/bin$
Note: The table was create before and was a part od data directory.

TA-DA! It works!!!

the build and data didn't took much space:
 2718136 data.tar
14919680 build.tar

OS used: Knopixx 2007-01-04
Kernel: Linux Knoppix 2.6.19
PC Memory 512 MB

This is good enough in my case I probably will re-burn knoppix CD to
include those two tar files - just need to find how, but this is a
different story.

It loos like tar-ing data directory does the work for keeping data
stored back to flash drive, however pg_dump is also can be used.

So, the only problem I had was with creating links and if anybody has
an idea how it can be fixed, can you let me know.

Cheers!
Mark

--- Merlin Moncure <mmoncure@gmail.com> wrote:

> On 3/28/07, Mark <sendmailtomark@yahoo.com> wrote:
> > Hi Merlin,
> > Can you point where I can find build instructions for 7.4.X?
> > or in which sequence I should build sources from
> > http://www.postgresql.org/ftp/source/v7.4.16/
> >
> > Thanks a lot,
> > Mark
> > --- Merlin Moncure <mmoncure@gmail.com> wrote:
> >
> > > On 3/28/07, Mark <sendmailtomark@yahoo.com> wrote:
> > > > Ideally, I'd like to have all postgresql related files on
> flush
> > > > drive. and OS on another device (CD). Database data will be
> small
> > > and
> > > > I don't think I will run into the problem with a space.
> > > >
> > > > But how can I install postgresql (including all libraries) on
> > > flash
> > > > drive? I remember that 7.4.X rpms always get installed into
> /usr
> > > > which is ramdrive in my case. Is it possible?
> > >
> > >
> > > Install from source.  You get to omit ssl which you probably
> dont
> > > need
> > > and set the prefix in the configure statement...you will need
> to
> > > set
> > > up your own startup script though, add the binaries to the path
> > > yourself, and set your own PGDATA.
>
> it's easy...download, untar sources
> ./configure [--prefix=/xyz]
> make
> make install
>
> whatever your reasoning for 7.4, overrule them and get something
> more modern :-)
>
> merlin
>




____________________________________________________________________________________
No need to miss a message. Get email on-the-go
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail

Re: question: knopixx and postgresql on flash drive

From
Raymond O'Donnell
Date:
On 29/03/2007 20:18, Peter L. Berghold wrote:

> Or having what happened to me... my emergency crash recovery data (pgp
> keys, Lotus Notes ID, stuff like that) on a USB drive got chewed up by
> the dog.  Thankfully I didn't actually need the thing before I could

Heh heh heh.....dogs are merely dangerous, children are lethal - they
have *much* more imagination when it comes to finding ways of
losing/destroying something vital.... :D

Ray.

---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------

Re: question: knopixx and postgresql on flash drive

From
"Peter L. Berghold"
Date:
On Sat, 2007-03-24 at 11:59 +0000, Raymond O'Donnell wrote:

>
> Not to mention the danger of losing the confounded thing :)


Or having what happened to me... my emergency crash recovery data (pgp
keys, Lotus Notes ID, stuff like that) on a USB drive got chewed up by
the dog.  Thankfully I didn't actually need the thing before I could
replace it...  :-D

--
Peter L. Berghold                               Unix Professional
Peter@Berghold.Net   AIM: redcowdawg YIM: blue_cowdawg
"Those who fail to learn from history are condemned to repeat it."

Attachment