Writing back to the USB stick


Forum: DSL Embedded
Topic: Writing back to the USB stick
started by: RRRR

Posted by RRRR on April 29 2007,00:57
I've installed DSL embedded on a USB stick and installed syslinux to it, and it boots OK. However, one of the points of booting DSL off an USB stick will be that, unlike CD, you can write back to it. But I enter a couple of issues here. (This is all about booting from the stick, BTW. I'm not using qemu.)

If I boot with the toram option I find that when trying to mount sda1 I get the message "Error: mount: according to mtab, /dev/sda1 is mounted on /cdrom".
And if I open a root shell and try to umount /cdrom I just get "umount: /cdrom: device is busy". And if I try to write to /cdrom I just get the message that it's a "read-only file system".
So there's no way I can write a file to a directory on the memorystick. I think it's nice to use the toram option when it's enough RAM, but it seems I can forget it here...

If I boot without the toram option I can mount sda1. But only root can write to it. I thought booting DSL from memorystick and just write my files to it as user would be nice, but its not that simple.
If I try to change permissions on folder from a root shell I just get told that operation is not permitted. Usually you expect most things to be permitted for root, but I guess it's due to the FAT filesystems not knowing about permissions that chown, chmod and chgrp don't work. Anyway, it's a bit of a hassle and I wish there was a way I could mount a directory on the stick with write permissons for the user (dsl).

Otherwise this seems brilliant. I really like the mydsl directory option for extensions. Can you store boot options and/or other settings too using DSL embedded on a USB stick?
[EDIT]
Sorry. Being to tired here. Answer to my very last question are obvious: .filetool.lst, backup.tar.gz & all that jazz... But my main Q. still stands as something that puzzles me....
[/EDIT]

Posted by Juanito on April 29 2007,04:00
I'm not sure from your post if you installed embedded DSL - the version that will run in a window under Windows - or normal DSL?

If you installed DSL normally, did is it DSL or DSL-N? The reason I ask is that I have the same issue as you with DSL-N but not DSL.

You can get around your problem by creating two partitions on the USB stick, you will then be able to boot from one partition and write to the other partition. If you want to share your files with Windows, it would be better to boot DSL from the second partition since Windows can usually only see the first partition.

Posted by RRRR on April 29 2007,04:13
No, not DSL-N. I just unzipped dsl-3.3-embedded.zip to the stick and installed syslinux (3.36) to it.
Two partitions might be the way to go. Anything special to get syslinux to load DSL off the second partition on the stick...?

Posted by ^thehatsrule^ on April 29 2007,04:29
What if you `umount /dev/sda1` ? Are you sure you get this while you boot with toram.. and not the other way around?

I think you can write to /cdrom if you're using the "frugal" bootcode.. and you have to have root privileges.

You could mount sda1 by changing the user permissions on it (i.e. via mount).  Or you could just work as root...  Or you could just make an ext2 partition...

Re: last question: yes... see backup/restore.

Posted by Juanito on April 29 2007,05:15
Quote
Anything special to get syslinux to load DSL off the second partition on the stick...?
I guess you would have to run syslinux from linux since Windows would not be able to make or see (easily) the second partition.

Quote
Or you could just make an ext2 partition...
I've been thinking about this now that I have Windows drivers for ext2. What would be the implications of using DSL from a USB stick with ext2 partitions - grub/lilo boot instead of syslinux I guess, but anything else?

Posted by ^thehatsrule^ on April 29 2007,05:33
Re: syslinux changes: Maybe you can just change syslinux.cfg?

Quote
What would be the implications of using DSL from a USB stick with ext2 partitions - grub/lilo boot instead of syslinux I guess, but anything else?
Apparently there's an ext* derivative as well < http://syslinux.zytor.com/extlinux.php > ... and I've also seen some people that use grub on their usb's (I'm assuming fat*)

Posted by WDef on April 29 2007,07:11
Quote
I just unzipped dsl-3.3-embedded.zip to the stick and installed syslinux (3.36) to it.


Perhaps it's too early in the morning for me:  I'm sure there a reason for running it this way - am I missing something?

