LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to mount usb thumb drive second partition (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-mount-usb-thumb-drive-second-partition-608129/)

gsuresh_01 12-20-2007 10:04 AM

How to mount usb thumb drive second partition
 
Hi,

Iam facing a problem with USB thumbdrive. I wanted to know how do i access the second partition of my USB 4GB pen drive.

If i have a single continuous partition in the usb stick, i can mount using

"mount /dev/sda /mnt/jet"
where sda is the detected device name for my usb stick.

as far as i have single partitioned usb stick this works ok.

when i formatted my usb stick into two partitions of size 2GB each,
using windows format tool. I have now two partitions on the stick.

now when i connect the usb stick to linux pc and mount it i can only
view the first partition of 2GB. I donot know how to mount or access the second partition of the usb stick.

Hope i am clear what i want to convey!


Any help is appreciated.

Suresh Guduru

saikee 12-20-2007 11:29 AM

mkdir /mnt/sda2
mount /dev/sda2 /mnt/sda2

The first command to to create a mounting point. You can make a directory like /mmt/mount_here_please and mount any device on it. I use /mnt/sda2 because it tells us what it is from. You always mount a device on a point in the filing system tree, as though hanging a decoration on a christmas tree.

You mount a drive because you want to read or write files inside, right? This means a drive can only be mounted if it has a filing system or formatted previously.

vstoykov 12-20-2007 11:40 AM

First partition of your USB drive is /dev/sda1. Second partition maybe is /dev/sda5 (or /dev/sda2?).

Append this to /etc/fstab:
Code:

/dev/sda1 /media/usb_sda1 vfat auto,users,noatime,async,iocharset=utf8,codepage=855,fmask=111,dmask=000 0 0
/dev/sda5 /media/usb_sda5 vfat auto,users,noatime,async,iocharset=utf8,codepage=855,fmask=111,dmask=000 0 0

make directory and mount:
Code:

# mkdir /media/usb_sda1
# mkdir /media/usb_sda5
# mount /media/usb_sda1
# mount /media/usb_sda5

Options „noatime“ and „async“ will extend memory life.

Before removing memory you must type:
Code:

# umount /media/usb_sda1
# umount /media/usb_sda5

If you prefer not edit /etc/fstab:
Code:

# mount /dev/sda1 /media/usb_sda1 -o noatime,async
# mount /dev/sda5 /media/usb_sda5 -o noatime,async



All times are GMT -5. The time now is 04:51 PM.