177eb Add external SATA drive without reboot. - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > Peripheral Hardware

Peripheral Hardware Stuff that plugs in via USB, FireWire, eSATA, PS/2, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old June 22nd, 2009, 14:44
woodson2 woodson2 is offline
Junior Member
 
Join Date: Jun 2009
Location: Connecticut, U.S
Posts: 35
Thanks: 6
Thanked 0 Times in 0 Posts
Default Add external SATA drive without reboot.

Running FreeBSD 7.2

I have a external hot swappable hard drive enclosure that connects via a PCI-e SATA card. BSD sees the drive when I reboot but I need to be able to swap a drive out and create a new filesystem without rebooting...So after some research I've come across the following utilities that I think can get me there.....Problem is I need help sorting this out as the man page for camcontrol and atacontrol warn of disk corruption and data loss if you're not careful.....This is a blank disk so I'm not worried about the new drive just want to make sure I don't screw the OS drive...Thanks

camcontrol
atacontrol
kldload


After removing the old device I see this in messages

Code:
Jun 22 09:16:47 BSD kernel: ata3: reset timeout - no device found
OK so I tried

Code:
atacontrol reinit ata3         
Master:      no device present
Slave:       no device present
AND

Code:
atacontrol attach ata3
atacontrol: ioctl(IOCATAATTACH): File exists

Last edited by DutchDaemon; June 22nd, 2009 at 15:22. Reason: [code] added
Reply With Quote
  #2  
Old June 22nd, 2009, 14:57
woodson2 woodson2 is offline
Junior Member
 
Join Date: Jun 2009
Location: Connecticut, U.S
Posts: 35
Thanks: 6
Thanked 0 Times in 0 Posts
Default

OK...So I think I might be in business after running

Code:
atacontrol detach ata3
Then

Code:
atacontrol attach ata3
Master:  ad6 <WDC WD2500AAJS-00L7A0/01.03E01> SATA revision 2.x
Slave:       no device present

Last edited by DutchDaemon; June 22nd, 2009 at 15:22. Reason: [code] added
Reply With Quote
  #3  
Old June 22nd, 2009, 15:14
woodson2 woodson2 is offline
Junior Member
 
Join Date: Jun 2009
Location: Connecticut, U.S
Posts: 35
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Ok...Looks good...I've created a new filesystem and mounted it...I have a minor concern though.

The disk is a 250GB SATA drive.

When I create an ext3 filesystem in Linux on the same drive I get about 218GB of disk space..

When I create the filesystem on FreeBSD I get about 208GB of usable space..

I created the filesystem using sysinstall so the newfs command was run automatically for me.....I'm wondering If I created the slice and filesystem from the command line would I be able to get more usable space using the -m switch option in newfs?..Or is this just a difference in space requirements for UFS2 and ext3?
Reply With Quote
  #4  
Old June 22nd, 2009, 15:46
Vye Vye is offline
Junior Member
 
Join Date: Nov 2008
Posts: 15
Thanks: 0
Thanked 3 Times in 3 Posts
Default

If you run mount you can see if you have soft-updates enabled on your UFS file system.

example:
Code:
/dev/da1s1d on /mnt/storage (ufs, local, soft-updates)
soft-updates requires approximately 8% of your usable space.
Reply With Quote
The Following User Says Thank You to Vye For This Useful Post:
woodson2 (June 22nd, 2009)
  #5  
Old June 22nd, 2009, 15:51
woodson2 woodson2 is offline
Junior Member
 
Join Date: Jun 2009
Location: Connecticut, U.S
Posts: 35
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Vye View Post
If you run mount you can see if you have soft-updates enabled on your UFS file system.

example:
Code:
/dev/da1s1d on /mnt/storage (ufs, local, soft-updates)
soft-updates requires approximately 8% of your usable space.

Ahh..Thanks

Can you point me in the right direction so I can read about soft-updates and what it does?
Reply With Quote
  #6  
Old June 22nd, 2009, 15:56
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,828
Thanks: 30
Thanked 1,887 Times in 1,332 Posts
Default

http://www.usenix.org/publications/l.../mckusick.html

BTW, i don't think softupdates hijacks 8% of your disk, or you couldn't turn softupdates on or off whenever you like. Filesystems themselves do reserve 8-10% of disk space for the root user to enable it to still perform necessary taks on a disk that is full to regular users. The numbers you see (~15%) do look very high to me, but simply using -m to force it down may have adverse effects, see tunefs(8).
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Adminstrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---

Last edited by DutchDaemon; June 22nd, 2009 at 16:04.
Reply With Quote
The Following User Says Thank You to DutchDaemon For This Useful Post:
woodson2 (June 22nd, 2009)
  #7  
Old June 22nd, 2009, 16:00
woodson2 woodson2 is offline
Junior Member
 
Join Date: Jun 2009
Location: Connecticut, U.S
Posts: 35
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Thanks..
Reply With Quote
  #8  
Old June 22nd, 2009, 16:14
woodson2 woodson2 is offline
Junior Member
 
