re-create all partition mount points

Asked by Judge

Ubuntu and WinXP are on two separate hard drives. Cleaning up the WinXP hard drive I moved,resized, or renamed all the partitions. That destroyed all the XP partition mount points that were mounted on startup. All the partitions are listed in dev/disk/by-label. Is there an easy way to re-establish all the mount points. Sorry, but I'll need detailed help.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu util-linux Edit question
Assignee:
No assignee Edit question
Solved by:
Sam_
Solved:
Last query:
Last reply:
Revision history for this message
PeterPall (peterpall) said :
#1

You mean that they aren't mounted automatically any more at all?
If yes that would be most unusual, since normally unknown media is outomatically mounted into the /media directory - and in this case I am no expert of this problem, since this always worked like magic on my computer and I therefore never have been forced to find out how this magic works.

Or are they now mounted onto different mount points than they used to?

If you are unsure if the drive is mounted typing the command
mount
without parameters into a console might help - which will print the file /det/mtab to the screen which holds all information about which media is currently mounted where.

Another thing that might help to track the problem down is typing
sudo mount /dev/disk/by-label/<type in here the label of one of the disks that give you problems> /mnt

into a console:
This mounts the drive manually into the directory /mnt - which is a good test if your system is able to mount this partition if it tries to.

Revision history for this message
Judge (judgefraz) said :
#2

Tnx for the suggestions and I'll try them.
When Ubuntu was installed, all the partitions on the XP drive were shown
on the desktop and could be opened with access to all the files on the
selected partition. Now, no partitions are shown nor do they show up in
"Places" as they did before.

Judge

On Sat, 2010-07-24 at 09:24 +0000, PeterPall wrote:
> Your question #118803 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/118803
>
> Status: Open => Needs information
>
> PeterPall requested for more information:
> You mean that they aren't mounted automatically any more at all?
> If yes that would be most unusual, since normally unknown media is outomatically mounted into the /media directory - and in this case I am no expert of this problem, since this always worked like magic on my computer and I therefore never have been forced to find out how this magic works.
>
> Or are they now mounted onto different mount points than they used to?
>
> If you are unsure if the drive is mounted typing the command
> mount
> without parameters into a console might help - which will print the file /det/mtab to the screen which holds all information about which media is currently mounted where.
>
> Another thing that might help to track the problem down is typing
> sudo mount /dev/disk/by-label/<type in here the label of one of the disks that give you problems> /mnt
>
> into a console:
> This mounts the drive manually into the directory /mnt - which is a good test if your system is able to mount this partition if it tries to.
>

Revision history for this message
Judge (judgefraz) said :
#3

Okay, Itried both your suggestions.
Typing mount w/o parameters shows no disks mounted.
Typing: sudo mount /dev/disk/by-label/<any of the partitions> returns an
error that the selected partition isn't found in either /etc/fstab
or /etc/mtab.
I've already looked in both those files and none of the partitions are
listed nor is the XP hard drive.

Judge

On Sat, 2010-07-24 at 09:24 +0000, PeterPall wrote:
> Your question #118803 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/118803
>
> Status: Open => Needs information
>
> PeterPall requested for more information:
> You mean that they aren't mounted automatically any more at all?
> If yes that would be most unusual, since normally unknown media is outomatically mounted into the /media directory - and in this case I am no expert of this problem, since this always worked like magic on my computer and I therefore never have been forced to find out how this magic works.
>
> Or are they now mounted onto different mount points than they used to?
>
> If you are unsure if the drive is mounted typing the command
> mount
> without parameters into a console might help - which will print the file /det/mtab to the screen which holds all information about which media is currently mounted where.
>
> Another thing that might help to track the problem down is typing
> sudo mount /dev/disk/by-label/<type in here the label of one of the disks that give you problems> /mnt
>
> into a console:
> This mounts the drive manually into the directory /mnt - which is a good test if your system is able to mount this partition if it tries to.
>

Revision history for this message
PeterPall (peterpall) said :
#4

