Author |
Message |
rcrsn51

Joined: 05 Sep 2006 Posts: 11897 Location: Stratford, Ontario
|
Posted: Sun 04 Jul 2010, 08:51 Post subject:
How to Make a Flash Drive Install Work Like a Hard Drive |
|
A flash drive install of Puppy runs in PUPMODE=13 as opposed to PUPMODE=12 for a normal frugal install on a hard drive. This means that any files you add or change are temporarily held in memory, then flushed back to the pupsave file at regular intervals.
The intent of this system is to reduce excessive writing to the flash drive and prevent it from wearing out prematurely. But it also results in some annoying pauses, especially when you want to shut down.
Now that flash drives are cheaper and have wear-leveling technology, it may be simpler to run your USB install in regular PUPMODE=12. Be aware that the following procedure is somewhat experimental. YMMV.
1. Build a Puppy flash drive as usual, create a savefile and confirm that it is working correctly.
2. Boot off your hard drive and install the editinit-1.0.pet attached below. It adds a script to /root/my-applications/bin.
3. Mount your flash drive. Copy the file initrd.gz to a temporary location in your Linux filesystem, like /tmp. You cannot change the file while it is on a FAT32 drive!
4. Go to /tmp and open a terminal window. Run the command:
5. This loads the initrd.gz file into a text editor. Cursor down to around Line 800. In new Puppies like Slacko, go to Line 900. You are looking for a blank line after an esac statement. The exact location varies with the Puppy version.
6. After the esac statement, insert the line
7. Save and exit.
8. Copy this new initrd.gz file back onto the flash drive. You might want to first rename the old version to initrd.gz.old.
9. Boot off the flash drive. It may take a reboot to get everything working correctly, but you should now be running in PUPMODE=12 with a much faster shutdown.
Warning: At the end of a session, be sure to leave the flash drive plugged in until it has quit flashing and all activity is completed.
Description |
Updated 2014-05-24
|

Download |
Filename |
editinit-1.0.pet |
Filesize |
515 Bytes |
Downloaded |
242 Time(s) |
Last edited by rcrsn51 on Sat 24 May 2014, 16:46; edited 12 times in total
|
Back to top
|
|
 |
Sylvander
Joined: 15 Dec 2008 Posts: 4328 Location: West Lothian, Scotland, UK
|
Posted: Wed 21 Jul 2010, 11:44 Post subject:
|
|
Would it be possible to make a pupsave on a HDD act like it's on a Flash Drive?
e.g. Being able to configure no auto-save DURING a session [back to the pupsave]...
And also to be able to choose to NOT-SAVE [or save] at shut-down/reboot of a session.
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 11897 Location: Stratford, Ontario
|
Posted: Wed 21 Jul 2010, 12:04 Post subject:
|
|
Try using the above procedure, but with "PUPMODE=13".
[Edit] Or better yet, use jemimah's suggestion here.
|
Back to top
|
|
 |
nooby
Joined: 29 Jun 2008 Posts: 10548 Location: SwedenEurope
|
Posted: Wed 21 Jul 2010, 13:36 Post subject:
|
|
rcrsn51 , Jemimah suggest two different ways to do it?
Quote: | You don't need to edit the init script. Just add pmedia=ataflash to the bootloader. If you install with the Puppy Universal Installer, and tell it you have an SSD, you'll get this automatically.
Another trick you can do with recent kernels:
Code:
echo 0 > /sys/block/sda/queue/rotational
This will let the kernel know that the drive is an SSD so it can optimize I/O correctly. Often SSDs emulate rotational drives, so the kernel can't tell by itself. |
which of these works best for the purpose Sylvander has in mind.
Me have that need too.
_________________ I use Google Search on Puppy Forum
not an ideal solution though
|
Back to top
|
|
 |
DaveS

Joined: 09 Oct 2008 Posts: 3726 Location: UK
|
Posted: Wed 21 Jul 2010, 15:58 Post subject:
|
|
Thanks rc., this is a REALLY useful script. Though I can see the need for PUPMODE=13, I always hated the long shutdown and pauses. Works like a charm.
I tried to edit initrd myself a couple of times, but always got in a mess. thanks again............. Dave.
_________________ Spup Frugal HD and USB
Root forever!
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 11897 Location: Stratford, Ontario
|
Posted: Wed 21 Jul 2010, 16:01 Post subject:
|
|
Now we need to know whether PUPMODE=12 actually kills a flash drive prematurely. Can you keep some records and report back in the future?
|
Back to top
|
|
 |
DaveS

Joined: 09 Oct 2008 Posts: 3726 Location: UK
|
Posted: Wed 21 Jul 2010, 16:10 Post subject:
|
|
rcrsn51 wrote: | Now we need to know whether PUPMODE=12 actually kills a flash drive prematurely. Can you keep some records and report back in the future? |
Sure, no problem. I am using a Sandisk Contour, so one of the better/faster ones, so it will be interesting...........
_________________ Spup Frugal HD and USB
Root forever!
|
Back to top
|
|
 |
