You are not logged in.

#1 2009-08-17 18:36:05

nathanpc
Member
From: Brazil
Registered: 2009-08-17
Posts: 19
Website

Mount PenDrive Using Command-Line

Hello,
I'm a C++ developer and i'm a Ubuntu user, but i installed Arch Linux and i want tp mount my pen-drive, but i don't know what is the driver assing, because when i want to mount something i know what is the driver name like sda1, but i don't know now, but the command to mount i know.

Thanks,
Nathan Paulino Campos

Offline

#2 2009-08-17 18:42:29

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: Mount PenDrive Using Command-Line

Plug the USB drive in and type

$ ls /dev/sd*

You should be able to tell which one. (Or you can type it twice, before and after plug, to make it really clear.)


This silver ladybug at line 28...

Offline

#3 2009-08-17 18:45:44

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: Mount PenDrive Using Command-Line

I didn't quite get what your problem is, but what I can tell you is that sda1 etc. is not a driver. It's just a device name assigned to a volume by udev. You can get the device node of your drive by monitoring dmesg output; dmesg should show some new messages about the newly plugged-in pendrive, among it the device name.

You can generally mount it by issuing

# mount /dev/sdb1 /mnt

(for a pendrive which was assigned to /dev/sdb1, mounting it to /mnt).

EDIT: Dammit, too late. tongue

Last edited by Runiq (2009-08-17 18:46:38)

Offline

#4 2009-08-17 18:54:48

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: Mount PenDrive Using Command-Line

If you know the label (name) of your drive...

# mount LABEL=... /mnt

Replace /mnt with your preferred mount point.

Offline

#5 2009-08-17 18:57:13

nathanpc
Member
From: Brazil
Registered: 2009-08-17
Posts: 19
Website

Re: Mount PenDrive Using Command-Line

The pen-drive is in /dev/sdb, but here i the log of the console:

# mount /dev/sdb /mnt/pen
mount: you must specify the filesystem type

What parameter i have to add, because in Ubuntu we have GNOME that mount all to you, i only use the console to install programs and to compile my programs using g++.

Offline

#6 2009-08-17 18:58:05

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: Mount PenDrive Using Command-Line

That's a nice tip, Peasantoid.


This silver ladybug at line 28...

Offline

#7 2009-08-17 18:59:22

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: Mount PenDrive Using Command-Line

How about

# mount /dev/sdb1 /mnt/pen

sdb is the entire drive, you should name a partition.

Also you may need to specify -t TYPE for the filesystem type. See manpage

Last edited by lolilolicon (2009-08-17 19:00:56)


This silver ladybug at line 28...

Offline

#8 2009-08-17 18:59:53

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: Mount PenDrive Using Command-Line

nathanpc wrote:

The pen-drive is in /dev/sdb, but here i the log of the console:

# mount /dev/sdb /mnt/pen
mount: you must specify the filesystem type

What parameter i have to add, because in Ubuntu we have GNOME that mount all to you, i only use the console to install programs and to compile my programs using g++.

You probably meant /dev/sdb1. /dev/sdb represents the entire drive, i.e. all the partitions. You only want the first partition.

lolilolicon: Cheers!
(Also, you beat me to it. Damn.)

Last edited by Peasantoid (2009-08-17 19:00:21)

Offline

#9 2009-08-17 19:02:54

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: Mount PenDrive Using Command-Line

I'm just messing around, you know. wink


This silver ladybug at line 28...

Offline

#10 2009-08-17 19:06:58

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: Mount PenDrive Using Command-Line

lolilolicon wrote:

I'm just messing around, you know. wink

Eh?

Offline

#11 2009-08-17 19:08:45

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: Mount PenDrive Using Command-Line

nathanpc wrote:

The pen-drive is in /dev/sdb, but here i the log of the console:

# mount /dev/sdb /mnt/pen
mount: you must specify the filesystem type

What parameter i have to add, because in Ubuntu we have GNOME that mount all to you, i only use the console to install programs and to compile my programs using g++.

Hm, you're missing the filesystem type. Try

# mount -t vfat /dev/sdb1 /mnt

for a FAT partition, or

# mount -t ntfs-3g /dev/sdb1 /mnt

for a NTFS partition (you have to have ntfs-3g installed for that).

Offline

#12 2009-08-17 19:10:35

nathanpc
Member
From: Brazil
Registered: 2009-08-17
Posts: 19
Website

Re: Mount PenDrive Using Command-Line

Thnks fo the LABEL=, i was posting when you was postin to!

Offline

#13 2009-08-17 19:11:00

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: Mount PenDrive Using Command-Line

@Peasantoid
Hmmm... I'm waiting anxiously for an answer to my problem... Can't speak properly right now. :-(

Last edited by lolilolicon (2009-08-17 19:13:13)


This silver ladybug at line 28...

Offline

#14 2009-08-17 23:29:00

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Mount PenDrive Using Command-Line

In archlinux a pen drive can be inserted after booting and will appear as a device in gparted, should you have such program installed.

To mount it, such as /sda1:

cd /mnt
mkdir /mnt/sda1
mount -t ext3 /dev/sda1 /mnt/sda1

assuming it is ext3 filesystem.

This will mount it in /mnt/sda1.

Change the parameters to fit your system setup.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#15 2009-08-17 23:34:53

nathanpc
Member
From: Brazil
Registered: 2009-08-17
Posts: 19
Website

Re: Mount PenDrive Using Command-Line

Thanks lilsirecho, but if you see better in my post i don't want to mount archlinux that is under a pendrive, but i want to mount my own pendrive with fies to my Arch. Thanks!

Offline

#16 2009-08-18 01:37:14

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Mount PenDrive Using Command-Line

Perhaps, after reading the posts again, you need to perform the following:

cd /mnt
mkdir  /mnt/pen
mount -t (file system) /dev/sdb1 /mnt/pen

The pen drive will be mounted in /mnt/pen.  EDIT: cd to /mnt and open /pen.

Whatever filesystem is installed in the pen drive has to be entered following the -t.....

Last edited by lilsirecho (2009-08-18 03:22:16)


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

Board footer

Powered by FluxBB