LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-14-2008, 08:58 PM   #1
gordon__1
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Rep: Reputation: 0
Unhappy Terminal commands: how to create a directory in ext2 partition on flash drive


ISSUE RESOLVED-NO FURTHER HELP NEEDED

I am attempting to setup a bootable Backtrack USB flash drive following their instructions. I need to create a directory "changes" on the ext2 partition i've set up on my flash drive. The device is sdb
I have 2 partitions as required: /dev/sdb1 Fat16 and /dev/sdb2 ext2
I am totally stuck as i don't know the command to create a directory in /dev/sdb2. I've tried all sorts of things, no luck. I can't even figure out how to change the prompt from root, or home/system or whatever, to /dev/sdb2. Gparted doesn't allow this either.
I know i'm off track here, and would really appreciate some insight. It's not for a lack of trying...

Last edited by gordon__1; 01-14-2008 at 10:57 PM. Reason: mark resolved
 
Old 01-14-2008, 09:14 PM   #2
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
well you need to format the partition with an ext2 file system if you have not yet done so. just creating a partition does not make it usable, it must still be formatted.

mke2fs /dev/sdb2

then you need to mount the partition, in order to mount the partition you need a directory to mount it to ..

mkdir /media/usbext2

then mount ext2 partition on the USB drive to the directory you just created

mount /dev/sdb2 /media/usbext2

Change into the ext2 partition on the USB device..

cd /media/usbext2

Verify you are in the /media/usbext2 directory..

pwd

Create your directory called changes

mkdir changes

Last edited by farslayer; 01-14-2008 at 09:16 PM.
 
Old 01-14-2008, 09:14 PM   #3
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
you need to mount it first
su
type password here
mkdir /mnt/flashdrive
mount -t ext2 /dev/sdb1 /mnt/flashdrive
then cd to the directory
cd /mnt/flashdrive
then make the directory
mkdir changes
 
Old 01-14-2008, 09:18 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
EDIT: Never mind - there's plenty of quicker typing going on...
 
Old 01-14-2008, 10:52 PM   #5
gordon__1
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks for the replies, i did the following steps that were given and then got an error:

mke2fs /dev/sdb2

then you need to mount the partition, in order to mount the partition you need a directory to mount it to ..

mkdir /media/usbext2

then mount ext2 partition on the USB drive to the directory you just created

mount /dev/sdb2 /media/usbext2mke2fs /dev/sdb2


After this command I got the following error: can't find /dev/sdb2/media/usbext2 in /etc/fstab or /etc/mtab
 
Old 01-14-2008, 10:56 PM   #6
gordon__1
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Wink

I got it! Thanks to both that gave the information, i used both sets of details and got it done. No further help required on this. Thanks again.
 
Old 01-14-2008, 10:57 PM   #7
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
Quote:
Originally Posted by gordon__1 View Post
Thanks for the replies, i did the following steps that were given and then got an error:

mke2fs /dev/sdb2

then you need to mount the partition, in order to mount the partition you need a directory to mount it to ..

mkdir /media/usbext2

then mount ext2 partition on the USB drive to the directory you just created

mount /dev/sdb2 /media/usbext2mke2fs /dev/sdb2


After this command I got the following error: can't find /dev/sdb2/media/usbext2 in /etc/fstab or /etc/mtab
the correct syntax for the command is mount -t ext2 /dev/sdb1 /media/usbbext2
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot create 1MB ext2 partition on HDD fitzov Linux - General 5 05-18-2007 05:04 PM
usb flash drive / ext2 oddness slimjim Linux - Hardware 3 01-03-2007 05:20 PM
How to copy files from an entire directory tree using terminal commands??? lusius188 Linux - General 3 04-10-2006 11:23 AM
delete and create a partition from a terminal gjo Linux - General 8 06-14-2005 01:49 PM
Help to create a script to open a terminal and run commands in it. Brian1 Linux - Software 6 02-07-2005 06:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration