My disk partitions

Asked by Fred

I have 2 hard disk drives in my computer system.

== Disk 1 ==
sda1 = Windows XP
sda5 = Stuff
sda6 = Stuff

== Disk 2 ==
sdb1 = Ubuntu 7.10 'Gutsy Gibbon'
sdb2 = Stuff

sda1, sda5, sda6 appear in "Computer" in "Places". They do appear in the /media/ directory.

However, sdb2 does not appear in "Computer" in "Places". It is nowhere to be found.

And when I installed the Ubuntu, I unplugged disk 1, so sdb was sda, but is now sdb.

In /mnt/ there is a sda2, which I think points to what is now sdb2.

How can I fix this?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Fred
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Allen Chemist (alchemist) said :
#1

What is mounted at boot time is controlled by the 'fstab' file. If you want to be absolutely sure your disks are as you think they are (which I recommend doing first), in Applications -> Accessories -> Terminal, type the following
sudo fdisk -l

This will list all disks and partitions in your system (which should show sda1 as NTFS and the number of blocks, etc)

Once you have that information, it's time to edit the fstab to cause things to mount automatically on bootup

First, a backup copy (we will name it fstab.bak)
sudo cp /etc/fstab /etc/fstab.bak

Then, edit fstab:
gksudo gedit /etc/fstab

The entries are fairly straightforward, you probably want something like this to get sdb2 listed:
/dev/evms/sdb2 /media/sdb2 ext3 defaults 0 0
^-- device name ^--mount location ^--fs type ^--fs options

Once you save this, you can type this to 'mount all drives' (as if you were restarting the computer) into the terminal:
sudo mount -a

If you have any errors, post them back here so we can look at them. Also any errors it would probably be best to revert to your saved copy (errors might result in an unbootable system):
sudo cp /etc/fstab.bak /etc/fstab

Revision history for this message
Fred (eldmannen+launchpad) said :
#2

Thanks.

Its a bit confusing that there is both /mnt and /media, I don't know which goes where or something.

== fdisk -l ==
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000ca0a4

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 3187 25599546 7 HPFS/NTFS
/dev/sda2 3188 60800 462776422+ f W95 Ext'd (LBA)
/dev/sda5 3188 12748 76798701 7 HPFS/NTFS
/dev/sda6 12749 60800 385977658+ 7 HPFS/NTFS

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0005dff8

   Device Boot Start End Blocks Id System
/dev/sdb1 * 1 3039 24410736 83 Linux
/dev/sdb2 3040 30401 219785265 83 Linux

Revision history for this message
Fred (eldmannen+launchpad) said :
#3

Okay, I edited the /etc/fstab file, and restarted the computer.

And I believe it now works, as expected.

Revision history for this message
Fred (eldmannen+launchpad) said :
#4

Hmm... there is just one thing now...

I can't put any files sdb2 :(

"Error while copying to /media/sdb2"
"You do not have permission to write to this folder."

Also, the sda1, sda5, sda6 kinda gets mounted, even though they not in /etc/fstab
But, maybe I should put them in /etc/fstab anyways?

Revision history for this message
Jim Qode (jimqode) said :
#5

add rw flag the end of the line in /etc/fstab where you define sdb2

/media/ is generally used for removable media while /mnt/ is generally used for harddisk storage

Revision history for this message
Fred (eldmannen+launchpad) said :
#6

Oh, but Ubuntu puts sda1, sda5 and sda6 in /media/
But, maybe it think those are temporary because I connected disk after installation of Ubuntu.

Revision history for this message
Fred (eldmannen+launchpad) said :
#7

I am not sure how to add the 'rw' flag.

My line in fstab looks like this;

/dev/sdb2 /media/sdb2 ext3 defaults 0 2

Revision history for this message
Fred (eldmannen+launchpad) said :
#8

How do I add an 'rw' flag?

Revision history for this message
Ralph Janke (txwikinger) said :
#9

1) /media is used more and more for mounts in ubuntu since normal users are allowed to mount and unmount partitions. This used to be only possible for administrators and happened in /mnt or directly where the partition was logically to appear in the filesystem tree.

2) The rw is one of the options which are separated by comma.

i.e. a partition that users can mount and unmount could look like this

/dev/sdb2 /media/sdb2 auto user,noauto,atime,rw,nodev,noexec,nosuid 0 2

/dev/sdb2 = device
/media/sdb2 = mount point
auto = autodetection of filesystem (you could also say ext3 here)
user,noauto,atime,rw,nodev,noexec,nosuid = filesystem options (for your purpose "default,rw" might be sufficient)
0 = dump level for backup
2 = order of check for filesystem check (root filesystem should be 1, others 2)

If you change your entry to

/dev/sdb2 /media/sdb2 ext3 defaults,rw 0 2

it might already solve your problem of readonly.

I hope this helps.

Revision history for this message
Fred (eldmannen+launchpad) said :
#10

Okay, now I added "rw" to fstab.
Still didn't work, but then I made; sudo chmod 777 /media/sdb2 and now it kinda works.

Now, I can copy files to sdb2.

Though, when I open sdb2 in File Browser, and right-click it comes menu, but "Create Folder" and "Create Document" are still grayed out. :S

Copying files and folders from my Home directory to sdb2 works fine though.

Revision history for this message
Narendra Garg (narendra145r) said :
#11

my computer hardisk 80 GB. and my Computer four particiton and C part. win XP 20 GB. and two another part. in my work use and one part. 20 GB free my hardisk i am install ubuntu 7.10

but i am not install ubuntu my partiction problem