Jump to content

How to get "write"permissions to SD card


Ironfighter
 Share

Recommended Posts

Hi,

 

I want to transfer some MP3 files from my linux box to an SD card via a USB card reader so that I can play them on a pocket PC. I can read existing files on the SD card through Konqueror but when I try crate a new folder in the card or copy files to it I get the message "Access denied to /mnt/removable/Music. Can anyoune tell me how to change the permissions please?

Link to comment
Share on other sites

I've had problems for this with my usb disk, and the only way I've managed to do it is by editing /etc/fstab and creating an entry accordingly. Maybe you need to do the same. You can then assign the option:

 

umask=0

 

which will give you full write access to that SD card. Although my new lappy has SD, and not had any problems with it, so no idea other than what I've suggested.

Link to comment
Share on other sites

I've had problems for this with my usb disk, and the only way I've managed to do it is by editing /etc/fstab and creating an entry accordingly. Maybe you need to do the same. You can then assign the option:

 

umask=0

 

which will give you full write access to that SD card. Although my new lappy has SD, and not had any problems with it, so no idea other than what I've suggested.

Thanks Ian - Happy New Year. Erm :D here is my fstab - could you tweak it for me please :P

/dev/hda1 / ext3 defaults 1 1

none /dev/pts devpts mode=0620 0 0

/dev/hda6 /home ext3 defaults 1 2

/dev/hdc /mnt/cdrom auto umask=0,user,iocharset=iso8859-15,codepage=850,noauto,ro,exec,users 0 0

/dev/sdb1 /mnt/hd auto umask=0,user,iocharset=iso8859-15,sync,kudzu,codepage=850,noauto,exec,users 0 0

none /proc proc defaults 0 0

/dev/app/1/image /tmp/app/1 cramfs,iso9660 user,noauto,ro,loop,exec 0 0

/dev/app/2/image /tmp/app/2 cramfs,iso9660 user,noauto,ro,loop,exec 0 0

/dev/app/3/image /tmp/app/3 cramfs,iso9660 user,noauto,ro,loop,exec 0 0

/dev/app/4/image /tmp/app/4 cramfs,iso9660 user,noauto,ro,loop,exec 0 0

/dev/app/5/image /tmp/app/5 cramfs,iso9660 user,noauto,ro,loop,exec 0 0

/dev/app/6/image /tmp/app/6 cramfs,iso9660 user,noauto,ro,loop,exec 0 0

/dev/app/7/image /tmp/app/7 cramfs,iso9660 user,noauto,ro,loop,exec 0 0

/dev/hda5 swap swap defaults 0 0

/dev/sda1 /mnt/removable auto umask=0022,user,iocharset=iso8859-15,sync,kudzu,codepage=850,noauto,exec,users 0 0

 

By the way - the last time I looked at my fstab I don't think all those "dev/app/1 to 7 were there, have you got any idea what they are ?

Edited by Ironfighter
Link to comment
Share on other sites

They seem to be loopback mounts to files on your system or something. I would just put a # at the beginning of these lines to stop them being loaded automatically.

 

As for your sd card, I don't know what device it's mounting as, but we can find out from:

 

fdisk -l

 

as it'll list all disks on your system. Mine comes out like this:

 

[root@europa ian]# fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot	  Start		 End	  Blocks   Id  System
/dev/sda1   *		   1		1314	10554673+   7  HPFS/NTFS
/dev/sda2			1315		9729	67593487+   5  Extended
/dev/sda5			1315		1445	 1052226   82  Linux swap / Solaris
/dev/sda6			1446		2758	10546641   83  Linux
/dev/sda7			2759		9729	55994526   83  Linux

Disk /dev/mmcblk0: 512 MB, 512229376 bytes
9 heads, 8 sectors/track, 13895 cylinders
Units = cylinders of 72 * 512 = 36864 bytes

	Device Boot	  Start		 End	  Blocks   Id  System
/dev/mmcblk0p1			   4	   13896	  500107+   6  FAT16

 

the last device as mmc is my device, yours might be similar, but here is my fstab entry for my sdcard:

 

/dev/mmcblk0p1 /mnt/sdcard auto umask=0,users,rw 0 0

 

of course, make sure you created the /mnt/sdcard directory if you want to use the same/similar setup to me.

Link to comment
Share on other sites

They seem to be loopback mounts to files on your system or something. I would just put a # at the beginning of these lines to stop them being loaded automatically.

 

As for your sd card, I don't know what device it's mounting as, but we can find out from:

 