Posted by Juanito on April 29 2007,07:25
Well, this way you can install DSL from Windows onto a USB stick without the need for a Windows "iso unpacking" application (of course, you still need Syslinux and Winzip...).

Once you've done the first time installation this way, you can then overwrite the knoppix image to upgrade from within DSL on the USB stick.

Posted by humpty on April 29 2007,18:49
yeah, i get the feeling most newbies nowadays don't want to burn the cd and want to prepare the disk from within windows (this is not really 'embedded' it's just using the files from 'embedded'). that's fine until you want two partitions.

my advice: use an external partitioner e.g gparted.

Also, you don't really need to boot 'from' the 2nd partition,
you can boot from the 1st but tell dsl to 'load' the knoppix image from the 2nd.

This is a good idea, and one i always recommend, by seperating the knoppix image to another partition, you avoid all sorts of problems.

You can't use chmod,chown.. etc on fat16/32 but you can in the ramdisk (/home/dsl) which gets backed up in backup.tar.gz.  it does take more time as the files/sizes build up, for the backup process. I tend to archive old stuff elsewhere if the file gets too big.

Posted by RRRR on April 30 2007,00:58
Quote
What if you `umount /dev/sda1` ? Are you sure you get this while you boot with toram.. and not the other way around?

`umount /dev/sda1` = `device is busy`. Mmm. Don't help. Yes, it's with the toram option I get this situation. That said, I get a message when booting with toram that I don't get when booting without:
`Warning: Changing to /cdrom2 failed.`
Booting without toram let me mount sda1 and write to it, but only as root.

Quote
Perhaps it's too early in the morning for me:  I'm sure there a reason for running it this way - am I missing something?

Nah. I just came over this tutorial that recommended this. And also on DSL Wiki somewhere it said it's recommended to use DSL embedded for USB stick rather than the ISO. If mounting the ISO and transfer the files to the stick have advantages, thats no problem. I have access to both Linux and Windows and should be able to use any tool necessary. Using the installscript from DSL never worked for me. Are there disadvantages to the Embedded? Advantages to the plain ISO? Please tell...

----

The stick will be used in the wild. So the first partiton will have to have FAT (preferably FAT32) filesystem as this is the only thing that will work all around. The best situation I guess would be to have a first partition that's FAT32 and a second that's ext2 and put the DSL on the second. Partitioning I should manage, either with qparted or some of the command tools if they will work with USB sticks...

The tricky bit I guess will be booting. If I can get syslinux, extlinux or grub to make this setup bootable for me...? Any tips?

Posted by RRRR on April 30 2007,06:35
The next step was using the < gparted livecd > and making a new layout. FAT32 partition first, then ext2. This was no problem.
I then moved the DSL files onto the ext2 partition. I made the second partiton bootable and installed < extlinux > to it. for configfile I just did
cp syslinux.cfg extlinux.conf
with the syslinux config that comes with DSL embedded. I then boot, and hey, it boots! But. Next second I get the
Can't find KNOPPIX filesystem, sorry.
Dropping you to a (very limited) shell.
Press reset button to quit.


Well, well. I try the fromhd= option too, but to no avail.
Maybe I have to look closer at the configfile after I've slept....

Posted by Juanito on April 30 2007,07:03
You probably tried this, but unlike on a FAT/FAT32 partition, on an ext2 partition case becomes important and the image file will probably need to be named /KNOPPIX/KNOPPIX and not /knoppix/knoppix
Posted by RRRR on May 02 2007,20:33
Quote (Juanito @ April 30 2007,03:03)
You probably tried this, but unlike on a FAT/FAT32 partition, on an ext2 partition case becomes important and the image file will probably need to be named /KNOPPIX/KNOPPIX and not /knoppix/knoppix

Uhmm, yes. Sorry for the delay; real life happend.
I was rather tired when I struggled with it, so the very obvious fact that dragging the files through FAT filesystem had renamed them escaped me...
Anyway, making sure everything got proper naming fixed it. All is well now. Thanks!

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.