DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 30th June 2011
sepuku's Avatar
sepuku sepuku is offline
Real Name: Vizard Sepuku
Package Pilot
 
Join Date: Jun 2011
Location: Athens & Chania,Greece
Posts: 143
Default Is there a guide to mounting external drives

Hello there people i'm brand new to openbsd and i'm trying to mount my external drive!I tried the mount manual but i a cannot make it!Is there a step by step guide?

Sorry for the noob question but i come straight from ubuntu so i need some guidance!

Thank you in advance!
Reply With Quote
  #2   (View Single Post)  
Old 30th June 2011
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,128
Default

See HOWTO: mounting an USB device as normal non-root user in OpenBSD
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 1st July 2011
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by sepuku View Post
...i'm trying to mount my external drive!I
In addition to J65nko's article, you should familiarize yourself with Section 14.17 of the FAQ. The important (abbreviated) steps are to:
  1. Identify the device node used by the kernel to identify your attached device. This can be found in the output of dmesg(8).
  2. Identify what partition (if the external drive is already initialized) the kernel is using to name the external drive through disklabel(8). By default, foreign filesystems will get a partition letter of "i" or higher (because "i" is mid-way between "a" & "p"), but don't blindly assume "i" is the letter of the device. The definitive test is to look at the output of disklabel(8).
  3. Mount the device according to the information found in the mount(8) manpage.
To unmount, look at umount(8).
Reply With Quote
  #4   (View Single Post)  
Old 1st July 2011
sepuku's Avatar
sepuku sepuku is offline
Real Name: Vizard Sepuku
Package Pilot
 
Join Date: Jun 2011
Location: Athens & Chania,Greece
Posts: 143
Default

Thank you very much for your replies people;
after using dmesg and disklabel i found that my external drive is "sd0i" and is a ntfs filesystem.