fdisk -l

 

as it'll list all disks on your system. Mine comes out like this:

 

[root@europa ian]# fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot	  Start		 End	  Blocks   Id  System
/dev/sda1   *		   1		1314	10554673+   7  HPFS/NTFS
/dev/sda2			1315		9729	67593487+   5  Extended
/dev/sda5			1315		1445	 1052226   82  Linux swap / Solaris
/dev/sda6			1446		2758	10546641   83  Linux
/dev/sda7			2759		9729	55994526   83  Linux

Disk /dev/mmcblk0: 512 MB, 512229376 bytes
9 heads, 8 sectors/track, 13895 cylinders
Units = cylinders of 72 * 512 = 36864 bytes

	Device Boot	  Start		 End	  Blocks   Id  System
/dev/mmcblk0p1			   4	   13896	  500107+   6  FAT16

 

the last device as mmc is my device, yours might be similar, but here is my fstab entry for my sdcard:

 

/dev/mmcblk0p1 /mnt/sdcard auto umask=0,users,rw 0 0

 

of course, make sure you created the /mnt/sdcard directory if you want to use the same/similar setup to me.

Thanks Ian,

the card I am workong on at the moment is /dev/sda1 and can be accessed through conqueror via /mnt/removable. I do have another flash card which I can access through konqueror via /mnt/hda which I believe is sdb1.

 

Here is the output from fdisk -l

 

Disk /dev/hda: 8455 MB, 8455200768 bytes

16 heads, 63 sectors/track, 16383 cylinders

Units = cylinders of 1008 * 512 = 516096 bytes

 

Device Boot Start End Blocks Id System

/dev/hda1 * 1 9452 4763776+ 83 Linux

/dev/hda2 9453 16383 3493224 5 Extended

/dev/hda5 9453 10467 511528+ 82 Linux swap

/dev/hda6 10468 16383 2981632+ 83 Linux

 

Disk /dev/sda: 507 MB, 507379712 bytes

16 heads, 63 sectors/track, 983 cylinders

Units = cylinders of 1008 * 512 = 516096 bytes

 

Device Boot Start End Blocks Id System

/dev/sda1 1 983 495313+ 6 FAT16

 

I will try to put the # in front of those lines in the fstab (Can't do it as myself :D ) - back soon

Link to comment
Share on other sites

OK, so this should be fine for your fstab:

 

/dev/sda1 /mnt/removable auto umask=0,users,rw 0 0

 

or edit the entry you got in there if one exists and add the umask=0 in the options, similar format as my line above.

Link to comment
Share on other sites

Thanks Ian,

 

while I was away i logged out and back in as root - edited the fstab to look like this as you suggested:

 

/dev/hda1 / ext3 defaults 1 1

none /dev/pts devpts mode=0620 0 0

/dev/hda6 /home ext3 defaults 1 2

/dev/hdc /mnt/cdrom auto umask=0,user,iocharset=iso8859-15,codepage=850,noauto,ro,exec,users 0 0

/dev/sdb1 /mnt/hd auto umask=0,user,iocharset=iso8859-15,sync,kudzu,codepage=850,noauto,exec,users 0 0

none /proc proc defaults 0 0

#/dev/app/1/image /tmp/app/1 cramfs,iso9660 user,noauto,ro,loop,exec 0 0

#/dev/app/2/image /tmp/app/2 cramfs,iso9660 user,noauto,ro,loop,exec 0 0

#/dev/app/3/image /tmp/app/3 cramfs,iso9660 user,noauto,ro,loop,exec 0 0

#/dev/app/4/image /tmp/app/4 cramfs,iso9660 user,noauto,ro,loop,exec 0 0

#/dev/app/5/image /tmp/app/5 cramfs,iso9660 user,noauto,ro,loop,exec 0 0

#/dev/app/6/image /tmp/app/6 cramfs,iso9660 user,noauto,ro,loop,exec 0 0

#/dev/app/7/image /tmp/app/7 cramfs,iso9660 user,noauto,ro,loop,exec 0 0

/dev/hda5 swap swap defaults 0 0

/dev/sda1 /mnt/removable auto umask=0022,user,iocharset=iso8859-15,sync,kudzu,codepage=850,noauto,exec,users 0 0

 

logged back in as myself :D and tried to copy my music to the sd card - and guess what it did. So it must have been those lines in the fstab that now have an # in front of them. Should I just delete those lines and leave the rest the same (in particular the line in red for the sd card) or should I take the plunge and replace it with your line?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...