Jump to content

Read Only Disk?


Recommended Posts

Posted

I lashed out and bought myself an MP3 Player to listen to my downloaded podcasts from Radio National in Australia.

It works great but Linux (Ubuntu 5.1) sometimes sees the MP3 Player as a memory stick and lets me write new files down with no problem, other times it says it is aread only disc and refuses to write to it.

Other times is says I am not the owner so I cannot write new files or delete and old files but Properties/Permissions says I am the owner.

I have managed my files so far by dual booting to Win 2000 where I can add anything and reformat the drive to clear it out.

Any suggestions to let me manage the MP3 machine and avoid using Windoze which keeps getting a screwed up NTFS file system??

Posted

Check what filesystem the device is formatted to first, however if the device is formatted to FAT16 or FAT32 then the problem probably is permissions.

Check permissions by opening a terminal and typing mount, find the line for your device, probably starting with /dev/sda1 or sdb1, and look at the details - particularly that the filesystem has been detected correctly and the umask - the umask tells you the owner, group and everyone permissions. Post them if you need help deciphering. If for any reason you aren't sure which line your device is, then do the mount command before and after inserting it and compare the two outputs.

To see if root can read/write the device, try running Nautilus (the file/folder browser) as root - open a terminal and use the command sudo nautilus enter your password if required, the file manager will now open with root permissions - browse to the device and see what happens.

Also one thing to remember with Linux, you should unmount USB drives before removing them otherwise the file system can be corrupted.

Posted

Here is the output.. I cannot delete anything from the MP3....

/dev/sda1 on /media/MP3 type vfat (ro,noexec,nosuid,nodev,quiet,shortname=winnt, uid=1000,gid=1000,umask=077,iocharset=utf8)

colin@ubuntu:~$ sudo nautilus

Password:

--- Hash table keys for warning below:

--> file:///media/MP3

--> file:///media

--> file:///

(nautilus:8845): Eel-WARNING **: "nautilus-metafile.c: metafiles" hash table sti ll has 3 elements at quit time (keys above)

--- Hash table keys for warning below:

--> file:///media/MP3

--> file:///media

--> file:///

(nautilus:8845): Eel-WARNING **: "nautilus-directory.c: directories" hash table still has 3 elements at quit time (keys above)

The root permissions made no difference....

Posted

The root permissions made no difference because it's mounted as read-only: ...vfat (ro, noexec...

