LinuxVillage

Projects and resources (En) => Contributing to FOSS => Create masters => Discussion démarrée par: patrick013 le 02 février 2013 à 21:13:02

Titre: Flash Drive and Grub2
Posté par: patrick013 le 02 février 2013 à 21:13:02
Hi,

When I boot RC-1 from flash from the same usb port I installed it from
it boots OK.

When I boot RC-1 from flash from a different usb port than where it
was installed from it starts to boot.   Then after awhile it stops, saying
device by UUID does not exist.     Grub2 problem ?     I thought Grub2
keyed on drive UUID as a primary key.   Any ideas, adjustments, or
whatevers ?

I finally got a full DEBIAN testing install of LXDE to install to flash after adding
a 1GB swap to a 16GB flash drive.    This install doesn't care which usb port
I boot from.   Had to recreate my /home/user account after some upgrades
but after that it seems that no other events are buggy in any way.

I'm learning more about these "DEBIANS" every day and I think Taco is
absolutely right stating flash drives need a swap, if not to efficiently install
but to run correctly also.

I'm back to my old hypothesis that flash's don't have a drive cache, further,
I'm hypothesising that Debian is forcing drive cache at boot, also utilizing a
utility called "swapcache" to store used file metedata.   So by giving the flash
drive a nice swap area it suffices as a drive cache in tandem with the swapcache
option.

I haven't proved this but want to spend some time doing so, later, so I know
what's going on with my flash drive installs, some good some bad.

Just FYI

Patrick
Titre: Re : Flash Drive and Grub2
Posté par: melodie le 02 février 2013 à 22:22:36
Hi,

I use fat32 usb sticks with Grub legacy and no problem so far. Would you like a summary of the method I use ?

Titre: Re : Re : Flash Drive and Grub2
Posté par: patrick013 le 03 février 2013 à 00:37:29
Hi,

I use fat32 usb sticks with Grub legacy and no problem so far. Would you like a summary of the method I use ?

No, perhaps I'm not clear.    These are full installs from LV or DEBIAN
which target is a xfs formatted flash drive.   I know how to install things.

I'm just trying to get these Debian's into to a pattern so I know what to expect
that's successful and not.    I never do a full install to FAT32 because if it's
a good install I archive it for further research, and it probably doesn't work
anyway.    My full installs to flash are  going to be to xfs.    Actually, when I
install an ISO using unetbootin most  of the time it's to ext3 plus extent or even
xfs,  boots the ISO and then I do the full install  just fine then.   My unetbootin
does that OK.

My RC-1 full install problem not booting from only the exact USB port installed to,
I think that's a problem with grub.conf,  LV vs. DEBIAN ,   which Taco  needs
to take a look at.   Copy their grub.cong to LV I'd say.   

I want a full install to a USB flash drive to boot just fine, regardless of which
port it is plugged into.    Some computers have 6 or 8 USB ports.    Shouldn't
make a difference with Grub2. 

Call me Mr.  Flash Drive if you'd like.

I'm still thinking why my DEBIAN Lxde wiped out my /home/user after upgrading
and installing only Clementine and my LV   did not.    Rrrrrr........

They should be both accepting the same lib"s as upgrades thru the testing repo.

I've used unetbootin to install ISO's to everything from FAT32 to ext4, and done
full installs from those ISO's unto everything from ext3 to xfs.

I think LV needs to look at it's grug.conf file vs. DEBIAN'S grub.conf file, and this business
with the swap,   I want to do some research as to what the exact technical idea
is going on there.   Forced cache, some new kernel specific swap option.    It's
been a long time where Linux allowed flash drive installs,   and a heads up on new
things might be in order.  I want to document what's going on there for sure.

Just like the max file sizes config'd in /var....I have to look in an old HD for that.
Sure there's an old config file sticking out somewhere.

Nothing super critical but some things nonetheless.......

Have a good one,

Patrick
Titre: Re : Re : Re : Flash Drive and Grub2
Posté par: melodie le 03 février 2013 à 00:55:40
Call me Mr.  Flash Drive if you'd like.

As you like. It's just that USB flash drives are built with much less life expectancy than hard drives are in number of writings. But that's your flash drives, not mine. :)

Titre: Re : Flash Drive and Grub2
Posté par: Taco.22 le 03 février 2013 à 01:08:28
Interesting reading, Patrick.  The more one plays with computers the more there is to learn!

You mention that you use Unetbootin to install ISOs - I assume you mean as a live install.  LinuxVillage is set up so that the "dd" command from terminal will do the job.  I only use Unetbootin on ISOs that won't do that - you usually find that out on attempted boot - fail!  Remastersys provides its own syslinux setup.