Sylvander
Joined: 15 Dec 2008 Posts: 4328 Location: West Lothian, Scotland, UK
|
Posted: Thu 22 Jul 2010, 04:37 Post subject:
|
|
1. "Try using the above procedure, but with "PUPMODE=13"."
PROBLEMS:
(a) That looks complicated as it is, but to attempt to transpose to do the opposite I fear is beyond me.
Could you give explicit instructions for making the Puppy treat the HDD like a Flash Drive?
(b) I'm booting "live" Puppy CD-RW disks, with pupsave+SFS filepairs in partitions on an 8GB Flash Drive.
My PC's BIOS doesn't boot USB, so I didn't install to USB.
I then copied the pupsave+SFS filepairs to folders only one layer down on a partition on an internal HDD.
If I connect the Flash Drive, Puppy finds both sets of filepairs, and asks which it should use.
I'd like the [FASTER!] HDD arrangement to give the choice to NOT-SAVE just like the Flash Drive arrangement.
The initrd.gz file is on the CD-RW, so how to edit it?
Having fun with all the wonderful things Puppy can do.
2. "Or better yet, use jemimah's suggestion here."
PROBLEMS:
(a) "Just add pmedia=ataflash to the bootloader"
But there is no bootloader used in my setup.
(b) "This will let the kernel know that the drive is an SSD"
I'm confused...
I'm not using an SDD.
|
Back to top
|
|
 |
nooby
Joined: 29 Jun 2008 Posts: 10548 Location: SwedenEurope
|
Posted: Thu 22 Jul 2010, 06:28 Post subject:
|
|
Sylvander,
Quote: | (a) "Just add pmedia=ataflash to the bootloader"
But there is no bootloader used in my setup. Confused |
I know almost nothing about such things but I am rather sure of that
you do have a bootloader on the CD-RW most likely syslinux or isolinux or lilo or grub4DOS or something.
No OS start ever without a boot loader. They maybe name it to something else but there are always a boot program at start up
Just friendly teasing.
As I understood the following text
Quote: | (b) "This will let the kernel know that the drive is an SSD"
I'm confused...
I'm not using an SDD.
|
It forces the OS to go into the mode that makes it treat whatever you have as if it was a SDD.
So even if you don't have a SDD the OS now is fooled to think that you have it.
_________________ I use Google Search on Puppy Forum
not an ideal solution though
|
Back to top
|
|
 |
DaveS

Joined: 09 Oct 2008 Posts: 3726 Location: UK
|
Posted: Thu 22 Jul 2010, 12:42 Post subject:
|
|
Suddenly started getting this error message on boot. Any clues? Everything else is fine...................
Description |
|
Filesize |
17.31 KB |
Viewed |
5838 Time(s) |

|
_________________ Spup Frugal HD and USB
Root forever!
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 11897 Location: Stratford, Ontario
|
Posted: Thu 22 Jul 2010, 14:37 Post subject:
|
|
Check that the file is still there and is readable/writable.
When I have been playing with a PUPMODE=12 flash drive, I found it was essential to leave it plugged in at shutdown until it had quit flashing and all activity was completed.
|
Back to top
|
|
 |
DaveS

Joined: 09 Oct 2008 Posts: 3726 Location: UK
|
Posted: Thu 22 Jul 2010, 15:01 Post subject:
|
|
rcrsn51 wrote: | Check that the file is still there and is readable/writable.
When I have been playing with a PUPMODE=12 flash drive, I found it was essential to leave it plugged in at shutdown until it had quit flashing and all activity was completed. |
Suspicious. The file was still there but could not be accessed/deleted in any way. Suspect damaged so I re-installed. All OK again, so on with the logging.....
_________________ Spup Frugal HD and USB
Root forever!
|
Back to top
|
|
 |
the last saviour

Joined: 13 Jul 2010 Posts: 172 Location: Thailand
|
Posted: Fri 23 Jul 2010, 07:17 Post subject:
|
|
Thank a lot for your advice.
Cheer...
_________________ My people are somebody who will move to crowded city because I have promised them the refuge in the big UFO station.
|
Back to top
|
|
 |
fyujj
Joined: 04 Apr 2009 Posts: 103
|
Posted: Fri 23 Jul 2010, 09:27 Post subject:
|
|
Sylvander wrote: |
My PC's BIOS doesn't boot USB, so I didn't install to USB.
|
My PC also but I use PLoP boot manager. It works great.
In my case I have GRUB2 in the HD and have put PLoP so it's another entry in GRUB's menu but there are many ways to use it (from other bootloaders, as the main bootloader, from floppy, cd etc.).
|
Back to top
|
|
 |
nooby
Joined: 29 Jun 2008 Posts: 10548 Location: SwedenEurope
|
Posted: Fri 23 Jul 2010, 09:46 Post subject:
|
|
Quote: | My PC's BIOS doesn't boot USB, so I didn't install to USB. |
I've only tested on two older HP/Compaq Desktop computers.
None of them booted USB when I tried so I came up with a "cheat".
Sylvander do test this.
If your computer have a HDD? Then make a "fake" frugal install.
You have linuz and initrd in a subdir but the pup_431.sfs or Quirky whatever on the USB and not the HDD.
That way it boot first from hdd but fail to find the sfs but are programmed to search for it for all connected devices and finds it on the USB despite it failing to boot from that one.
But maybe you don't have HDD?
_________________ I use Google Search on Puppy Forum
not an ideal solution though
|
Back to top
|
|
 |
|