PDA

View Full Version : [ubuntu] [SOLVED] Formatting / Permission Woes



Blather_X
October 2nd, 2008, 11:42 PM
I have just installed a "donated - Apple Formatted" 40 gig drive to use for storage. Straight Linux, no dual boot, no partition, just storage, ext3 only. It mounted no problem after the boot. I initially tried to delete the contents, but I didn't have "permission". I went to the disc properties to check the permissions and it said: "The permissions of "disc" could not be determined." Next I tried Gpart to format the drive. After deleting 3 small partitions the results were 38.28 gig "unallocated". Mounted the drive again and all of the old information is still on the drive. And I still cant delete anything.

So, how do I change permissions to give me read/write and "delete" (ha!) access to the drive? Also I will need a "hand hold" to have it mount automatically each time I boot. And to change the ownership of the "mount point(?)" from root to my login name.

As you might be able to tell I know enough about Linux to really get myself into trouble.

Noob - "2nd Stage"
Learning and loving Linux.

Your help and knowledge are always appreciated.

Blather,
Ubuntu 8.04 (hardy)
AMD Athlon(tm) 64 Processor 3200+
__________________
Registered Linux User: #442851
I reject your reality.... And substitute my own! \!/

Rocket2DMn
October 3rd, 2008, 12:34 AM
Can you please post the output of these following commands. If the drive is external, please plug it in first, and let me know that it is external, otherwise I will assume it is an internal disk.

sudo fdisk -l
cat /etc/fstab
sudo blkid
mount

Blather_X
October 3rd, 2008, 01:59 AM
Thanks for the assist. since my posting I have been able (i think so anyway) to format the drive. Using gpart i used the 'default' msdos settings for "Set DiskLabel". This pretty much cleaned up the drive for me. Its a 40gig HD, gpart shows 38.29 with 485 megs used. (So far so good). I mounted the drive from "places" and the only folder on the drive is "Lost & Found" (getting better) As it stands now I cant write to the disc, and "properties" shows the disk persissions could not be determined. Better... but not quite there.

Oh I almost forgot.... The disc 'is" internal. As i said before it's an Apple / Maxtor, N256, Fireball 3, ATA 133, 40gig drive.

Here is the information/output you requested:

-desktop:~$ sudo fdisk -l
Disk /dev/sda: 12.9 GB, 12960718848 bytes
255 heads, 63 sectors/track, 1575 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xde480982

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1503 12072816 83 Linux
/dev/sda2 1504 1575 578340 5 Extended
/dev/sda5 1504 1575 578308+ 82 Linux swap / Solaris

Disk /dev/sdb: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0007a532

Device Boot Start End Blocks Id System
/dev/sdb1 1 4998 40146403+ 83 Linux
desktop:~$
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~

-desktop:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# -- This file has been automaticly generated by ntfs-config --
#
# <file system> <mount point> <type> <options> <dump> <pass>

proc /proc proc defaults 0 0
# Entry for /dev/sda1 :
UUID=0ac43894-f979-45e7-ae8c-7d8794f908c7 / ext3 relatime,errors=remount-ro 0 1
# Entry for /dev/sda5 :
UUID=70f86918-0f17-49ad-b372-464d7163a9f9 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
desktop:~$
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~

-desktop:~$ sudo blkid
/dev/sda1: UUID="0ac43894-f979-45e7-ae8c-7d8794f908c7" TYPE="ext3"
/dev/sda5: TYPE="swap" UUID="70f86918-0f17-49ad-b372-464d7163a9f9"
/dev/sdb1: UUID="75566192-0cb2-4b96-b288-c856b02c04d9" TYPE="ext3"
desktop:~$
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~

-desktop:~$ mount
/dev/sda1 on / type ext3 (rw,relatime,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.24-19-generic/volatile type tmpfs (rw)
securityfs on /sys/kernel/security type securityfs (rw)
gvfs-fuse-daemon on /home/forest-tek/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=forest-tek)
/dev/sdb1 on /media/disk type ext3 (rw,nosuid,nodev,uhelper=hal)
desktop:~$

Blather

Rocket2DMn
October 3rd, 2008, 02:14 AM
The drive is formatted as ext3, and does not have an entry in fstab. Since this drive is apparently internal (you didn't say it was external), let's create a mount point and add it to fstab.
Let's say you want to call it "storage" (you can call it whatever you want, just don't use spaces or special characters in the name).

Make the mount point

sudo mkdir /media/storage
Now open fstab for editing

gksudo gedit /etc/fstab
At the bottom, add this line:

UUID=75566192-0cb2-4b96-b288-c856b02c04d9 /media/storage ext3 defaults 0 2
Save and close. Now remount the drive (if it complains, post the output back here):

sudo mount -a
Now set ownership on the drive (where you subsitute your login name for <yourusername> without brackets):

sudo chown <yourusername>:<yourusername> /media/storage

You should now be able to write to the drive.

Blather_X
October 3rd, 2008, 02:47 AM
Having some troubles. Thinking back... (Hindsight is indeed 20/20) Should the drive have been unmounted before doing any of this?

Everything went swimingly until the mount -a portion. Since the drive was already mounted.

I tried to unmount the drive from the desktop but it seems I do not have permissions to unmount it. Is it permanently (of sorts) mounted? If so, this is a good thing.

But I can now write to it. Whee!

The "Lost & Found" folder is locked. Is there a purpose for this? And it still shows as "41.1 GB Media" on the desktop.

Rocket2DMn
October 3rd, 2008, 02:58 AM
It should have remounted automatically with the mount command, you can try unmounting it manually if you'd like

sudo umount /dev/sdb1
sudo mount -a
Since you can read and write, then it would appear to be successful already. You aren't supposed to be able to write to lost+found, it's permissions at 700 - only root can read/write/execute on that folder. Don't worry, you'll never use it - you should create your own file and folder structures on the drive as you see fit, lost+found is used by the filesystem in some cases that it runs into problems.

You can rename the partition using the e2label program, follow the directions at community/RenameUSBDrive and use the ext2 and ext3 section when you get to part 5. The page says it is for external drives, but it will work for you as well, I should probably update that page :)

Blather_X
October 3rd, 2008, 04:03 AM
Well... Thank you very much.! All is right with the world. YAY!

It's always a treat to be able to pick the experts brains and have them in turn give of their knowledge and experience so freely.

One thing that I'd like to be able to accomplish is to have a better "working" knowledge of linux. It's one thing to be able to cut and paste code in the terminal and watch the magic happen. It's another to know how it happens. I'm one of those guys that have to know "why & how" the magic happens. I am a member of quite a few Linux forums, and read as much as I can. Other than that I'm at a loss.

The more that I am exposed to Linux the more I enjoy it. I'm a "hands on, gotta' tweak it, what will happen if I push this button, type "A" personality. So being able to customize to my hearts content is a real treat. I really enjoy having all this freedom of control over my OS and my working environment.

So now to my last question. Can you point me to a good introductory "primer" for learning more about the working of this wonderful OS?

Thank you again,

Rocket2DMn
October 3rd, 2008, 12:24 PM
I have found the best resource is to just pursue different problems and interests as they come up. Look into alternatives, and feel free to fiddle around. Keep good backups of all your data, and don't be afraid to "break" the system - obviously, don't go overboard: if something seems like a bad idea, don't do it. I don't really have a one-stop-shop resource for getting to know linux better. There are many resources available with specific information about different topics, so getting detailed knowledge on just a few areas can help you understand so much more about the system. These forums are a great place to read up on topics as well, ask questions, and just browse the latest threads to see what kinds of problems people are having and how they are getting fixed. When somebody gives you a command, ask them what it does, and google it (or god forbid, even look at the man page!) to get more information about it - you can find out what the different options are for using the command and what it is specifically designed to do.
Happy Ubuntu-ing!