Showing posts with label ntfs. Show all posts
Showing posts with label ntfs. Show all posts

Sunday, August 18, 2013

PC-BSD - Taking the Plunge

v 0.2
18Aug 13

I've been thinking that it is time for a new computer - after all, the machine that I've been using is 6 years old.  The server setup I'd done has been chugging along nicely and the interesting thing is that it is as fast as my Windows desktop.  After doing a bit of fantasy building, I thought "why not just use the server machine - add a couple of things and make it really good before moving on and getting what I really want?"

And then my Windows desktop started cutting out - I figured the CPU was overheating, so I specially cleaned it - which fixed things for a while - but I had this sense of unease.  What really bothered me was the software raid I'd used with Windows .. tight licencing with Microsoft made me think that if this thing fell over, then I'd have a "bother of a time" getting it sorted, so I started dragging stuff off it.

I had about half my data off, when a strange electrical smell started - then "BANG!!!" and a flash from the power supply.  And the house got dark.  Alright, I thought, at least I know what the problem is now ....  A visit to my local friendly computer shop and with a new power supply my machine was now as good as new again.  I'd gone past the tipping point though, and I wanted to move on.  Yes, I did need Windows for a couple of things, but I wanted out.

My "Home Server" .. it was inexpensive to put together, having an i3 CPU, an Nvidia GTS450 graphics card I had lying around (to make PC-BSD work), 8 gig memory and a Western Digital 2 TB "Green" hard disk.  I had (so I thought) another of these disks lying around, and I went out to purchase a third.  I had finished playing with the machine with PC-BSD and thought this was an opportunity to re-do things the way I wanted, using things I'd learned.

The Plan

  • Re-install the latest PC-BSD rolling release.
  • Use three 2tb disks in a ZFS Raid-1z configuration
  • Use Jails and Virtualbox to run servers in the background

PC-BSD - the Really Cool Stuff

Whilst I remain a committed fan of Debian (Wheezy is just so cool), PC-BSD has too many great things going for it not to be used.  A few months ago when I was looking at it, there were two "killer problems" .. it would not immediately recognise USB memory sticks, and the Flash video was not an Adobe "priority".  Well, the USB problem has been solved, and I figured that if I really needed Flash video, then a Virtualbox VM would do it for me.

What has me really excited about PC-BSD is the user-friendly implementation of the Zetabyte File System (ZFS).  

The installation routine allows a simple implementation of many "multiple disk" file systems in Raidz configuration.  You can have a simple "mirror" configuration with two disks, moving up from there.  I have a three disk configuration whereby the failure of one disk allows me to replace it and then re-build the configuration without loss of data.

But wait! There's more!

Using the PC-BSD Control Panel you can specify system snapshots to allow you to roll back in the GRUB menu to a previously good system (if an upgrade wasn't all you hoped for).  This system snapshot does NOT affect your own files - it is purposefully restricted to system files.

Servers running in a jail can have snapshots taken automatically, say, every hour so that if all hell breaks loose, you can just roll back to the last good server.  Say someone attacks your  server in its jail .. and trashes files and installs malware.  Roll back and the malware is gone and the files are back.  Magic!

Steak knives!

The supplied backup program .... the PBI installation system for additional programs ....

My Experience

Drives

First, I discovered that I did not have three WD Green drives, but two with a Seagate one.  Ah .. it will be ok.  Ultimately I had to shoehorn the Seagate drive in because of a lack of mounting holes .. but figured ... "it will be ok" .... well, it wasn't BUT that showed how great ZFS is .... and I was able to fix everything. 

So, what was the problem with the Seagate drive? .. well I just laid it out on top of one of the other two drives .. giving the drive circuitry no chance of getting any cooling air.  The obvious happened and the drive fell out of the ZFS zpool.  Bother.  BUT .. the zpool kept working!

Next day when I rebooted, everything worked! The zpool resilvered .. aha ... sounds like a case for duct-tape! ... Yes, I have duct-taped the Seagate drive to give it cooling .. but it works and I've had no further problems.

USB

The USB problem has been largely fixed.  So long as your USB Memory stick has 16 gig or less, then no problems for copying TO the computer.  PCBSD does not recognise  USB memory sticks greater than 16 gig.

Where the problem comes in is with copying files FROM the computer TO the memory stick.  What happens is that the system complains that it is unable to re-set the permissions to yours and in the case I was faced with ... that was 700 info windows to click through.  !Fun.

NTFS .. no probs .. though I found that it was very difficult to unmount an external drive.

Overall?

I'm still here.





Later.


Thursday, June 16, 2011

Debian Squeeze for My Parents - Config Issues - Pt3

v 0.3

Grub2

Once I'd finished installing Squeeze on my Parent's Computer, I had a dual-boot machine that booted by default into Debian. Initial installation failed to include the Windows XP selection on the bootloader menu, however I wanted it to boot into Windows as the default operating system.

Debian uses the Grub2 bootloader.  Of course, a Windows selection SHOULD appear but didn't.  Instead, the default display had two selection lines, the first being for the normal Debian Squeeze kernel, and the second for a Rescue Mode boot into Debian.  How to organise Grub the way we want it?

The Debian Wiki, of course!  First search the wiki for the bootloader Grub2.  The first challenge we have is to have it recognise the Windows installation.  The clue is in the wiki.  Open a root terminal and:

update-grub

There is now a third line on the Grub menu, pointing to the Windows XP partition.

Next, we are told "To configure grub "v2", you should edit /etc/default/grub, then run update-grub."  Opening this file (as root) shows us the first two uncommented lines as:

GRUB_DEFAULT=0
GRUB_TIMEOUT=5

The first line tells us that the default boot entry is on Line 0 (zero), the top one and that there will be a 5 second delay before the boot continues.  I changed the entries to:

GRUB_DEFAULT=2
GRUB_TIMEOUT=20

I now had the default boot line as line 2 (the third line down) and the default timeout at 20 seconds (to give adequate time to change the selection - don't forget pressing "Enter" will continue the boot process straight away).

update-grub

All fixed!


Tip - Edit file as Root

Open a root terminal window, change to the directory where the file you want to edit is located and:

gedit

gedit opens as root and can edit and save the file as root.

Tip - Open Nautilus File Manager as Root

As above but:

nautilus

and the Gnome file manager starts so you can copy files as root.

Adobe Flash

Whilst there is a package that purports to load Adobe Flash, it didn't work for me.  HowtoForge tells you how to disable the Gnash Flash plugin in "Iceweasel/Firefox", which is a good idea.

To enable flash the manual way, download the tarball for linux from Adobe and extract as root the "libflashplayer.so" file (I think it is called).  Copy it to " /usr/lib/mozilla/plugins " and it will show up nicely in Iceweasel and play Youtube videos for you.

ntfs

Use synaptic to ensure the " ntfs-3g " package is installed.

Assuming Windows is on /dev/hda1, create a directory under either /mnt or /media, say /mnt/windows .

Edit fstab (save the current one as a backup) and add a line such as this on the last line.


/dev/hda1     /mnt/windows     ntfs-3g     defaults

That should do it - you can now read and write to the windows partition.


That's it for the moment, however I still had to configure the router for SSH access - next part.


Later ......

Sunday, January 9, 2011

Server - eeepc - Debian

v 0.2.3

I know, I'm predictable.  I loaded Debian Squeeze onto the EeePc.  I've had it on there for a while, in fact, having eliminated the original Xandros install.  Two valuable resources for loading Debian onto the EeePc are:
The eeepc does not have a DVD drive, so when I originally purchased it, I had also purchased an external DVD drive.  It has proved useful for a number of tasks over the years.  I first prepared the SSD using my gparted program on bootable CD.  The eeepc 701 has 3 partitions on its SSD.  I left the small one alone and simply combined the 2.5  and 1.5 gig partitions into one.  I did not use a Swap partition.

I installed Debian Squeeze using the Xfce install CD.  I know that perhaps a GUI was not needed, but at that stage I was after a lightweight desktop, and after deciding to keep the machine for a server, just left it there.  It all installed fine using the standard installer, the only addition being to install the Gnome Network Manager, and make the config file correction noted previously in the Debian Wiki.  The WiFi connection to my router works fine.

Xfce recognises the external drive however it drops off occasionally.  In any case, if this is to be a server, then mounting the drive in the fstab file is a necessity for reliability.

Next, sort a static IP within the network.  All the tutorials I found simply configured the wifi entry for a specific IP address.  I took a different route, making a note of the mac address of the wifi card using " ifconfig " and writing down the hardware address.  Then I went to the network router and assigned a specific IP address to that mac hardware card.

Now to be able to access the server from another machine on the network.  The simplest and most straightforward way is to install a secure shell server on the machine, and then log in from another one with the ssh client.  For windows, use putty, and for mac or linux, just use ssh.  Using aptitude on the eeepc Debian install:

aptitude install openssh-server openssh-client

Once the installation is complete, the ssh-server is running as a service on your machine.  There are plenty of tutorials about how to connect with ssh, so I won't repeat them here, needless to say, I can connect from my mac by just entering:

ssh username@(network-ip-address)

If you have modified your hosts file, then you can substitute the hostname for the IP address.  Enter your password if you haven't set up authentication and you can log on as an appropriate user.  Yes, you do need to set up your user account on the server first, since all you are doing is logging on to it as a user, but from over the network.

So there we are, we now have our eeepc server up and running on a static network IP and a SSH server running.  Not much, but it is getting there.


Later .....

Update - Manipulate NTFS file system:

In my case, the drive I have for my server is an external 2.5 inch drive.  Since they all come formatted to ntfs, I have two choices, accept ntfs or reformat.  I shall accept ntfs, so we need to install the ntfs driver:

aptitude install ntfs-3g

Then we need to make a mount point in the .. er .. /mnt directory ..

mkdir /mnt/external

Now we need to edit the fstab file

In fstab, add a line (obviously similar to this - you will have to check your disk drive device)

/dev/sdb1  /mnt/external   ntfs-3g   defaults   0  0

Done!

Tuesday, December 8, 2009

Snow Leopard and NTFS

This episode came out of me recovering data from my Daughter's Linux installation.  I'd been thinking of getting her an iMac for Christmas, and damn if her Lenny machine didn't agree.  First, it wouldn't boot, and then there were multiple disk errors .... mayday!

Because of the limitations of the failing file system, I copied the data onto an ext2 formatted disk.  I copied the data onto a storage drive on another system and then set about finding how I could transfer the data to a Snow Leopard Mac.

To cut a long story short, I found that an external ntfs drive had to be formatted from a Microsoft system to be recognised by the Mac.  Linux has a number of ntfs tools (easily installed in Debian) that enable an ntfs drive to be writeable by Linux.

From there, it is easy ..... write the data to the external drive and then copy it to the Mac.  Snow Leopard has native ntfs READ capability.  (It has native write capability, but this is hidden).

Some places to look ....

http://www.ntfsmounter.com/
http://www.tuxera.com/community/release-history/
http://forums.macrumors.com/showthread.php?t=785376
http://macntfs-3g.blogspot.com/

Update 29Dec 2010

I downloaded the ntfs-3g driver from here:
http://sourceforge.net/projects/catacombae/files/NTFS-3G%20for%20Mac%20OS%20X

Installed fine.

:)