After some failed attempts i figured(and please correct me if i'm wrong) that i must use "mount_ntfs" not "mount".

So when i give "sudo mount_ntfs /dev/sd0i /home/sepuku/usb" why do i get an "invalid argument" error?


edit: Also the mount_ntfs man says that "it's not currently possible to create or remove files on NTFS filesystems."Is there a way to change the filesystem type so i can read and write without losing my data? :/

Last edited by sepuku; 1st July 2011 at 10:12 AM.
Reply With Quote
  #5   (View Single Post)  
Old 1st July 2011
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by sepuku View Post
After some failed attempts i figured(and please correct me if i'm wrong) that i must use "mount_ntfs" not "mount".
Alternately, look at the -t switch in mount(8).
Quote:
So when i give "sudo mount_ntfs /dev/sd0i /home/sepuku/usb" why do i get an "invalid argument" error?
You have not provided which version of OpenBSD you are running, however, you should familiarize yourself with the information found in Section 14.17 of the FAQ. NTFS support is not available by default in the kernel, so you will need to compile a custom kernel per Section 5.7. Note that support of NTFS is limited to read-only. Writing to NTFS has always been problematic (& not recommended), & writing in the upcoming 5.0 release, is disabled altogether.

Reading NTFS is okay; just don't write to NTFS.
Reply With Quote
  #6   (View Single Post)  
Old 1st July 2011
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by sepuku View Post
Is there a way to change the filesystem type so i can read and write without losing my data? :/
Reading & writing MS-DOS filesystems is fine, however, this would mean that you would have to save (back up) your data elsewhere & reformat your drive in Windows as MS-DOS first.
Reply With Quote
  #7   (View Single Post)  
Old 1st July 2011
sepuku's Avatar
sepuku sepuku is offline
Real Name: Vizard Sepuku
Package Pilot
 
Join Date: Jun 2011
Location: Athens & Chania,Greece
Posts: 143
Default

Hello there ocicat and thanks for answering!I have the 4.9 version!The -t switch did work for me and thank you very much for your help!Althouth dmesg,disklabel returned that i have a ntfs filesystem,i managed to mount using "mount -t msdos /dev/sdoi /home/sepuku/usb"

Does this mean that my external drive is msdos?I thought that msdos and ntfs was not the same?

Last edited by sepuku; 1st July 2011 at 01:28 PM.
Reply With Quote
  #8   (View Single Post)  
Old 1st July 2011
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by sepuku View Post
Does this mean that my external drive is msdos?I thought that msdos and ntfs was the same?
The definitive answer can be seen in the output of disklabel(8). What is the filesystem type shown for partition "i"?

NTFS & MS-DOS are two completely different filesystems, however, it sounds like you have a flash drive which are frequently formatted as MS-DOS. If this indeed is the case, then you will be able to successfully read & write to it.

Note that I am simply trying to guess given very limited information. For a precise answer, post the output of disklabel(8).
Reply With Quote
  #9   (View Single Post)  
Old 1st July 2011
sepuku's Avatar
sepuku sepuku is offline
Real Name: Vizard Sepuku
Package Pilot
 
Join Date: Jun 2011
Location: Athens & Chania,Greece
Posts: 143
Default

The output of "disklabel sd0i" is ntfs but to be more sure this is it:

"i: 3907024002 63 NTFS"


i'm not pasting all the output 'cause i'm not able to copy-paste text from xterm.If you want adddition information please let me know.And once again thank you for your patience!!!!
Reply With Quote
Old 1st July 2011
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by sepuku View Post
The output of "disklabel sd0i" is ntfs...
Repeating myself, NTFS partitions will only be able to read from, not written to. Please study the FAQ references posted earlier if you wish to pursue read-only mounting of an NTFS partition.

If your goal is to share data (read & write) between Windows & OpenBSD with this external drive, reformatting it as MS-DOS may be your only option.
Reply With Quote
Old 1st July 2011
sepuku's Avatar
sepuku sepuku is offline
Real Name: Vizard Sepuku
Package Pilot
 
Join Date: Jun 2011
Location: Athens & Chania,Greece
Posts: 143
Default

OK got it.But i think i did not put it right;

I don't want to share my files with windows machine;

I just want to create,copy downloaded files,delete files etc. to my extrernal drive.And any kind of manipulation on my files.Is this safe on ntfs?That's what i can't figure!

I already started reading the FAQ but not everything is clear to me even after reading so thats why i'm asking!

Thank you again for your patience and your time
Reply With Quote
Old 1st July 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quote:
Originally Posted by sepuku View Post
I don't want to share my files with windows machine
IF (and that's a big IF) ... you have a flash drive which you will not be using on MS Windows platforms, then you can format for native use with OpenBSD:
  1. Use fdisk(8) to reinitialize the MBR, assigning a single MBR partition to OpenBSD.

    # fdisk -i sd0 (note that's a "zero", a number, and not an "oh", a letter)
  2. Use disklabel(8) to create a single OpenBSD partition within the MBR partition. As in this example, the "a" partition.

    # disklabel -E sd0
    a a
    [press Enter to all questions, taking the defaults]
    w
    q
  3. Format the partition.

    # newfs sd0a
  4. Mount whenever needed. For automatically mounting, take a look at hotplugd(8), or perhaps amd(8). This manual mount example assumes that /dev/sd0a is associated with /home/sepuku/usb in your fstab(5).

    $ grep sd0a /etc/fstab
    /dev/sd0a /home/sepuku/usb ffs rw,noauto 0 0
    $ pwd
    /home/sepuku
    # mount usb
    # ls usb
    .....

Last edited by jggimi; 1st July 2011 at 02:25 PM. Reason: clarification, added example
Reply With Quote
Old 1st July 2011
sepuku's Avatar
sepuku sepuku is offline
Real Name: Vizard Sepuku
Package Pilot
 
Join Date: Jun 2011
Location: Athens & Chania,Greece
Posts: 143
Default

OK got it!Thank you everyone for your answers!You really helped me!
Reply With Quote
Old 1st July 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Maybe so. But if you are following my "how to", please re-read it. I just revised it, to include some missing things (like formatting the partition).
Reply With Quote
Old 1st July 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Two more things, just for your education:
Quote:
I just want to create,copy downloaded files,delete files etc. to my extrernal drive.And any kind of manipulation on my files.Is this safe on ntfs?That's what i can't figure!
No, it is not safe. Data loss should be expected. This is OpenBSD, where NTFS has been "experimental" since its inception in 2003, and read/only access is all that ever worked. Until 4.9-release, NTFS mounting required a custom kernel, even read/only.

From your description of your situation -- the MBR partition type is NTFS, but it mounts with -t msdos -- it appears your MBR is marked as NTFS, but the underlying filesystem is not NTFS, instead, it is one of the FAT MS-DOS formats.

FAT (FAT12, FAT16, FAT32, etc.) is ubiquitous. It has no security, is very simple, and is the de facto format used by all sorts of devices, such as USB sticks (as shipped by the factory), and storage devices in digital cameras, phones, etc.

NTFS is Microsoft's native filesystem for NT-based Windows systems -- Windows NT and all its antecedents, such as XP, Vista, 2003 Server.
Reply With Quote
Old 1st July 2011
sepuku's Avatar
sepuku sepuku is offline
Real Name: Vizard Sepuku
Package Pilot
 
Join Date: Jun 2011
Location: Athens & Chania,Greece
Posts: 143
Default

OK thank you once again for your help!I think i'll just have to back up my files and reformat it is msdos cause your big IF gave me a lot of thoughts.maybe i'll never need to share my files to windows machine but just the idea not being able to do it is not that cool!

I'll keep in mind what you said about data loss!
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting NTFS external hard disk. bsdnewbie999 OpenBSD General 16 4th September 2010 01:59 PM
mounting external XFS HDD rativid OpenBSD General 5 3rd September 2010 02:31 PM
errors re-mounting external drive amorphousone OpenBSD General 3 12th March 2010 05:34 PM
Automounting drives jwhal OpenBSD General 4 12th June 2008 05:00 PM
Mounting External harddisk rex FreeBSD General 1 3rd June 2008 09:34 PM


All times are GMT. The time now is 05:22 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick