LinuxQuestions.org
Help answer threads with 0 replies.
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 05-02-2009, 01:02 PM   #1
cynicalpsycho
Member
 
Registered: Mar 2009
Location: America
Distribution: Debian/Arch
Posts: 134

Rep: Reputation: 16
fdisk / mount / format / help!


The Situation:
I'm trying to format a flashdrive so I can set up a certain linux distro (backtrack4beta) to boot from the drive with persistent changes.


The Method:
1. The method I've been using involves first formating the drive then making the 1st partition (the boot partition) be fat32 which will house the ISO and also making a 2nd partition which will house all of the changes.
2. Then I will use Unetbootin to install the my ISO.
3. Then I will make changes necessary in the syslinux.cfg file to enable persistent changes.


The Problem:
The problem is I've yet to make it past step 1 of the method. I've done this in the past but I can't seem to get it to work on this new USB flashdrive.

Here's what I've done:
I've went through the process with fdisk you know n, p, filled in all the right sizes and I got this as a result:
Code:
Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc2c310c6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         132     1060258+   b  W95 FAT32
/dev/sdb2             133       14593   116157982+  83  Linux
That's the way it should look... I think...

But the when I try to unplug and plug it back in, the flash doesn't seem to want to mount like it should. and I've tried using the mount command but this is all i get.
Code:
root@ubuntu:/home/cynicalpsycho# mount /mnt/sdb
mount: can't find /mnt/sdb in /etc/fstab or /etc/mtab
I get the same if I try mount sdb1 or sdb2

However when I boot up my other flashdrive that i've already installed backtrack to (using THIS method)... both of the partitions pop right up...

does anyone have any idea where my problem is here?

Last edited by cynicalpsycho; 05-02-2009 at 01:03 PM.
 
Old 05-02-2009, 01:34 PM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
The problem is that because you don't have fstab entries for your partitions, mount doesn't know where to mount them, or what filesystem types they have. So, you can specify these things on the command line, with e.g.

mount -t vfat /dev/sdb1 /mnt/tmp

which will mount /dev/sdb1 (with filesystem type vfat, i.e. FAT32) on /mnt/tmp. Read the man page for mount for more info about the available options.
 
Old 05-02-2009, 02:05 PM   #3
cynicalpsycho
Member
 
Registered: Mar 2009
Location: America
Distribution: Debian/Arch
Posts: 134

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by Nylex View Post
The problem is that because you don't have fstab entries for your partitions, mount doesn't know where to mount them, or what filesystem types they have. So, you can specify these things on the command line, with e.g.

mount -t vfat /dev/sdb1 /mnt/tmp

which will mount /dev/sdb1 (with filesystem type vfat, i.e. FAT32) on /mnt/tmp. Read the man page for mount for more info about the available options.
Code:
root@ubuntu:/mnt# mount -t vfat /dev/sdb1 /mnt/tmp
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
ahmm.... ?

And besides "you don't have fstab entries" that makes no since, because if that were the case, why am i able to load my other flash drives that use that same entry sdb (when plugged in first)?

Last edited by cynicalpsycho; 05-02-2009 at 02:08 PM.
 
Old 05-02-2009, 02:12 PM   #4
hurry_hui
Member
 
Registered: Oct 2008
Location: Near Jakarta
Distribution: Slackware, Arch, Slax, Porteus, Tiny Core, Slitaz
Posts: 355
Blog Entries: 1

Rep: Reputation: 51
If I am not mistaken, you create the 1-Gib boot partition with FAT32 on missing directory.

The problem perhaps you have not created (mkdir) /mnt/tmp. You can check it by 'ls /mnt/tmp'.
 
Old 05-02-2009, 02:30 PM   #5
cynicalpsycho
Member
 
Registered: Mar 2009
Location: America
Distribution: Debian/Arch
Posts: 134

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by hurry_hui View Post
If I am not mistaken, you create the 1-Gib boot partition with FAT32 on missing directory.

The problem perhaps you have not created (mkdir) /mnt/tmp. You can check it by 'ls /mnt/tmp'.
...
no... if that were the case I would have gotten the error i get in this example:

Code:
root@ubuntu:/home/cynicalpsycho# mount -t vfat /dev/sdb1 /mnt/dofus
mount: mount point /mnt/dofus does not exist
(which I did at first until I created the tmp file, then i got the other error...)

Last edited by cynicalpsycho; 05-02-2009 at 02:33 PM.
 
Old 05-02-2009, 02:42 PM   #6
valencequark
Member
 
Registered: Aug 2004
Location: greater dc metro area
Distribution: various, mostly fedora
Posts: 79

Rep: Reputation: 16
Quote:
Originally Posted by cynicalpsycho View Post
The Situation:
I'm trying to format a flashdrive so I can set up a certain linux distro (backtrack4beta) to boot from the drive with persistent changes.


The Method:
1. The method I've been using involves first formating the drive then making the 1st partition (the boot partition) be fat32 which will house the ISO and also making a 2nd partition which will house all of the changes.
2. Then I will use Unetbootin to install the my ISO.
3. Then I will make changes necessary in the syslinux.cfg file to enable persistent changes.


The Problem:
The problem is I've yet to make it past step 1 of the method. I've done this in the past but I can't seem to get it to work on this new USB flashdrive.

Here's what I've done:
I've went through the process with fdisk you know n, p, filled in all the right sizes and I got this as a result:
Code:
Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc2c310c6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         132     1060258+   b  W95 FAT32
/dev/sdb2             133       14593   116157982+  83  Linux
That's the way it should look... I think...

But the when I try to unplug and plug it back in, the flash doesn't seem to want to mount like it should. and I've tried using the mount command but this is all i get.
Code:
root@ubuntu:/home/cynicalpsycho# mount /mnt/sdb
mount: can't find /mnt/sdb in /etc/fstab or /etc/mtab
I get the same if I try mount sdb1 or sdb2

However when I boot up my other flashdrive that i've already installed backtrack to (using THIS method)... both of the partitions pop right up...

does anyone have any idea where my problem is here?
unless i am missing something, fdisk is just a partitioner. you still have to make filesystems on your partitions. (mke2fs, et cetera).

one you have filesystems then you should be able to mount.
 
Old 05-02-2009, 02:51 PM   #7
cynicalpsycho
Member
 
Registered: Mar 2009
Location: America
Distribution: Debian/Arch
Posts: 134

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by valencequark View Post
unless i am missing something, fdisk is just a partitioner. you still have to make filesystems on your partitions. (mke2fs, et cetera).

one you have filesystems then you should be able to mount.
That's not my understanding of fdisk.... when I was using fdisk, I specified the filesystems by using the "t" option. as you can see by the OP:
Code:
Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc2c310c6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         132     1060258+   b  W95 FAT32
/dev/sdb2             133       14593   116157982+  83  Linux
and upon further review of mke2fs, it only seems to be used to make additional ext2 filesystems.

Last edited by cynicalpsycho; 05-02-2009 at 03:02 PM.
 
Old 05-02-2009, 03:23 PM   #8
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
Both Nylex and valencequark are correct.

valencequark is correct in that you need to mkfs.vfat on your sdb1, and mke2fs on your sdb2 (mke2fs for ext2 or mkfs.ext3 for ext3).

fdisk simply manipulates the partition table, ie. says where each partition starts, ends, and what type it is. Then you need to format a filesystem on each partition (unless there is already one sitting there coincidentally from a prior use of the usb drive - but I would never rely on that).

Nylex is correct in that you need to specify type, device, and mountpoint if there is no matching entry in fstab.
But there needs to be a valid filesystem there that can be mounted. (If you have an automounter service running, it will mount filesystems for you, but if there are no valid filesystems on the device, it will take no action.)

Last edited by tommylovell; 05-02-2009 at 03:26 PM. Reason: added admonition
 
Old 05-02-2009, 03:31 PM   #9
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,970
Blog Entries: 1

Rep: Reputation: 208Reputation: 208Reputation: 208
Quote:
Originally Posted by cynicalpsycho View Post
That's not my understanding of fdisk.... when I was using fdisk, I specified the filesystems by using the "t" option.
Then your understanding of fdisk is incorrect.

Fdisk just sets up your partitions...the "t" option just "labels" the partition...it doesn't format it.

You still need to format...something like this...

Code:
root@host# mkfs.vfat /dev/sdb1
How 'bout you try it instead of telling everyone they're wrong?
 
Old 05-02-2009, 05:06 PM   #10
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285Reputation: 1285
I don't really like fdisk, use cfdisk if you have it, the layout is more intuitive.
 
Old 05-02-2009, 05:23 PM   #11
cynicalpsycho
Member
 
Registered: Mar 2009
Location: America
Distribution: Debian/Arch
Posts: 134

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by custangro View Post
Then your understanding of fdisk is incorrect.

Fdisk just sets up your partitions...the "t" option just "labels" the partition...it doesn't format it.

You still need to format...something like this...

Code:
root@host# mkfs.vfat /dev/sdb1
How 'bout you try it instead of telling everyone they're wrong?
fair enough, I'll post back w/ my results.
 
Old 05-02-2009, 05:56 PM   #12
cynicalpsycho
Member
 
Registered: Mar 2009
Location: America
Distribution: Debian/Arch
Posts: 134

Original Poster
Rep: Reputation: 16
quick question...
does anyone know if gparted would do the same thing as me using:mkfs.vfat /dev/sdb1?
 
Old 05-02-2009, 05:58 PM   #13
cynicalpsycho
Member
 
Registered: Mar 2009
Location: America
Distribution: Debian/Arch
Posts: 134

Original Poster
Rep: Reputation: 16
nvm it does, and thanks people for clarifying my misconceptions!
My apologies if I seemed assholish... it's just who i am :P
 
Old 05-02-2009, 06:17 PM   #14
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,970
Blog Entries: 1

Rep: Reputation: 208Reputation: 208Reputation: 208
Quote:
Originally Posted by cynicalpsycho View Post
nvm it does, and thanks people for clarifying my misconceptions!
My apologies if I seemed assholish... it's just who i am :P
No problem...Linux is a learning experience
 
  


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
fdisk command is trying to format my cdrom drive! justintime24 Linux - Newbie 14 03-27-2008 05:50 PM
Format partition as ext3, fdisk says FAT? ChesterHemmer Linux - General 7 07-09-2006 01:13 PM
can't format my hard drive with fdisk davidabauer Linux - Hardware 4 05-21-2006 11:18 PM
fdisk/format without floppy support 0S1R1S Linux - General 4 12-06-2005 06:40 PM
format and fdisk with RH 6.2 jonfa Linux - Software 1 06-04-2001 03:59 PM


All times are GMT -5. The time now is 01:07 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration