FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 09-25-2008, 07:18 PM
James
 
Default CF and Gentoo

Hello,

Background:
I've been on a journey to migrate many servers (firewalls and dns)
to Compact Flash (CF) drives to improve reliability, ease in new
installation, ease replacing hard drivers that fail, duplicating
drives that fail and cloning servers with a simple, straightforward
methodology.

This is the CF method, later on I'll do a USB page, but, lots
of older hardware will not boot off of usb, but if somebody wants
to write to me a methodology for usb sticks, that would be cool.

I'm not exactly the quintessential sys-admin, so as I outline
my ideas and issues, please feel encouraged to help me make the
efforts better. Hopefully, it will result in a wiki that everyone
can use.


Issue 1. Cost containment.
Right now, I'm using 4GB Sandisk CF cards in vintage x86 and k5
machines without issue. I use CF-2-ide converters that are not
labels, made in china. It'd be nice to be able to use some of
the less expensive 4GB CF cards, but I have not tested any, and
do not wish to purchase a random sample to establish confidence.
Any one with low-cost CF cards that work reasonable well, just let me know.


Issue 2. Ease of access.

Currently, I had a bunch of old IDE chasis that are locked and come in
a tray form. Once you install the tray, you can easily remove the tray
from the front of the machine. The CF-2-ide converters which contain
the CF cards are easily access. I do this because I have many of these
old removable ide trays already. What would be better is to find
pci internal slot cards that have the CF-2-ide built in and the
CF cards would be accessible from the back of the machines. Any
suggests for this type of hardware would been keen.

Issue 3. Ease of purchase.
I'd really like to find a single, low-cost supplier of the CF
cards and the CF-2-ide converter hardware. Any suggestions?


Issue 4. Cloning or Duplicating.
As many of you know, installations can be quite time consuming,
and challenging on old PCs. So what I intend to do is take
and currently running machine and stream the contents to
another machine with a CF burner or pull the CF card from
a machine that is in good shape but shutdown and duplicate it.

Two issues I see.

4A. Best method to duplicate the CF card live while the system
is running.

DD, cpio, scp (example syntax) in a step by step)?

4B. What is the minimal amount of data/files that need to be edited
bot build a similar but unique machine.
1. IP address (edit conf.d/net).
2. Name (edit) conf.d/hostname).
Anything else?


James
 
Old 09-25-2008, 09:38 PM
Neil Bothwick
 
Default CF and Gentoo

On Thu, 25 Sep 2008 19:18:56 +0000 (UTC), James wrote:

> I've been on a journey to migrate many servers (firewalls and dns)
> to Compact Flash (CF) drives to improve reliability,

Bear in mind the limited write lifetime of flash memory. Don't put /var
or /tmp on such a card if you can avoid it.

http://linitx.com/viewproduct.php?prodid=10448

> Issue 4. Cloning or Duplicating.
> As many of you know, installations can be quite time consuming,
> and challenging on old PCs. So what I intend to do is take
> and currently running machine and stream the contents to
> another machine with a CF burner or pull the CF card from
> a machine that is in good shape but shutdown and duplicate it.

Why not copy the contents of a card to a hard disk somewhere? That way
you don't have to disturb a running machine to make a copy.

> 4A. Best method to duplicate the CF card live while the system
> is running.

Don't.

> DD, cpio, scp (example syntax) in a step by step)?

You could dd the card to a file and use the same file every time you need
a new card.

> 4B. What is the minimal amount of data/files that need to be edited
> bot build a similar but unique machine.
> 1. IP address (edit conf.d/net).
> 2. Name (edit) conf.d/hostname).

Both of these can be handled by DHCP.


--
Neil Bothwick

File not found. Should I fake it? (Y/N)
 
Old 09-26-2008, 06:21 PM
James
 
Default CF and Gentoo

Neil Bothwick <neil <at> digimed.co.uk> writes:


> Bear in mind the limited write lifetime of flash memory. Don't put /var
> or /tmp on such a card if you can avoid it.

Well, I'm not sure any other alternatives are attractive? Unless
I find a way to mount those partitions off of a usb stick, or
some other idea?

Since they are not frequently updated and have minimal installed software
(iptables on firewalls and DNS on DNS servers) accompanied by the
fact that most devices have internal wear leveling; it should take
many years to reach the write cycle limits?


> http://linitx.com/viewproduct.php?prodid=10448

very cool! exactly what I could not find.



> > Issue 4. Cloning or Duplicating.
> > As many of you know, installations can be quite time consuming,
> > and challenging on old PCs. So what I intend to do is take
> > and currently running machine and stream the contents to
> > another machine with a CF burner or pull the CF card from
> > a machine that is in good shape but shutdown and duplicate it.

> Why not copy the contents of a card to a hard disk somewhere? That way
> you don't have to disturb a running machine to make a copy.

> > DD, cpio, scp (example syntax) in a step by step)?

> You could dd the card to a file and use the same file every time you need
> a new card.

Um I do not mean to be a pain, but could you provide a little bit
of pseudo-syntax? Assume I have shutdown a 4 GB CF firewall card
and moved it to a reader/writer on another machine. First I need
to format the raw (new) 4GB CF card from a reader.

/media/sdb1 shows up, but when I run 'fdisk /media/sdb1' I get:

last_lba(): I don't know how to handle files with mode 40755
You will not be able to write the partition table.


In the past I have formated the CF cards on the new machine being built,
but I need help figuring out how to do this, from a CF reader/writer
on another machine (thus avoiding a traditional install) ?


James
 
Old 09-26-2008, 10:05 PM
Neil Bothwick
 
Default CF and Gentoo

On Fri, 26 Sep 2008 18:21:06 +0000 (UTC), James wrote:

> > Bear in mind the limited write lifetime of flash memory. Don't
> > put /var or /tmp on such a card if you can avoid it.
>
> Well, I'm not sure any other alternatives are attractive? Unless
> I find a way to mount those partitions off of a usb stick, or
> some other idea?
>
> Since they are not frequently updated and have minimal installed
> software (iptables on firewalls and DNS on DNS servers) accompanied by
> the fact that most devices have internal wear leveling; it should take
> many years to reach the write cycle limits?

What about /var/log? The various logfiles are written very frequently.
Could you NFS mount this from somewhere else? I wouldn't rely on wear
levelling in a CF card, only on an SSDdrive.

> > http://linitx.com/viewproduct.php?prodid=10448
>
> very cool! exactly what I could not find.

I used one of their adaptors to run a MythTV frontend from CF, although
it netboots now. I used a variation on a live CD setup, so the card was
not written to.

> > You could dd the card to a file and use the same file every time you
> > need a new card.
>
> Um I do not mean to be a pain, but could you provide a little bit
> of pseudo-syntax? Assume I have shutdown a 4 GB CF firewall card
> and moved it to a reader/writer on another machine. First I need
> to format the raw (new) 4GB CF card from a reader.
>
> /media/sdb1 shows up, but when I run 'fdisk /media/sdb1' I get:
>
> last_lba(): I don't know how to handle files with mode 40755
> You will not be able to write the partition table.

/media/sdb1 is the mount point, not the device node. Use

dd if=/dev/sdb of=CF.img bs=4096

to read the card, switch of and if to write a new one. Of course, all the
cards have to be the same size.

> In the past I have formated the CF cards on the new machine being built,
> but I need help figuring out how to do this, from a CF reader/writer
> on another machine (thus avoiding a traditional install) ?

You don't need to format at all if you dd the whole drive, as that
includes the partition table, MBR and the kitchen sink.


--
Neil Bothwick

Rude alert, rude alert! A fire has knocked out my voice recognition
unicycle. Many wurlitzers are missing from my database. Abandon shop,
abandon shop! This is not a daffodil, repeat, this is not a daffodil!
 
Old 09-27-2008, 10:18 PM
Stroller
 
Default CF and Gentoo

On 26 Sep 2008, at 19:21, James wrote:


Neil Bothwick <neil <at> digimed.co.uk> writes:


Bear in mind the limited write lifetime of flash memory. Don't put /
var

or /tmp on such a card if you can avoid it.


Well, I'm not sure any other alternatives are attractive? Unless
I find a way to mount those partitions off of a usb stick, or
some other idea?

Since they are not frequently updated and have minimal installed
software

(iptables on firewalls and DNS on DNS servers) accompanied by the
fact that most devices have internal wear leveling; it should take
many years to reach the write cycle limits?


I've read a fair little bit about this subject and never gotten a
definitive answer on what is "safe", but AIUI the wear-levelling on
flash memory is filesystem-dependent. Thus it may work fabulously well
for FAT filesystems, and not at all for EXT.


Having said that, from my experience most of the nay-sayers telling
you not to put stuff on a CFcard for this reason are talking
speculatively - I have encountered one or two people who have used
CFcards very happily for years. It does seem sensible to store logs,
tmp & Portage directories on a RAM disk or hard-drive, NFS mounted if
necessary, but generally I would say just get on & try it. 4gig
CFcards are, after all, cheap as chips these days. Oh! It may be
possible to reduce the number of writes to the card by changing mount
options in /etc/fstab and have writes flushed less frequently.


You might consider posting about this - or merely searching the
archives - on the MythTV users list, as the subject does come up
periodically and there are a number of people using CF cards in this
way to reduce noise in the TV room.


You could dd the card to a file and use the same file every time
you need

a new card.


Um I do not mean to be a pain, but could you provide a little bit
of pseudo-syntax? Assume I have shutdown a 4 GB CF firewall card
and moved it to a reader/writer on another machine. First I need
to format the raw (new) 4GB CF card from a reader.



Put CFcard with existing filesystem in card-reader:
dd if=/dev/sdX of=~/diskimage.img

Swap cards in reader, writing to blank now:
dd if=~/diskimage.img of=/dev/sdX

You need to ensure that neither card is mounted when following this
procedure - booting from a LiveCD or 3rd filesystem.


Stroller.
 
Old 09-28-2008, 06:55 AM
Alan McKinnon
 
Default CF and Gentoo

On Sunday 28 September 2008 00:18:35 Stroller wrote:
> > Since they are not frequently updated and have minimal installed *
> > software
> > (iptables on firewalls and DNS on DNS servers) accompanied by the
> > fact that most devices have internal wear leveling; it should take
> > many years to reach the write cycle limits?
>
> I've read a fair little bit about this subject and never gotten a *
> definitive answer on what is "safe", but AIUI the wear-levelling on *
> flash memory is filesystem-dependent. Thus it may work fabulously well *
> for FAT filesystems, and not at all for EXT.

Rule of thumb:

The problem is that the ability for individual memory cells to reliably
perform writes deteriorates over time. Cheap and nasty devices can start to
fail after 10,000 writes to a cell, the better devices can often cope with
100,000 writes to a single cell.

The reason there is little definitive data is that it isn't a definitive
problem - the variables vary wildly. Like you say, some filesystems do wear
levelling (some better than others), some use cases are frugal with their
writes, and the device itself has enormous variance as to when it will stop
performing as expected.

The numbers above must be interpreted as the maximum number of writes where
the manufacturer is still prepared to guarantee the device.

--
alan dot mckinnon at gmail dot com
 
Old 09-28-2008, 04:05 PM
Simon
 
Default CF and Gentoo

4A. Best method to duplicate the CF card live while the system
is running.


Best method I now which is near effort-less, but requires preparation is to
setup your drive initially as a RAID-1 mirror but force it to have only one
drive (if you don't want it mirrored all the time).


Then, add a new drive to the RAID-1 and watch the synchronization. Once
finished, take the drive out by failing it cleanly then by removing it, and you
have an integral raid-mirrored copy of your original drive while it was running.


On my own home-gateway, I used this to "burn" the latest state of the system to
disk, and I used usb keys as main drives. At boot, it would pick up which ever
is in most current state and update the other. And later in my local script, I
would fail the hard drive so this gateway would become completely silent, except
for the fan. (Noise was a big factor in my setup as it uses real old hardware)


You could do exactly the same using a device in ram to avoid witting to the
compact flash. It would boot from the single-mirror on your drive, sync with a
device-in-ram (see ramfs and losetup, quite a hack but always worked for me),
then fail the physical drive and run only on ram. Then in your local.stop
script re-sync with the physical drive.


The biggest problem with this method and flash cards is with the write limit.
The RAID sync will overwrite every single byte on the card, so every physical
sector will decrease in lifespan. Where is you used an intelligent copy program
such as rsync, sector lifespan would increase more randomly and more slowly.


I do not recommend the use of flash cards for anything else than read-only data
(that you can change sometimes). I compare it to a better-cd-rw.


Simon
 
Old 10-03-2008, 01:52 AM
James
 
Default CF and Gentoo

Simon <turner25 <at> gmail.com> writes:


> Best method I now which is near effort-less, but requires preparation is to
> setup your drive initially as a RAID-1 mirror but force it to have only one
> drive (if you don't want it mirrored all the time).
>


Thanks for all of the input. I have a severe knee injury, (basketball)
so this project will be put on ice, until after knee surgery.


thanks to all that helped.


James
 
Old 10-03-2008, 07:23 AM
Mick
 
Default CF and Gentoo

On Friday 03 October 2008, James wrote:
> Simon <turner25 <at> gmail.com> writes:
> > Best method I now which is near effort-less, but requires preparation is
> > to setup your drive initially as a RAID-1 mirror but force it to have
> > only one drive (if you don't want it mirrored all the time).
>
> Thanks for all of the input. I have a severe knee injury, (basketball)
> so this project will be put on ice, until after knee surgery.
>
>
> thanks to all that helped.

Good luck James and best wishes for a quick recovery!
--
Regards,
Mick
 

Thread Tools




All times are GMT. The time now is 06:54 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org