I have RC_2 currently installed to a 4gb usb stick.  I "dd" the ISO to a stick, booted the computer "Live to RAM" off that, ejected then reinserted the stick, fired up the Remastersys Live Installer and installed the system onto it.  When Gparted appeared during the install process I created a 3MB swap partition and formatted the rest to ext4.  The install worked perfectly and boots the computer from other usb ports.  I haven't tried it on another computer yet - will take it testing.     

It would be good to work out a reliable way of installing to and booting from flash drives.  It's one of the advantages of running Linux, and it beats using VirtualBox for testing.  It was by doing this that I discovered what the RC_2 grub screen looks like - hadn't seen it on my test rig because it's multiple boot and controlled by a tiny Squeeze install!

Now there's a thought - multiple install on a USB stick - I've got an 8gb stick sitting around not doing much!


PS - although flash drives have a shorter life span than hard-drives, it is still a very useful thing to be able to do.  A computer in your pocket anywhere you go, plus the speed benefits you get if it is a built in SSD in your "real" computer.
Titre: Re : Flash Drive and Grub2
Posté par: melodie le 03 février 2013 à 01:44:49
The advantages must be interesting, I can't say no about that. I wonder when you will find a way to put a zram management script into your versions : then no swap partition should be needed.

Titre: Re : Flash Drive and Grub2
Posté par: Taco.22 le 03 février 2013 à 01:53:41
The reason I use a swap partition, albeit only 3MB is that Remastersys won't install without one - just the nature of the beast. 
Titre: Re : Flash Drive and Grub2
Posté par: melodie le 03 février 2013 à 02:33:48
Oh ho ! I see... I was not thinking about this detail which I didn't even know about (as you noticed), but rather to the real comfort brought by a native and permanent swap in RAM. :)

Titre: Re : Flash Drive and Grub2
Posté par: Taco.22 le 03 février 2013 à 06:50:40
I had mentioned about the swap thing (http://linuxvillage.net/index.php/topic,56.msg244.html#msg244) before, but things get said in all sorts of places and it took me a couple of minutes even to find that!  We need to work out a way of rounding up the bits of info and put them in a central or easy-to-find place.  Nothing worse than knowing you saw something or posted something, and then can't remember where. 
Titre: Re : Flash Drive and Grub2
Posté par: melodie le 03 février 2013 à 13:25:00
Hello,

Either you will post new topics in the "tips and tricks" section, until someone finally bits the bullet as you English speaking people say, and installs a dokuwiki, or you use the search engine from the forum. How is the search engine ? Is it efficient or is it difficult to find information with it ?

Titre: Re : Flash Drive and Grub2
Posté par: Taco.22 le 04 février 2013 à 02:21:50
Although LinuxVillage has support now for a whole range of file systems ( just check out gparted on the updated RC_2 ) the Remastersys Live installer only lists three - ext 2,3 and 4.  I asked fragadelic about this and what support there might be for other file systems.  His response was this -
Citer
XFS is not an install option for the debian version of remastersys and neither is reiserfs.  The ext filesystem is the best supported and most stable.

So I guess until he feels happy about the stability and usefulness of other file systems that's where Remastersys currently stands.  I probably agree with that, being a little conservative myself.  I haven't had any problems installing to usb drives using ext other than the occasional  drive that had its own issues and had to be reformatted on a Windows machine!  Happens sometimes, and certain brands can be more problematic than others.  Anyway, that is the current state of play regarding Remastersys and file systems.
Titre: Re : Flash Drive and Grub2
Posté par: melodie le 04 février 2013 à 08:52:24
Hi,
I think when your Village spin will be perfectly setup, all bugs removed and stable, maybe you will want to try other methods to remix/remaster. There are a bunch, including methods using chroot (less obvious, but said to provide a cleaner result).

PS: about reformatting, once I had to erase the file system of a usb stick with Gparted, then recreate a new msdos partition table before creating again a file system. This is the worse case I met with, along with a series of usb sticks which would never be bootable after the first trial. The only time I had to boot Windows to format something, was related to 1.44' floppy discs: for them I found the dedicated tools under Linux quite inefficient.

 

Titre: Re : Flash Drive and Grub2
Posté par: Taco.22 le 04 février 2013 à 09:51:43
I've had a couple of usb sticks that lost the plot and had to be reformatted back to fat32 under Windows - nothing else would work.  We've also had to occasionally buy usb sticks with Windows security software on them - again only reformatting under Windows to remove that software worked.  By the way, this is so I can use dd - otherwise they work fine just as an ordinary data stick.  Lots of dd'ing and reformatting and changing file systems can make usb sticks very tired!  I work mine hard!!
Titre: Re : Flash Drive and Grub2
Posté par: patrick013 le 08 février 2013 à 02:54:56
Just FYI

I've declared war on grub2 the last several days.    Why I can't boot from
other USB ports, why I get grub rescue when restoring flash drives from
archives, why update-grub doesn't work when I finally get a full boot on a test
install or a  restore from archives.

Rrrrrrrrrrrrrrrr....................

These are things I need to be able to do.       Without failure or exception.

Anybody know of a good dedicated grub2 forum ?       Is this thing soo.....     alpha  ?

BTW, if you edit /etc/mke2fs.conf and add   "  ,extent    "    to the ext3 line it works,
before starting installation.    You get an ext3 fs plus extent.    As good as xfs if
xfs is not available, just at a slightly smaller scale.

Keep up the good work.

Later.

Patrick
Titre: Re : Flash Drive and Grub2
Posté par: melodie le 08 février 2013 à 12:35:43
Hi,

I don't like Grub2. I still use Grub legacy, although I have tried to use Grub2 a few times : but never for USB sticks.

If you still have a Windows somewhere, I know of a good FOSS software for Windows which allows making bootable USB sticks on Fat32 with persistancy, and even using Virtualbox (I didn't understand how vbox is involved there but maybe someone here could explain to me). Here is the website of "Linux Live USB Creator":
http://www.linuxliveusb.com

Let me know what you think about it. (apart from the fact the website needs to go through google translate).



Titre: Re : Flash Drive and Grub2
Posté par: Taco.22 le 08 février 2013 à 13:54:28
I really don't know what the problem is here.  Grub2 has nothing to do with whether an ISO will boot or or not - it is up to the system itself and the hardware it is aimed at.  If the system has been built properly and the hardware it is to be installed on is set up properly, then there shouldn't be an issue.  i'm no fan of Grub2 but I've never been able to blame it for a failed install.  Currently the testing version of VillageBox is sitting on a usb stick.  Has been for the last couple of remasters.  I can update, fiddle about and remaster off that stick - no problems.  It was installed off another stick that was "dd'ed" off the computer.  VillageBox runs Grub2 - yes, it's a complete PITA to configure, but it's not why things don't work.

The fallback method is to burn to a cd and try booting from that.  If that works then the system itself is fine - Grub2 included - and the problem lies somewhere else.  Unetbootin is often used to "burn" a usb stick, but that is usually because the ISO does not have syslinux installed.  Remastersys does, so any remaster from that stable simply needs a "dd" command to put it on a usb stick.  I have over half a dozen USB sticks - three are dedicated to "dd"; they are new and specifically for the task - I don't trust the others and for good reason.  That is the nature of flash drives.   

As an aside, why anyone would go to Windows to set up a bootable Linux system is beyond me.  I have never had Windows on a computer - never had to, never intend to.  Windows to me doesn't exist.  So why use a system which is the antithesis of Linux to install Linux to a device?  Yes, at times I've had to reformat USB sticks through a Windows machine because we live in a small town and that was all we could get.  Caught out on the hop trying live-ISOs! Have since bought other non-compromised sticks!!

Anyway, not that this is helping anyone's problems, other than to say that the obvious isn't always, and always check the hardware -  and don't trust flash drives!


Sorry - I think I got stuck in rant-mode!  Gotta do something about that.
Titre: Re : Flash Drive and Grub2
Posté par: melodie le 08 février 2013 à 18:01:22
I still have a pair of Windows install not just because it came with the machine but because it allows me to test things (free software most often) to help other people. The other reason why someone would use a Windows app to create a bootable USB with it would be if they don't have a GNU/Linux box yet. The last reason which is as good as any, is keeping the Fat32 format which does not bother with rights and permissions on files, and have at same time the desired persistent mode = persistant, fat32, and possibility to have personal data added besides as on any usb stick.

So Lili USB, which I have tried before, is a very interesting little tool.

Titre: Re : Flash Drive and Grub2
Posté par: Taco.22 le 09 février 2013 à 01:24:08
You're right, Lili looks to be a neat tool.  One way around using Windows to set up a Linux system is to "burn" the ISO to a cd or stick, boot the computer off that and then install on to another stick.  Of course, in the process of playing around with things like that last night I managed to accidentally reformat the usb stick with the current VillageBox remaster!!!  That's what happens when you have four identical sticks lying around, and the so-called "indelible" ink used for labelling is not!  Doh!!  No wonder I was feeling crabby last night.  Anyway, all part of the fun of computing.  Will undo the damage today!
Titre: Re : Flash Drive and Grub2
Posté par: patrick013 le 09 février 2013 à 03:15:40
Ah well...........

When I transferred my Debian Testing to a different flash drive
I didn't do grub-install right.   Forgot to change the device map.
But I got to learn how to use grub rescue and a few other things.
Beginner to expert in 2 days.    Not bad once it's done.

Bought some Transcend JetFlash 8 GB'ers off Google.   Write at
10 MB/s, alot better than the new Kingston's they have.   

All's well that ends well.


Patrick
Titre: Re : Flash Drive and Grub2
Posté par: Taco.22 le 09 février 2013 à 06:02:38
Patrick - amazing what and how fast you learn when things don't go right!!  Are things now working out with your new usb drives?

Citer
BTW, if you edit /etc/mke2fs.conf and add   "  ,extent    "    to the ext3 line it works, before starting installation.    You get an ext3 fs plus extent.    As good as xfs if xfs is not available,  just at a slightly smaller scale.
Could you please explain what advantage this file system set up is giving, and what xfs has to offer.  I think djohnston is also a fan of  xfs.

EDIT - also you mention somewhere else that ext3 works better for usb - could you please expand on that.
Titre: Re : Re : Flash Drive and Grub2
Posté par: patrick013 le 09 février 2013 à 21:40:30
Patrick - amazing what and how fast you learn when things don't go right!!  Are things now working out with your new usb drives?
Could you please explain what advantage this file system set up is giving, and what xfs has to offer.  I think djohnston is also a fan of  xfs.

EDIT - also you mention somewhere else that ext3 works better for usb - could you please expand on that.

First time I tackled a grub2 hangup full steam, so I'm confident I can proceed using these flash
drives and not cluttering up my already somewhat full hard drive(s).

The Transcend JetFlash 300's I bought are the fastest yet I've bought, so probably be installing,
backing up, remastering, not super fast but at least at a usable speed.

The problem with filesystems is the flex_bg option in ext4.   Makes the drive crawl looking
for blocks used without a drive cache.   ext3 and xfs just look at the front of the drive for
block locations.   Don't need a drive cache to do that.   

I've got another question for a new thread.

thanks for the response.

patrick
Titre: Re : Flash Drive and Grub2
Posté par: patrick013 le 14 février 2013 à 01:08:32
Amazing this Grub2 thing.

On my LV transfer I ran dd to transfer grub2 then I had to run grub-install.

On my Debian Testing LXDE I just ran grub-install at the MBR and it didn't
work, but when I dd'd grub2 over it started working just fine.

These new JetFlash 300 flash drives appear to be OK .    What works will
keep working I guess,   Maybe you have to do it twice.   
Titre: Re : Flash Drive and Grub2
Posté par: Taco.22 le 14 février 2013 à 02:08:14
What command are you running when doing "dd"?
Titre: Re : Re : Flash Drive and Grub2
Posté par: patrick013 le 14 février 2013 à 02:32:50
What command are you running when doing "dd"?

dd if=/dev/sdc of=dev/sdd bs=440 count=1

After some thought I think the reason grub-install didn't work
is because both sdc and sdd were the same UUID's.   Before,
when I did this they were both different, the OS on sdc and the OS
on sdd.   

I wanted to and expected to get to grubrescue prompt, and from there I know exactly
what to do.     Force boot, fix the device map, run grub-install, run update-grub,
done, reboot.

Good topic for discussion, tho.

thanks for the response,

Patrick
Titre: Re : Flash Drive and Grub2
Posté par: Taco.22 le 14 février 2013 à 02:50:29
Sorry, now I get it - you are dd-ing an OS, not an ISO.  Can I suggest you have a look at this link (https://wiki.archlinux.org/index.php/Disk_Cloning).
Archwiki - the font of all knowledge!
Titre: Re : Re : Flash Drive and Grub2
Posté par: patrick013 le 20 février 2013 à 03:49:42
Sorry, now I get it - you are dd-ing an OS, not an ISO.  Can I suggest you have a look at this link (https://wiki.archlinux.org/index.php/Disk_Cloning).
Archwiki - the font of all knowledge!

Some use bs=440, arch uses bs=446

I wish they'd make up their minds.

BTW bs=440 actually works.
Titre: Re : Flash Drive and Grub2
Posté par: patrick013 le 13 mars 2013 à 05:31:05
http://sourceforge.net/projects/boot-repair-cd/files/ (http://sourceforge.net/projects/boot-repair-cd/files/)

The above is an iso that installs grub2, if needed.


It's also in this repo :

# Boot-Repair-Disk
deb http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu (http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu) lucid main


Tested it today, for basic grub2 install.

FYI