LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-28-2007, 08:13 PM   #1
chaoticanarchyX
LQ Newbie
 
Registered: Sep 2007
Location: westfield, MA
Distribution: Debian / XFCE
Posts: 10

Rep: Reputation: 0
Unhappy hard drive freshly wiped (no file system) will not pick up UBUNTU


Hi all
I have just wiped out a hard drive (that was fat 32) to a fresh drive (no file system.) My problem is, is getting UBUNTU to pick up on it, format it to linux specs, and use it.

I added it AFTER I installed UBUNTU on it, if this will help (I'm still new to linux, but VERY familiar with windows.)
 
Old 09-28-2007, 08:23 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Do you mean that the Ubuntu live CD won't see the drive or do you mean that the existing Ubuntu installation on the drive won't boot?

I'd say install Ubuntu again.
 
Old 09-29-2007, 08:12 AM   #3
larkl
Member
 
Registered: Sep 2007
Distribution: Puppy 5.2.8
Posts: 69

Rep: Reputation: 15
If you mean that

you added a "new" drive to the system and Ubuntu doesn't see it, you'll need to partition the "new" drive and format it. Then you'll either have to mount it manually or edit fstab to automount it. Of course, you could reinstall the entire OS and move the /home or something to the "new" drive. If you just want the additional drive for storage capacity, then reinstalling the OS is kind of extreme (IMHO).
 
Old 09-29-2007, 11:13 AM   #4
chaoticanarchyX
LQ Newbie
 
Registered: Sep 2007
Location: westfield, MA
Distribution: Debian / XFCE
Posts: 10

Original Poster
Rep: Reputation: 0
My UBUNTU is allready installed, i just wiped the second drive fresh and wanted to use it as a typical slave. I'm not really looking to reinstall the system just to get it to recognise it. Do either of you know the commands to be able to mount it (or any other steps I have to do to make it useable?)

Last edited by chaoticanarchyX; 09-29-2007 at 11:15 AM.
 
Old 09-29-2007, 12:08 PM   #5
sadiqdm
Member
 
Registered: Nov 2003
Location: London, UK
Distribution: openSUSE, Ubuntu
Posts: 358

Rep: Reputation: 35
Sounds like you need to format & partition the new drive first. I suggest you use the live CD from Parted Magic to do that. I find that the partition tools in most distros are not as nice as the live CD, and you can do all the work without mounting the drive. Once you have the drive formated, you can boot back into Ubuntu.

If you are using 7.04, open System Settings, and click the Advanced tab, then select Disk & Filesystems. It should show you all available drives & partitions, including any not mounted. Click the Administrator button at the bottom.

Highlight the partition you want to mount. If it doesn't have a mount point, click New at the bottom. Leave Type set to Automatic. Select browse and choose a place to mount to. You can create a new directory at this point. Leave all the other settings as they are, but tick the box for Enable at start up. Click OK and your done.

When you exit from this tool it updates your /etc/fstab file and mounts the new partition/s.
 
Old 09-29-2007, 03:34 PM   #6
chaoticanarchyX
LQ Newbie
 
Registered: Sep 2007
Location: westfield, MA
Distribution: Debian / XFCE
Posts: 10

Original Poster
Rep: Reputation: 0
Ok I was finally able to get it formatted and mounted, but now it's saying that i dont have permissions to write to it (it's saying that only root has the permissions to write to it and use it, but the owner is unknown)
any suggestions?

Last edited by chaoticanarchyX; 09-29-2007 at 03:54 PM.
 
Old 09-30-2007, 03:27 AM   #7
sadiqdm
Member
 
Registered: Nov 2003
Location: London, UK
Distribution: openSUSE, Ubuntu
Posts: 358

Rep: Reputation: 35
Changing the owner and group of a directory

You need to change the owner & permissions for the new directory. I can't think of a way round doing this in a terminal.

Open a terminal and type:
Code:
sudo -s
then your password to get a root shell. Then:
Code:
cd /home
ls -l
You should have a listing like this:
Code:
dougal:~ # cd /home
dougal:/home # ls -l
total 36
drwxrwxr-x 23 sadiq users  4096 May 30 15:15 archive
drwxrwxr-x 37 sadiq users  4096 Jul  4 19:16 common
drwxrwxr-x 10 sadiq users  4096 Aug 22 11:25 data
drwx------  2 root  root  16384 Jun  3 19:00 lost+found
drwxr-xr-x 55 sadiq users  4096 Sep 30 09:20 sadiq
dougal:/home #
The bottom line is my home directory, and the top 3 lines are other partitions. You need to make a note of the user name and group for you home directory and then use these commands to change the new directory, which is probably set to username root & group root.

This will change the owner:
Code:
chown username /full-path-to-directory/
And this will change the group:
Code:
chgrp username /full-path-to-directory/
Be careful to keep the spaces, and everything is case sensitive. If you also need to change the permissions you can use this:
Code:
chmod 775 /full-path-to-directory/
Let us know how you get on.
 
Old 09-30-2007, 07:40 AM   #8
chaoticanarchyX
LQ Newbie
 
Registered: Sep 2007
Location: westfield, MA
Distribution: Debian / XFCE
Posts: 10

Original Poster
Rep: Reputation: 0
I did the commands in terminal and heres what it gave me

gary@gary-desktop:~$ sudo -s
Password:
root@gary-desktop:~# cd /home
root@gary-desktop:/home# ls -l
total 4
drwxr-xr-x 32 gary gary 4096 2007-09-30 08:32 gary
root@gary-desktop:/home#


i dont know why its not showing the other drive. Another thing I have been noticing is when I'm in the computer window (like My computer) it's showing the drive has no free space at all, but i got into it and it says that I have the free space.Also I have been using the gnome partition editor and made it into a ext3 primary. the disk label is msdos (the only thing that I recognized and picked,) if that helps at all.
 
Old 09-30-2007, 08:37 AM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You need to mount the drive somewhere as well. Could you post the output of "sudo /sbin/fdisk -l" and indicate which drive is the one you just formatted. It will probably be either /dev/sdb or /dev/hdb depending on whether it is a SATA or PATA drive. Also, did you create a filesystem on it? The partition itself will probably be /dev/sdb1 or /dev/hda1.

Note: Sometimes you need to reboot after repartitioning so that the BIOS learns of the new partition.

If you have a graphical partitioner program you can use that. Otherwise you can use "sudo /sbin/mkfs -t <fs type> /dev/<device>" to create a new filesystem on your partition. For example to create the an ext3 filesystem on /dev/hdb1:
sudo /sbin/mkfs -t ext3 /dev/hdb1

Now you need to mount it somewhere. Suppose you want to mount it on /mnt/photos/.
First create the mount point, and then mount it:
sudo mkdir /mnt/photos/
sudo mount -t /dev/hdb1 /mnt/photos -o acl,user_xattr

Now who can access it? If only you, then use chown to make yourself the owner.
sudo chown <yourusername>.<yourgroupname> /mnt/photos
sudo chmod 0770 /mnt/photos

A side note here. You use the chown or chmod command after mounting the partition. It isn't the permissions of the mount point that get changed. It is instead the permissions of the partition.

If instead you want all users access, then leave the owner and group as root and give others permissions:
chmod 1777 /mnt/photos

In the command above, the permisions also set the sticky bit to prevent a user from deleting another user's files. If this is the user you want, a globably writable partition that all users have access to, then you should use the mount options:
nosuid, nodev and noexec to the mount options.

After deciding all of your mount options, it would be a good idea to add an enter in /etc/fstab. Then you won't have to manually mount it every time you boot up.

For the first, example you could use:
Code:
/dev/hdb1       /mnt/photos       ext3    acl,user_xattr 1 2
For the second all users access example, you could use this:
Code:
/dev/hda6       /mnt/photos       ext3    acl,user_xattr,noexec,nodev,nosuid 1 2
To get the options, I simply looked at what the system used for my /home partition on my system and added noexec,nodev,nosuid. You could print out your current /etc/fstab file and base your mount options on the /home or the root (/) partitions. The second public use example resembles the the /tmp directory. Take a look for yourself what the permissions are on your system:
ls -ld /tmp
Notice the "t". That is how the ls -l command indicates the "sticky" bit.

Good Luck!
 
Old 09-30-2007, 09:21 AM   #10
chaoticanarchyX
LQ Newbie
 
Registered: Sep 2007
Location: westfield, MA
Distribution: Debian / XFCE
Posts: 10

Original Poster
Rep: Reputation: 0
here is what i get with the sudo /sbin/fdisk -l

Disk /dev/hda: 8438 MB, 8438685696 bytes
255 heads, 63 sectors/track, 1025 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 976 7839688+ 83 Linux
/dev/hda2 977 1025 393592+ 5 Extended
/dev/hda5 977 1025 393561 82 Linux swap / Solaris

This one displayed below here is the drive I'm trying to get working

Disk /dev/hdb: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 2434 19551073+ 83 Linux

this one below is a usb card reader that works fine

Disk /dev/sda: 1024 MB, 1024966656 bytes
16 heads, 63 sectors/track, 1986 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1985 1000408+ b W95 FAT32

I also have been rebooting the computer each time I have formatted and partitioned it so the system will pick up on its changes and stuff. I have been using the Gnome partition editor to do all my formatting and partitioning. after I reboot the system mounts the drive for me but then I run into the no root / owner messege, and will not allow me to do anything except look
at the contents of the drive (which is lost and found currently.) when I look at the properties of the drive and click on volume and check the mount points and such it says

mount point /media/disk-1
file system ext2
mount options rw nosuid nodev (if this helps.)

It looks like the system is mounting it for me, but then again I'm new to linux still, so there may be more then I'm seeing.

Last edited by chaoticanarchyX; 09-30-2007 at 09:22 AM.
 
Old 10-02-2007, 01:49 AM   #11
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Type in "mount" by itself in the console. It will list our mounts. If /dev/sdb1 is listed then it is mounted.


The /media/ directory tends to be used for removeable media that is automounted. You may want to add an entry in /etc/fstab for it so that it will mount when you boot up your computer.

For ext2, you use the chown and chmod commands to change the ownership and permissions of the partition. Be sure to do this on the mounted partition.
For example,
chown chaotic.chaotic /media/disk-1/
chmod 0770 /media/disk-1/

These commands will change the owner to "chaotic" the group to "chaotic" and the permissions to rwxrwx---, allowing the owner and group to use it. I'm not certain if Ubuntu creates a group with the same name as the username, and makes it the default. You don't have to do this. To share the partition with other users on the computer, you could use the "users" allowing other users access as well.

I have a partition mounted in a subdirectory of my home directory. It also shows up in /media/ as well, but I don't use if from there. It is the automount system doing this, but it isn't anything I worry about.
 
Old 10-02-2007, 03:25 PM   #12
chaoticanarchyX
LQ Newbie
 
Registered: Sep 2007
Location: westfield, MA
Distribution: Debian / XFCE
Posts: 10

Original Poster
Rep: Reputation: 0
This is what I'm getting when I type in "mount" in the terminal

gary@gary-desktop:~$ mount
/dev/hda1 on / type ext3 (rw,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)
procbususb on /proc/bus/usb type usbfs (rw)
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.20-16-generic/volatile type tmpfs (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sda1 on /media/disk type vfat (rw,nosuid,nodev,shortname=mixed,uid=1000,utf8,umask=077)
/dev/hdc on /media/cdrom0 type iso9660 (ro,noexec,nosuid,nodev,user=gary)
/dev/hdb1 on /media/disk-1 type ext2 (rw,nosuid,nodev)
gary@gary-desktop:~$

I tried the f/stab/ command and this is what is comming up

gary@gary-desktop:~$ /ect/fstab
bash: /ect/fstab: No such file or directory


when I try to type in the chown and chmod commands this is what is displaying to me, I have tried to type these entries in with both
gary.gary
and
gary
for the owner and mod (just to cover some bases)

gary@gary-desktop:~$ chown gary.gary/media/disk-1
chown: missing operand after `gary.gary/media/disk-1'
Try `chown --help' for more information.
gary@gary-desktop:~$

gary@gary-desktop:~$ chmod gary.gary/media/disk-1
chmod: missing operand after `gary.gary/media/disk-1'
Try `chmod --help' for more information.
gary@gary-desktop:~$

I'm far from giving up on this
I really thank you guys for the patience and help for all of this

Last edited by chaoticanarchyX; 10-02-2007 at 03:27 PM.
 
  


Reply

Tags
drive, fresh, hard



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hard drive file system problem, I think...please HELP QUICKLY rivalmist Fedora 7 01-23-2009 08:26 AM
Possible hacking; wiped - now hard drive space missing? - hidden files? trekk Linux - Security 9 11-10-2006 10:17 AM
Wiped Entire Hard Drive and Want To Install Slackware Midnyt Slackware 3 09-04-2006 05:58 PM
ghost cd of xp wiped my hard drive supraman4eva Linux - General 4 10-19-2005 05:40 PM
Reiser file system / Hard Disk/ Hard Drive Problems Oxyacetylene Linux - Software 4 10-10-2005 02:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration