From: Peter Hanke on
Assume I have an external hard disc which I connect to my local computer.

After boot of my Linux (Ubuntu) the new hard disc appears in /dev as

/dev/sdb
/dev/sdb1
/dev/sdb2
/dev/sdb5

So as far as I can see the hard disc /dev/sdb has three parititons: /sdb1 /sdb2 and /sdb5

I can mount them now individually step-by-step e.g.

mount -f ext4 /dev/sdb1 /mnt/myexthd1

First question: Do I have to mount the wrapping /dev/sdb as well?

How can I mount all three partitions in one step (=one command)?

Afterwards the mounting should be as follows (or similar):

/dev/sdb1 -> /mnt/myexthd/sdb1
/dev/sdb2 -> /mnt/myexthd/sdb2
/dev/sdb5 -> /mnt/myexthd/sdb5

How can I achieve this?

Peter

From: Grant on
On 28 Jul 2010 09:33:47 GMT, peter_ha(a)andres.net (Peter Hanke) wrote:

>Assume I have an external hard disc which I connect to my local computer.
>
>After boot of my Linux (Ubuntu) the new hard disc appears in /dev as
>
>/dev/sdb
>/dev/sdb1
>/dev/sdb2
>/dev/sdb5
>
>So as far as I can see the hard disc /dev/sdb has three parititons: /sdb1 /sdb2 and /sdb5
>
>I can mount them now individually step-by-step e.g.
>
>mount -f ext4 /dev/sdb1 /mnt/myexthd1
>
>First question: Do I have to mount the wrapping /dev/sdb as well?
>
>How can I mount all three partitions in one step (=one command)?
>
>Afterwards the mounting should be as follows (or similar):
>
>/dev/sdb1 -> /mnt/myexthd/sdb1
>/dev/sdb2 -> /mnt/myexthd/sdb2
>/dev/sdb5 -> /mnt/myexthd/sdb5
>
>How can I achieve this?

man fstab?
Grant.
>
>Peter
From: Robert Heller on
At 28 Jul 2010 09:33:47 GMT peter_ha(a)andres.net (Peter Hanke) wrote:

>
> Assume I have an external hard disc which I connect to my local computer.
>
> After boot of my Linux (Ubuntu) the new hard disc appears in /dev as
>
> /dev/sdb
> /dev/sdb1
> /dev/sdb2
> /dev/sdb5
>
> So as far as I can see the hard disc /dev/sdb has three parititons: /sdb1 /sdb2 and /sdb5
>
> I can mount them now individually step-by-step e.g.
>
> mount -f ext4 /dev/sdb1 /mnt/myexthd1
>
> First question: Do I have to mount the wrapping /dev/sdb as well?
>
> How can I mount all three partitions in one step (=one command)?
>
> Afterwards the mounting should be as follows (or similar):
>
> /dev/sdb1 -> /mnt/myexthd/sdb1
> /dev/sdb2 -> /mnt/myexthd/sdb2
> /dev/sdb5 -> /mnt/myexthd/sdb5
>
> How can I achieve this?

man fstab
man bash

>
> Peter
>
>

--
Robert Heller -- Get the Deepwoods Software FireFox Toolbar!
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
heller(a)deepsoft.com -- Contract Programming: C/C++, Tcl/Tk


From: unruh on
On 2010-07-28, Peter Hanke <peter_ha(a)andres.net> wrote:
> Assume I have an external hard disc which I connect to my local computer.
>
> After boot of my Linux (Ubuntu) the new hard disc appears in /dev as
>
> /dev/sdb
> /dev/sdb1
> /dev/sdb2
> /dev/sdb5
>
> So as far as I can see the hard disc /dev/sdb has three parititons: /sdb1 /sdb2 and /sdb5

No. It has two partitions. One is a primary and one a logical contained
within a primary. That second primary is probably sdb2, but I cannot
tell without the output of
fdisk -l

>
> I can mount them now individually step-by-step e.g.
>
> mount -f ext4 /dev/sdb1 /mnt/myexthd1
>
> First question: Do I have to mount the wrapping /dev/sdb as well?

No.

>
> How can I mount all three partitions in one step (=one command)?

udev will usually do it for you.

mount /dev/sdb1 /mnt/myexthd1;mount /dev/sdb5 /mnt/myexthd5
There is one command.

>
> Afterwards the mounting should be as follows (or similar):
>
> /dev/sdb1 -> /mnt/myexthd/sdb1
> /dev/sdb2 -> /mnt/myexthd/sdb2
> /dev/sdb5 -> /mnt/myexthd/sdb5

That was not what you said above.

>
> How can I achieve this?
>
> Peter
>