[mdlug] External Hard Drives: Mounting, Unmounting, Partial Mounting?

Paul set at pobox.com
Sun Jan 20 22:35:29 EST 2008


Elisa Gomez <shmi85 at yahoo.com>, on Sat Jan 19, 2008 [10:20:55 PM] said:
> 
> emg at trotsky:~$ sudo mount /dev/sdc1 /mnt
> emg at trotsky:~$ mount
> /dev/sda2 on / type ext3 (rw,errors=remount-ro)
> blahblahblah
> /dev/sdc1 on /mnt type ext2 (rw)
> 
> So now it should be mounted, correct? But that's not
> reflected in X. There's nothing graphical to indicate
> that it's mounted and I can't save a file (in X, I
> don't know how to do it via the command line) to the
> drive or anything. Can I rename it manually so it
> stops renaming itself every time I suspend?
> 
> ~Elisa
> 

	Hi;

	mount is able to mount filesystems by either their
volume label or UUID number instead of a specific device node.

# dumpe2fs /dev/sdc1 | less

	The first few lines will contain the volume name, if it
exists and the UUID number. If you want to set a volume name to
'Puppy', do:

# tune2fs -L "Puppy" /dev/sdc1

	Then you can mount the device based upon either the name
or the UUID number as:

# mount -L Puppy /mnt
or
# mount -U <hideously-long-UUID-number> /mnt

	To make things even easier, we can create an entry for this
filesystem in /etc/fstab.

LABEL="Puppy" /mnt ext2 defaults 0 2

or

LABEL="Puppy" /mnt ext2 defaults,noauto 0 2

	If you dont want the system to mount it for you. Now, I dont
know what is going on with the suspend/resume behaviour, so you would
have to experiment to see what happens with the first entry.
	If the system doesnt automaticly mount your fs, you will
be able to mount it easier and without root power as:

# mount /mmt
or even
# mount -a

	Now for some advice. I would use ext3 as the filesystem, as
ext2 is not journaled, which means that if the filesystem is
uncleanly umounted (eg. power off while mounted, or possibly whatever
is happening during your suspend-- I dont know if it gets cleanly
unmounted in that case.) Then the filesystem could be in an unknown
state and require that 'fsck' be run on it to check and fix it.
'fsck' will take forever on a 320gig disk. A journaled fs like ext3
will just replay the journal when it is mounted and should thus always
be in a good safe state. In order to make your fs ext3, you could do:

# tune2fs -j /dev/sdc1

	And then refer to it as type ext3 in all the examples
after that.

	You may wish to check the filesystem before doing any
of this: (do this when it is unmounted. If it comes back clean,
great, but if it thinks it needs checking you can either let it,
or start over by making a new filesystem with 'mkfs.ext3')

# e2fsck -p /dev/sdc1

	Also, I would choose a different mountpoint than /mnt,
as I think many distributions have a heirarchy under /mnt
that they use for automaticly mounting media, like say cdroms.
And if you mount your filesystem there you hide that directory
structure. Just do a 'mkdir /puppy' or whatever and use that
instead of '/mnt'

Paul
set at pobox.com

disclaimer: Ideally, with a modern distribution, I would expect this
drive to be detected and mounted, and a little icon appear on your
desktop that fires up a filebrowser if you click on it. But since
thats not happening, the above should be enough to make dealing
wtih the situation a bit easier.

pps. All of these commands have man pages, which I dont suggest
reading all of, but its often a good idea to read the description
of the command and the specific options you will try.



More information about the mdlug mailing list