The only thing you can try (I haven't made this clear enough) is to add an "/mnt" to the end of your mount command:

If the partition you want to mount cannot be found in the list of known partitions (which is the file /etc/fstab) you have to tell the system where to mount the partition.

Normally every system contains a directory named /mnt which is empty - and only there so you have a point you can mount new devices at manually, if you have to.

The only thing is
 - if you are able to mount the partition manually - you could create directories you can use as mount points and add the partition to the /etc/fstab file, manually. When starting the system mounts everything it finds there, but that wouldn't solve the problem why the auto-mount functionality of your system didn't mount the partitions automatically.
 - and if you are not able to mount them something is wrong with the partitions
...and in both cases I don't really know how to help you.

Good luck!

 ---PeterPall.

Revision history for this message
Sam_ (and-sam) said :
#5

Editing of partitions may lead to new UUIDs.
Partition table:
sudo fdisk -l

by UUID:
ls /dev/disk/by-uuid -al
or
sudo blkid

by label:
mount

Before a partiton can be mounted you need to create a mount point.
Gathered information needs to be written into /etc/fstab.
When finished either reboot or:
mount -a

In case user needs permission to access mount point.
e.g.:
sudo chown -R user:group /path/of/mountpoint

https://help.ubuntu.com/community/Fstab
https://help.ubuntu.com/community/DrivesAndPartitions

Revision history for this message
Judge (judgefraz) said :
#6

Good evening Sam,
First off, thankls much for all your help. It's been over thirty years
since I worked with a Unix system and I've forgotten about everything.

All the current partitions are there [/dev/disk/By-Label] and/or by
UUID. I can manually mount a partition to /mnt. So it looks like what I
need to do is write a completely new fstab file. My question now is:
Where should the mount points listed in fstab be stored (what
directory?).

Thanks again,
Judge

On Sun, 2010-07-25 at 19:33 +0000, Sam wrote:
> Your question #118803 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/118803
>
> Status: Open => Answered
>
> Sam proposed the following answer:
> Editing of partitions may lead to new UUIDs.
> Partition table:
> sudo fdisk -l
>
> by UUID:
> ls /dev/disk/by-uuid -al
> or
> sudo blkid
>
> by label:
> mount
>
> Before a partiton can be mounted you need to create a mount point.
> Gathered information needs to be written into /etc/fstab.
> When finished either reboot or:
> mount -a
>
> In case user needs permission to access mount point.
> e.g.:
> sudo chown -R user:group /path/of/mountpoint
>
> https://help.ubuntu.com/community/Fstab
> https://help.ubuntu.com/community/DrivesAndPartitions
>

Revision history for this message
Best Sam_ (and-sam) said :
#7

The partition will be shown in 'places' (and/or as an icon on desktop #except KDE4) when the mountpoint is in /media.
https://help.ubuntu.com/community/Fstab#Mount%20point

Basically a mountpoint can be any place you want.
e.g.
/mnt/data
/data
/home/user/data

Remember to make a 'final new line' in fstab, otherwise you may get an error saying like: missing final new line.
Reference.
https://help.ubuntu.com/community/Mount
http://www.debianadmin.com/page/2?s=fstab
http://www.tuxfiles.org/linuxhelp/fstab.html

Revision history for this message
Judge (judgefraz) said :
#8

Thanks Sam, that solved my question.

Revision history for this message
Judge (judgefraz) said :
#9

Addendum to this problem:
System - 8 NTFS partitions and 1 Ext4 partition on three USB external hard drives.
Ubuntu is the sole user of separate 320GB internal hard drive.
I had been happily using Ubuntu 9.04 with everything working perfectly. After installing 10.4LTS I found various partitions on both the external USB drives and the Win-XP internal would not mount. All partitions were properly listed in /dev/disk/by-label. The mount failure was random in that some days some (but not all) partitions would be mounted and other times none would be. /media/ always showed what was mounted. Several re-install of 10.4LTS always produced the same problem. I re-installed 9.04 and upgraded to 9.10 and the problem was there too. /etc/fstab never showed any of these mount points. A correct edit of fstab generated errors when the system tried to mount some partitions on /media.
Somewhere in the upgrades 9.10 and 10.4, something changed that my system doesn't like but I have no idea what it might be. I'm back to 9.04 and all is well again. Since nobody seemed to share this problem, I assume it must relate to something in my system that Ubuntu doesn't like.

Revision history for this message
PeterPall (peterpall) said :
#10

If the problem was triggered by the update to 10.4 there might be another reason:

Former linux versions had 2 programs that tried to make device files appear in /dev and to do everything to make them usable like mounting them: hal and udev.

The problem was that the programs were basically responsible for the same kind of stuff and nobody had really defined where the responsability of one program ends and the one of the other begins - so finding out who has to do what was a nightmare.

In 10.10 hal was completely dropped: Udev had grown intelligent enough to use devicekit-disks and handle all devices itselves - and dropping as many programs as possible from the boot process made boot times shrink drastically. On my slow intel atom computer the whole system was suddenly up in 12 seconds, even if due to having only 8GB of hard disk this was partially caused by me uninstalling everything I could survive without.

It is pure speculation. But perhaps during your upgrade either not all the udev-related packages were installed - or some part of hal stayed in your system that shouldn't have.

Revision history for this message
Judge (judgefraz) said :
#11

Every time I re-installed, the Linux HD was completely empty (Linux and
SWAP deleted) and reformatted - except the online upgrade to 9.10 which
also showed the problem. A 16GB stick also mounts properly. So, the only
thing I now know for sure is that 9.04 works perfectly but 9.10 and
10.4LTS don't. It's black magic.

On Fri, 2010-08-06 at 04:56 +0000, PeterPall wrote:
> Your question #118803 on util-linux in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/util-linux/+question/118803
>
> PeterPall posted a new comment:
> If the problem was triggered by the update to 10.4 there might be
> another reason:
>
> Former linux versions had 2 programs that tried to make device files
> appear in /dev and to do everything to make them usable like mounting
> them: hal and udev.
>
> The problem was that the programs were basically responsible for the
> same kind of stuff and nobody had really defined where the
> responsability of one program ends and the one of the other begins - so
> finding out who has to do what was a nightmare.
>
> In 10.10 hal was completely dropped: Udev had grown intelligent enough
> to use devicekit-disks and handle all devices itselves - and dropping as
> many programs as possible from the boot process made boot times shrink
> drastically. On my slow intel atom computer the whole system was
> suddenly up in 12 seconds, even if due to having only 8GB of hard disk
> this was partially caused by me uninstalling everything I could survive
> without.
>
> It is pure speculation. But perhaps during your upgrade either not all
> the udev-related packages were installed - or some part of hal stayed in
> your system that shouldn't have.
>

Revision history for this message
Sam_ (and-sam) said :
#12

> 9.10 and 10.4, something changed
> Linux HD was completely empty

At first glance the obvious change is Grub_2 since Karmic. Since you have lots of different partitions you can either reinstall Grub_legacy or introduce the partitions properly to Grub_2 by editing or creating new scripts in /etc/grub.d/.
Reference:
https://wiki.ubuntu.com/KarmicKoala/TechnicalOverview#GRUB%202%20by%20default
https://wiki.ubuntu.com/Grub2

http://ubuntuguide.org/wiki/Multiple_OS_Installation

Revision history for this message
Judge (judgefraz) said :
#13

  Now that's an interesting angle - one that I'd never considered. I've
found it so odd that the version I was using worked so well but the
upgrades were a disaster. The older version picks up all the
partitions, properly recognizes a 16Gb memory stick in and out, and
never gives any problems. I'll look at Grub and see what I find.

On 8/20/2010 3:05 PM, Sam wrote:
> Your question #118803 on util-linux in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/util-linux/+question/118803
>
> Sam posted a new comment:
>> 9.10 and 10.4, something changed
>> Linux HD was completely empty
> At first glance the obvious change is Grub_2 since Karmic. Since you have lots of different partitions you can either reinstall Grub_legacy or introduce the partitions properly to Grub_2 by editing or creating new scripts in /etc/grub.d/.
> Reference:
> https://wiki.ubuntu.com/KarmicKoala/TechnicalOverview#GRUB%202%20by%20default
> https://wiki.ubuntu.com/Grub2
>
> http://ubuntuguide.org/wiki/Multiple_OS_Installation
>