Writeable custom user directory ?


Forum: USB booting
Topic: Writeable custom user directory ?
started by: crew

Posted by crew on Aug. 24 2005,11:15
Hi,

Iīve installed DSL 1.4 on a 1GB Kingston USB stick by useing the
"install for USB-HDD Pendrive" script.
So far everything is working fine. :)

Now I want to create a Directory to save my Documents, Downloads, etc.
Iīve created a custom directory (data) as root and tried to give
write permission for the user with chmod.
But is seems whatever I do with chmod it does not have an effect.

How do I get a user writeable directory on the stick ?

Posted by mikshaw on Aug. 24 2005,13:55
Chmod needs to be run as root for any file that was created as root. If the directory will be for user 'dsl' it's better to use chown to change ownership of the directory rather than changing permission.
sudo chown dsl.staff directory/
Chown needs to be run as root regardless of who owns the file.

Also, if this directory is created within the regular DSL filesystem it will not be there when you reboot (pendrive install runs DSL from a compressed filesystem like the liveCD).  You need to make sure it is located on a mountable drive so it will be persistent. You could create it on the pendrive itself, and use the 'frugal' or 'toram' boot option to allow writing of the drive, or put /home on another drive and use the 'home=' boot option.
I'm not totally sure about that...never did a pendrive install.

Posted by crew on Aug. 24 2005,14:47
Hi mikshaw,

Iīve tried to change the owner but it always says "Operation not permitted". ( iīve tried as root )

Hmm, the directory I created is persistet, Iīve booted several
times and the directory is always there.

Posted by mikshaw on Aug. 24 2005,17:54
Ok...so it's on the pendrive itself, apparently.  Where do you see the diretory?
If root can't chmod or chown, it means the directory is on a read-only filesystem.  Try booting with the "frugal" boot option to make the pendrive read-write.

Then again, I'm assuming that the usb hdd install is essentially a frugal install...that's what the script looks like to me, anyway.

Posted by crew on Aug. 25 2005,12:01
Quote
Where do you see the diretory?


I created the directory in the root of the USB stick.
So atm it appears on /cdrom/data/ or /mnt/sda1/data/.

Quote
Try booting with the "frugal" boot option to make the pendrive read-write.


Hmm, I donīt have a frugal option when I look at the f2 boot option menu.
When I enter "dsl frugal" at the bootprompt the "Operation not permitted" remains. :/

Posted by mikshaw on Aug. 25 2005,14:54
I don't fully understand how DSL deals with pendrives.  I've been using frugal DSL on a harddrive, and the frugal boot option allows me to write to /cdrom. I assume it should be the same for a pendrive.
When you boot with the frugal option, can you create a new directory in /cdrom, either as user dsl or root?  You *should* be able to do this as far as i can tell.
Did you originally create the data directory while logged in to the same pendrive-installed DSL system?  If so, there is something very wrong if you can create but not change.

Posted by cbagger01 on Aug. 25 2005,16:54
The "frugal" option does work the same way for pendrives that it does for hard drives.

So it should be possible to type something like:

dsl frugal

or

dsl frugal fromhd=/dev/sda1

at the "Boot:" prompt.

Posted by crew on Aug. 26 2005,09:51
Hmm Iīve tried booting with "dsl frugal",
"dsl frugal fromhd=/dev/sda1" and without any
option, in every case with the same effect.

As root I can create a directory, as user I get a
permission denied.
chown always say operation permitted, chmod does not bring
an errormessage but is not changeing any attribut. :/

Posted by mikshaw on Aug. 26 2005,13:40
That sounds really weird.  The only thing I can think of is that you are not actually trying these commands as root.  If root can create a directory in /cdrom, it is mounted writeable and root should also be able to chown, chmod, rm, slice, dice, and julienne this directory.
Posted by crew on Aug. 26 2005,14:32
I donīt want to have the weired problems.
< >

Posted by mikshaw on Aug. 26 2005,17:33
Well...looks like you got yourself one of the weird problems, like it or not.
I'm out of ideas.

Posted by cbagger01 on Aug. 26 2005,20:47
Maybe there is no ownership of files allowed for a FAT filesystem instead of a Linux or NTFS file system?

Try creating the directory as user DSL instead of root.  Does this work?

Posted by crew on Aug. 29 2005,17:47
Quote (cbagger01 @ Aug. 26 2005,16:47)
Maybe there is no ownership of files allowed for a FAT filesystem instead of a Linux or NTFS file system?

Try creating the directory as user DSL instead of root.  Does this work?

Then I get a "permission denied" message.


Is it possible to shrink the partition where DSL is installed ?
So that I can create a second partition for my data, Iīve tried
with the eval of partition magic but it seems not to support
"removeable storage" on windows.

Posted by nothsa on Sep. 03 2005,18:32
Unix permissions are not changeable on FAT partitions. Period. To set permissions on a file, you have to mount the partition with specific options (eg. "rw,exec"), and your settings will affect all the files on the partition. I'm afraid that if you want full permission control you're going to have to create an ext2, ext3 (or something else that supports permissions) partition, which probably won't be readable in windows.
Posted by crew on Sep. 04 2005,00:05
Quote (nothsa @ Sep. 03 2005,14:32)
Unix permissions are not changeable on FAT partitions. Period. To set permissions on a file, you have to mount the partition with specific options (eg. "rw,exec"), and your settings will affect all the files on the partition. I'm afraid that if you want full permission control you're going to have to create an ext2, ext3 (or something else that supports permissions) partition, which probably won't be readable in windows.


Thx, nothsa.
This is what people on the IRC told me too. A FAT system that
is mounted by root, belongs to root, no chmod, no chown, etc...
I donīt know where to set specific options for the filesystem,
/etc/fstab is rewriten form "knoppix" with every reboot.:/

I had a workaround (with the help of tuxfan from #unixboard ;)).
I created a diskimage with dd, formated with ext2, and mounted
it to /test. There I can change file permissions, write to the file system, save my data, etc.

I think itīs not very elegant but itīs working fine :)

Posted by mikshaw on Sep. 04 2005,00:23
As far as I know you can repartition the pendrive with a fat partition (if you need access to it from Windows) and a second partition with a linux filesystem on which to reinstall DSL.  The only problem I can see would be you couldn't access the Linux partition from Windows, even if you had some software installed to read linux partitions...apparently Windows cannot read more than one partition on removable media.

I don't have a pendrive, so I don't know this to be a fact...it's just one of those things I'm pretty sure i read either here or on irc

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