How to Make a Flash Drive Install Work Like a Hard Drive

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

How to Make a Flash Drive Install Work Like a Hard Drive

#1 Post by rcrsn51 »

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:

Code: Select all

editinit

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

Code: Select all

PUPMODE=12
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.
Attachments
editinit-1.0.pet
Updated 2014-05-24
(515 Bytes) Downloaded 551 times
Last edited by rcrsn51 on Sat 24 May 2014, 20:46, edited 12 times in total.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#2 Post by Sylvander »

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.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#3 Post by rcrsn51 »

Try using the above procedure, but with "PUPMODE=13".

[Edit] Or better yet, use jemimah's suggestion here.

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#4 Post by nooby »

rcrsn51 , Jemimah suggest two different ways to do it?
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

User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

#5 Post by DaveS »

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!

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#6 Post by rcrsn51 »

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?

User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

#7 Post by DaveS »

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!

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#8 Post by Sylvander »

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. :D 8)

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.

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#9 Post by nooby »

Sylvander,
(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
(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

User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

#10 Post by DaveS »

Suddenly started getting this error message on boot. Any clues? Everything else is fine...................
Attachments
error.png
(17.31 KiB) Downloaded 5973 times
Spup Frugal HD and USB
Root forever!

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#11 Post by rcrsn51 »

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.

User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

#12 Post by DaveS »

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!

User avatar
the last saviour
Posts: 175
Joined: Tue 13 Jul 2010, 12:41
Location: Thailand

#13 Post by the last saviour »

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.
Now I'd found at least 5 aliens who live in Thailand. They are from Triangular constellation.

fyujj
Posts: 102
Joined: Sat 04 Apr 2009, 17:40

#14 Post by fyujj »

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.).

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#15 Post by nooby »

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

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#16 Post by Sylvander »

1. "maybe you don't have HDD?"
(a) I have two 10GB PATA internal HDD's fitted.
The first has Windows 2000Pro installed to it.
The second has only one ext3 partition on it with six folders in the root folder, each for eventually holding the pupsave+SFS filepair [copied from the Flash Drive] for six different Puppies.
I also have a couple of 80GB PATA HDD's [one in an external enclosure, the other in my 2nd PC], and a 1TB SATA HDD in yet another external HDD.
Plus a number of spare 10GB HDD's in the loft. :D

(b) I have in the past installed a Puppy to a Flash Drive partition, and used a Wakepup2 bootable floppy [also have a special bootable CD] to load the Puppy.
But these days I choose to use pupsave files for multiple Puppies [6 right now], each in their own partition on an 8GB Flash Drive, and loaded by "live" Puppy CD-RW's.
Also have a 4 GB Flash Drive holding multiple pupsaves used for the 2nd PC.
And a couple of 1GB Flash Drives.

2. So far, on this newer PC, I've chosen not to make a Puppy full install.

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#17 Post by Bert »

This thread is now almost 6 months old and I wonder if there have been any new discoveries ? What are the experiences of people who've been running Puppy from usb sticks in pupmode 12 , using the script made by rcrsn51?

I'm asking because I'm about to assemble a nice little nettop for my girlfriend and as it will be passively cooled, running from a memory stick seems like the best way to keep temperatures within limits (no heat from internal drives and inside of case really uncluttered)

I found this report from 2008, which sounds very reassuring about the longevity of flash drives.

I would really like to avoid running pupmode 13, to get rid of that save icon and the slow shutdown process.

If proven that running a usb stick in pupmode 12 is safe, what would it take to add this to the installation options?
Jeminah says "that would probably be easy to fix"

Thanks!
Bert
Last edited by Bert on Tue 11 Jan 2011, 22:13, edited 1 time in total.
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#18 Post by rcrsn51 »

The last time I checked with DaveS, his PUPMODE=12 flash drive was still running fine. Perhaps you could PM him and get a report.

Stripe
Posts: 658
Joined: Wed 23 Jun 2010, 05:18
Location: In a field. England

#19 Post by Stripe »

Hi all

I have been running pupmode=12 for about 2 months now on a usb stick without any problem (but using ext4 file system)

I also have been running a 3 partition usb stick for about a month now, a frugal install running pup mode=12, the second partition for storage and the third partition as a swap file for non linux/no swap file, systems and have not killed the usb stick yet, the one thing I have noticed is that you cannot mount an iso stored on a usb, it has to be copied to either the desktop or a hd so it will mount, yet you can mount sfs files ok.

hope this helps

Stripe

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#20 Post by Bert »

Thanks rcrsn51!
Stripe wrote:hope this helps
It certainly does! Thank you very much.

You even answered my two next questions: ext4 and partitioning 8) :lol:
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

Post Reply