From: VWWall on
houghi wrote:
> EOS wrote:
>> houghi wrote:
>>
>>> Why would you need that info?
>> You not ;-)
>>
>> I use it sometimes to see
>> if my HD is full or empty
>
> df
>
df shows only mounted partitions + (/dev) and Use%
It tells nothing about entire hard drive(s) Use%
--
VWW
From: David Bolt on
On Tuesday 27 Oct 2009 17:54, while playing with a tin of spray paint,
VWWall painted this mural:

<snip>

> I just edited fstab, mounting /dev/sda12 to /mnt, (a default directory
> in "/"), and it did indeed appear in "My Computer" as "17G Media". An
> attempt to unmount failed. I can probably sort out the error message,
> but this just illustrates my comments above! I could do it neatly by
> making sub-directories under /mnt for each added partition in fsab.

If you're going to do that, you can use the auto-mounter to easily
mount and umount file systems as required and without making any
changes to /etc/fstab.

Firstly, I'm going to make a few assumptions, namely that the boot
partition is /dev/sda1 , Windows occupies /dev/sda2, you have the
common swap as /dev/sda3 , and each distro has its /home following the
/ . If I'm right, the layout would be something like:

/dev/sda1 /boot
/dev/sda2 C:
/dev/sda3 swap
/dev/sda4 extended partition
/dev/sda5 distro 1 /
/dev/sda6 distro 1 /home
/dev/sda7 distro 2 /
/dev/sda8 distro 2 /home
/dev/sda9 distro 3 /
/dev/sda10 distro 3 /home
/dev/sda11 distro 4 /
/dev/sda12 distro 4 /home

If the layout is different, you should be able to adapt the following
to make it match up.

Create the directories:

/mounts/distro-1
/mounts/distro-2
/mounts/distro-3
/mounts/distro-4

replacing distro-1 to distro-4 with the names, and maybe versions, of
the different distros. This is just for convenience and you could so
you can see which one is which.

Then create the files:

/etc/auto.distro-1.misc
/etc/auto.distro-2.misc
/etc/auto.distro-3.misc
/etc/auto.distro-4.misc

with the lines similar to this:

home -fstype=ext3 :/dev/sda6

For /etc/auto.distro-2.misc to /etc/auto.distro-4.misc , change the
sda6 to point to the correct partition. You may also need to change
the "=ext3" to match the file system type. You can find these out by
using:

file -s /dev/sda*

Finally, as the last part of the setup, add the following lines to
/etc/auto.master :

/mounts/distro-1 /etc/auto.distro-1.misc -t 300
/mounts/distro-2 /etc/auto.distro-2.misc -t 300
/mounts/distro-3 /etc/auto.distro-3.misc -t 300
/mounts/distro-4 /etc/auto.distro-4.misc -t 300

If you changed distro-1 to distro-4 to something more identifiable,
make those changes here as well.

Finally, once you've got everything sorted out, use:

/etc/init.d/autofs start

to start the auto-mounter. To check that it's working, use:

ls /mounts/distro-1/home

and see if you get a directory listing.


Now, the above is a generic set of instructions. Using info from
another post, here's a more specific set, much reduced to show how
quickly and easily it can be done. These all need to be done at a
root console:

mkdir -p /mounts/PCLOS
echo "home -fstype=ext3 :/dev/sda12" >>/etc/auto.PCLOS.misc
echo "/mounts/PCLOS /etc/auto.PCLOS.misc -t 300" >>/etc/auto.master
/etc/init.d/autofs restart

The following step can be as a normal user, or as root.

ls /mounts/PCLOS/home

Again, if everything worked, you should get a directory listing showing
the directory "home"

> See Paul Gans' reply and my comment above. It is possible to make it
> show partitions by another identifier than size, but it requires some
> extra work.

Not much. Give each file system a unique label and then you'll get to
see those that are mounted under "My Computer". You can do this using
tune2fs for ext2 and ext3 file systems[0]. Other file systems have
ways of doing this as well.


[0] This might also work with ext4 but can't confirm or deny it as yet.

Regards,
David Bolt

--
Team Acorn: www.distributed.net OGR-NG @ ~100Mnodes RC5-72 @ ~1Mkeys/s
openSUSE 10.3 32b | openSUSE 11.0 32b | |
openSUSE 10.3 64b | openSUSE 11.0 64b | openSUSE 11.1 64b | openSUSE 11.2rc1
RISC OS 4.02 | RISC OS 3.11 | openSUSE 11.1 PPC | TOS 4.02
From: Kevin Miller on
houghi wrote:
> Why would I, in Linux, care if this is sde1 or hdd12 or
> penne:/home/houghi (sshfs) or some NFS mount or whatever? The only two
> moments I would care about this (and it could be done in one step) is
> during installation and then placing all the systems into fstab.

It can be handy when doing a reinstall - in the partition editor you can
see that /sde1 has a label of Home so you know to assign it to /home
when setting up the partitions. Or maybe /hdd12 is the /var partition
so you label it Var. Or whatever.

And after installing, it's easy to identify what partition is what even
if they're not installed...

....Kevin
--
Kevin Miller
Juneau, Alaska
http://www.alaska.net/~atftb
In a recent poll, seven out of ten hard drives preferred Linux.
From: VWWall on
David Bolt wrote:
> On Tuesday 27 Oct 2009 17:54, while playing with a tin of spray paint,
> VWWall painted this mural:
>
> <snip>
>
>> I just edited fstab, mounting /dev/sda12 to /mnt, (a default directory
>> in "/"), and it did indeed appear in "My Computer" as "17G Media". An
>> attempt to unmount failed. I can probably sort out the error message,
>> but this just illustrates my comments above! I could do it neatly by
>> making sub-directories under /mnt for each added partition in fsab.
>
<Snip useful instructions. The partition lay-out is very close to mine>

>> See Paul Gans' reply and my comment above. It is possible to make it
>> show partitions by another identifier than size, but it requires some
>> extra work.
>
> Not much. Give each file system a unique label and then you'll get to
> see those that are mounted under "My Computer". You can do this using
> tune2fs for ext2 and ext3 file systems[0]. Other file systems have
> ways of doing this as well.
>
Strangely enough, openSUSE already has /dev/disk/by-label, which shows
*all* partitions that have been given labels. It shows my "PCLOS_root",
which is the only one I labeled. It doesn't seem to use these entries
for anything.

In PCLOS and Mepis, all you need to do is in "System Menu>>Storage
Media", re-name the first column of names to whatever you wish.
This can be reached in Konqueror with "system:/media/ in "Location".

Some distros default to labels if they find partition labels on the
drive(s).

A right click on these "names" allows mounting the partition, checking
its properties, etc. just as "My Computer" in openSUSE does.
>
> [0] This might also work with ext4 but can't confirm or deny it as yet.
>
I haven't played with ext4 yet as my GRUB boot can't handle it without
chain loading. Just the inode changes some distros make by default, if
you let their install do the formatting, confuses legacy GRUB!

--
Virg Wall
From: David Bolt on
On Wednesday 28 Oct 2009 19:13, while playing with a tin of spray paint,
houghi painted this mural:

> David Bolt wrote:
>> Using Konqueror, right-click and select "properties" or, using KDE4,
>> open Dolphin and do the same.
>
> That is all KDE stuff.

That's because EOS was talking about finding out how much free space he
had available while using his desktop. If he was using a console, I'd
have suggested using df, possibly appending a path known to exist on
the file system he's interested in checking out the free space size.

> You can use gparted or even much better:
> /usr/sbin/parted -l
> That will show clearly all the information in a readable form.

<snip>

> And using df to add the name of the directory if available as well as
> the free space. Simple.

You already did something like that a short(ish) while ago. That script
showed the free space available on the various mounted file systems,
along with the total.


Regards,
David Bolt

--
Team Acorn: www.distributed.net OGR-NG @ ~100Mnodes RC5-72 @ ~1Mkeys/s
openSUSE 10.3 32b | openSUSE 11.0 32b | |
openSUSE 10.3 64b | openSUSE 11.0 64b | openSUSE 11.1 64b | openSUSE 11.2rc1
RISC OS 4.02 | RISC OS 3.11 | openSUSE 11.1 PPC | TOS 4.02