(like you didn't know that already!)

You could try a couple of things, you should back up the contents before either of them:

1. One reason for this happening is that Linux thinks the filesystem is corrupt, I've not seen the kind of output you have posted (Hash table keys...) before but it sure looks like this may be the case. It doesn't actually mean Linux thinks it's faulty but it may not be happy with the filesystem so it automatically mounts it as read-only to prevent further corruption. Reformatting the drive from Linux (using GParted for example) may solve the problem. I recommend you try this first, and if you need detailed instructions let me know.

2. You can try specifying the mount permissions by adding the device to the fstab configuration file.

When the device is inserted, open a terminal window

Unmount the device with this command:

sudo umount /dev/sda1

Make sure the mount point is there:

sudo mkdir /media/MP3

Open the fstab file for editing using this command:

sudo pico -B /etc/fstab

Add this line to the bottom of the file: (you can copy and then paste with ctrl-alt-v)

/dev/sda1 /media/MP3 vfat iocharset=utf8,umask=000 0 0

Save the file by typing ctrl-x then Y and <enter>

Remount everything with:

sudo mount -a

Posted

Brilliant!! It worked exactly as promised!

Will these changes last or will I need to go through these hoops every time I want to add/remove files? I would assume the 'fstab' file is the one which remembers the new settings?

What is GParted, my system does not seem to know about it, it might be a good idea to format the drive to a file system Linux is happy with.

Thanks,

Colin

Posted

fstab changes should survive without needing further changes, test this by rebooting and reinserting your mp3 player.

The only problem I can imagine might be if you insert a non-FAT formatted USB stick or mp3 player, it might be unreadable or even become corrupted if you write to it (not damaging the device, just the data). I don't know that this will present a problem, I just think it's possible but can't say because I haven't tried this, so it might pay to keep it in mind.

FAT drives formatted by Windows and Linux should work fine with either OS interchangeably, so you don't need to worry. However, if you wish to use GParted to format this device or anything else:

Install the program from the terminal with the command sudo apt-get install gparted

Your menu should now have the program listed (I think on 5.10 it's Applications->System Tools->GParted)

GParted is a program which can create, delete, resize, move and reformat disk partitions so please take care!

To reformat your mp3 player:

Use the selector button on the top right to choose /dev/sda1

There should be only one partition listed, and it should have details something like:

/dev/sda1 fat32 /media/MP3 XXXMiB XXXMiB XXXMiB lba

Check that the details are correct, including size, etc, this is to make sure you are targeting the right partition!

Then right-click it and choose unmount

Then right-click it and choose format to->fat32

Follow the instructions and apply the changes - this will format the drive

You should then be able to reinsert it or remount it and it will be empty and reformatted.

You can resize (shrink) your Windows partition and increase the size of your shared FAT32 partition and/or your ext3 Ubuntu partition using this program too.

Posted

Congratulations again, that all worked too!!

If you know anything about FreePascal and Lazarus you are herby invited up to Pai for a holiday as long as you like, I struggled with Lazarus for more than two months and never got it going. I am a Delphi programmer and the idea if recompiling my Delphi under Linux makes my mouth water, I even managed to get a copy of Kylix from Canada but that didn't work either....

Any plans to go back to Kiwiland or are you stuck here too?

Colin in Pai

Posted

Good to hear everything is working.

I don't know that much about it but Lazarus/FreePascal looks like an interesting setup. FreePascal is in the 6.10 repositories but it's an older version which doesn't play with the most recent Lazarus.

I don't know if you've seen this or not, but the Lazarus wiki has a script designed for Ubuntu 6.06 which downloads and installs the whole thing, it'll probably work for 5.10 too, have a look:

http://wiki.lazarus.freepascal.org/Install...ing_from_source

You will need to install build-essential before doing this, you can do so with this command:

sudo apt-get install build-essential

(you probably have the hang of this by now.)

The downloads are quite big though, so depending on your connection, be prepared to wait a while, or you could download them separately and remove the sudo wget lines from the script. If you want any help with it let me know.

No plans to go home currently, much nicer being 'stuck' here !

Posted

Went to that site but all I got was 'There is currently no text in this page, you can search for this page title in other pages or edit this page.'

Did the search but no result. I will try again later...

I have asked for another issue of Ubuntu, the latest version is 6.06 I think so the last lot took a month or so but downloading the CD would take ages!

My home is now Pai, I refer to the other place as 'where I used to live',,,,

All the best,

Colin

Posted

The link works for me...anyway it's quite small so here it is:

Installing from source

If you prefer to install from source and compile the files yourself, follow these instructions. Because the whole lazarus stuff is installed into one directory, uninstall is very easy and you don't need to be root to install lazarus. You can get tgz files for fpc, fpcsrc and lazarus from the downloads section or you can download it directly via svn.

Here is an example of installing 0.9.18 to Ubuntu 6.06. If you understand Linux commands and bash script, you can get what steps are needed. Just copy the script (change the version number when new version has been released), paste it into a text editor, and save it as something like "install_lazarus.sh". Give it execute permission, and run it in a console. Note: In this example, fpc is installed in /opt. So when prompted 'Install prefix', enter '/opt/fpc'.

#!/bin/sh

#installing required packages
sudo apt-get install build-essential
sudo apt-get install libgtk2.0-dev
sudo apt-get install libgdk-pixbuf-dev

#installing FreePascal source
cd /opt
sudo wget http://nchc.dl.sourceforge.net/lazarus/fpc-src-2.0.4.source.tgz
sudo tar -xvf fpc-src-2.0.4.source.tgz
sudo mv fpc fpcsrc

#installing FreePascal
sudo mkdir fpc
cd fpc
sudo wget http://nchc.dl.sourceforge.net/lazarus/fpc-2.0.4.i386-linux.tar
sudo tar -xvf fpc-2.0.4.i386-linux.tar
echo "Enter '/opt/fpc' when prompted 'Install prefix'"
sudo sh install.sh

#adding fpc path to the PATH
echo "#FPC PATH" >> ~/.bash_profile
echo "if [ -d /opt/fpc/bin ]; then" >> ~/.bash_profile 
echo PATH=/opt/fpc/bin:"${PATH}" >> ~/.bash_profile
echo "fi" >> ~/.bash_profile

#installing Lazarus
cd ../
sudo wget http://nchc.dl.sourceforge.net/lazarus/lazarus-0.9.18-0.tar.gz
sudo tar -zxvf lazarus-0.9.18-0.tar.gz
PATH=/opt/fpc/bin:"${PATH}"
sudo chmod -R 777 lazarus
cd lazarus
make clean all
./lazarus

Note: You have to manually set fpc-src path in the Environmental Options.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.



×
×
  • Create New...