Join Date: Jun 2009
Location: Connecticut, U.S
Posts: 35
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by DutchDaemon View Post
http://www.usenix.org/publications/l.../mckusick.html

BTW, i don't think softupdates hijacks 8% of your disk, or you couldn't turn softupdates on or off whenever you like. Filesystems themselves do reserve 8-10% of disk space for the root user to enable it to still perform necessary taks on a disk that is full to regular users. The numbers you see (~15%) do look very high to me, but simply using -m to force it down may have adverse effects, see tunefs(8).
tunefs -n disable /dev/ad6s1d
tunefs: soft updates cleared
tunefs: /dev/ad6s1d: failed to write superblock

So when I run mount I still see soft-update enabled
/dev/ad6s1d on /BACKUPS (ufs, local, soft-updates)

I think I'm going to keep soft-update on but I just wanted to the see the affects of turning it off...Any ideas why it's failing to disable...Do I need to umount the filesystem and remount?
Reply With Quote
  #9  
Old June 22nd, 2009, 16:22
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,828
Thanks: 30
Thanked 1,887 Times in 1,332 Posts
Default

Don't disable softupdates, they're way too much of a performance boost to disable. If you do want to disable it, you need to unmount before using tunefs. Read the 'description' in tunefs(8) ...
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Adminstrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
  #10  
Old June 22nd, 2009, 16:27
woodson2 woodson2 is offline
Junior Member
 
Join Date: Jun 2009
Location: Connecticut, U.S
Posts: 35
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by DutchDaemon View Post
Don't disable softupdates, they're way too much of a performance boost to disable. If you do want to disable it, you need to unmount before using tunefs. Read the 'description' in tunefs(8) ...
Got it..Thanks again..I think I'll just leave the filesystem as is..
Reply With Quote
  #11  
Old June 27th, 2009, 03:09
aragon aragon is offline
Giant Locked
 
Join Date: Nov 2008
Location: Cape Town, South Africa
Posts: 2,031
Thanks: 68
Thanked 253 Times in 203 Posts
Default

Quote:
Originally Posted by DutchDaemon View Post
Filesystems themselves do reserve 8-10% of disk space for the root user to enable it to still perform necessary taks on a disk that is full to regular users.
I think the reserve is actually to help prevent fragmentation from occurring.
Reply With Quote
  #12  
Old June 27th, 2009, 07:49
Beastie Beastie is offline
Senior Member
 
Join Date: Mar 2009
Location: /dev/earth0
Posts: 1,701
Thanks: 0
Thanked 301 Times in 245 Posts
Default

Quote:
Originally Posted by aragon View Post
I think the reserve is actually to help prevent fragmentation from occurring.
No, officially it's as DutchDaemon said.

Fragmentation always occurs on any file system (the fragmentation rate for each of your UFS partitions can be seen when starting up the machine).
What differs is the ability of the OS's block allocation algorithms to deal with it efficiently (or not).

But it's true that the fragmentation problem increases as the last blocks and frags get allocated because it inhibits the proper work of the above mentioned algorithms.
__________________
May the source be with you!
Reply With Quote
  #13  
Old June 27th, 2009, 15:22
aragon aragon is offline
Giant Locked
 
Join Date: Nov 2008
Location: Cape Town, South Africa
Posts: 2,031
Thanks: 68
Thanked 253 Times in 203 Posts
Default

Quote:
Originally Posted by Beastie View Post
No, officially it's as DutchDaemon said.

But it's true that the fragmentation problem increases as the last blocks and frags get allocated because it inhibits the proper work of the above mentioned algorithms.
The way I read DutchDaemon's explanation is to say that the reserve is there as a builtin soft quota, allowing presumably important root processes to still write to a filesystem by preventing users from writing to it. To be more specific, it is there to prevent users from inhibiting a filesystem's ability to avoid fragmentation and maintain good write performance. tunefs(8) agrees with me:

Code:
-m minfree
     Specify the percentage of space held back from normal users; the
     minimum free space threshold.  The default value used is 8%.
     Note that lowering the threshold can adversely affect perfor-
     mance:

     o   Settings of 5% and less force space optimization to always be
         used which will greatly increase the overhead for file
         writes.

     o   The file system's ability to avoid fragmentation will be
         reduced when the total free space, including the reserve,
         drops below 15%.  As free space approaches zero, throughput
         can degrade by up to a factor of three over the performance
         obtained at a 10% threshold.
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
Partitioning an external hard drive WD MyBook Ico Peripheral Hardware 8 June 10th, 2009 15:14
Loading external drive w/ USB2? Clay Peripheral Hardware 3 May 11th, 2009 17:42
external temperature measurement kit perhansen Porting New Software 6 May 2nd, 2009 12:27
Unable to mount ext2 filesystem on USB SATA drive with Live CD donallen General 4 January 24th, 2009 17:12
Mounting SATA drive (NTFS) mesee General 9 December 13th, 2008 07:59


All times are GMT +1. The time now is 00:53.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0