Friday, January 28, 2011

Free Name Server services reliability?

I'm starting a small web design shop. We does not have much money so we would like to keep our costs as low as possible.

All we need is a @ourcompany.com mail address and a few web pages to showcase our work and we are looking at Google Apps which gives enough functionality for us. However, to verify ownership of the domain to google apps, there are 2 possible ways:

  • Upload a file with special name to tell google that we have access.
  • Change a CNAME record to point to google.com to show that we do control the domain.

Both methods require a internet-facing machine with a fixed IP in which we have none.

So we are looking at free DNS services like zoneedit.com and such... which seems promising but we are concerned about security/reliability issues. So I thought I'd ask here first.

Do you recommends using a free DNS hosting and if so or if not, why?

  • DynDNS has been rock solid for me for years. I have had no reason to complain and I recommend it. Their documentation is excellent, and there are tons of clients there, both for Win32 and for unixy OSes. The way I read their Acceptable Use Policy, usage in your scenario (which is commercial usage) is OK with them.

    That being said, you'll have much more flexibility running your own DNS server - you can create your own subdomains for example. Depending on your name registrar you might want to park the domain with them since they might offer tools for that.

    chakrit : Thanks for taking the time to look into the info about commercial usage :-)
  • For real-live, actual DNS hosting, I have been loving ZoneEdit for more years than I can remember. Your first 5 domains are free, and the next are a small one-time cost. You can manage everything over the web and they do basic email and web hosting.

    For these reasons, I would definitely recommend using DNS hosting.

    chakrit : Have you ever have any downtime/spam/hacking issues with zoneedit?
    sascha : me, no. Not in over 5 years.
    gyaresu : I used to use exclusively. It was an awesome free service but that shut down a couple of years ago. Since then I also use ZoneEdit. Very solid & reliable. No noticable downsides.
    jhs : I've never had downtime, spam, or hacking issues with ZoneEdit.
    chakrit : Thanks ... I'm using zoneedit now. :-)
    gyaresu : @chakrit Perhaps you should accept the question now ;)
    From jhs
  • Someone is hosting the DNS for the domain now. If you look at the actual registration for the domain, name servers must be provided. When you register the domain, generally the registering company assigns their own name servers. There should be some way for you to add the CNAME entry using that mechanism.

    chakrit : My domain registrar has a DNS setup but I can only change them *if* I host my website with them... so... _bummer_ ...
    tomjedrz : Please identify the domain registrar, so that the rest of us can know to avoid it!
    From tomjedrz
  • Most registrars offer at least some level of basic DNS these days; someone's hosting your domain now, who is it? Failing that, ZoneEdit works pretty well.

    From pjz
  • I use the free EveryDNS service for years and no problems here!

    From Click Ok
  • I think www.dnsever.com is good. ZoneEdit provides only 2 free domains, but DNSEver.com has no limit about the number of domains.

    From steve

Port forwarding with iptables and dhcpd

The setup: I have a Linux (Gentoo, if that makes a difference) box that serves as a gateway for the whole apartment. This box does its NAT-magic with iptables and dhcpd.

The problem: I have a certain computer that I want to have a port forwarded to (for torrents, if, again, there's a difference).

I have just enough Linux administration skills to read howtos and get stuff configured properly (eventually), but the howtos I found for my case were too unclear and seemed to be unnecessarily complex.

For what I've gathered, my problem is twofold: getting the dhcpd reliably assign a certain static IP to the computer I want, and then getting iptables configured for the port forwarding.

Could someone give me a definite, step-by-step guide in how to do this? I'm sure I'm not the only one wanting to do this...


Edit: My versions of the software are:

# iptables --version
iptables v1.4.0

# dhcpd --version
isc-dhcpd-V3.1.1-Gentoo
  • iptables -t nat -I PREROUTING -s ! {internal-network} -d {public-address} -p tcp --dport {port-on-public-address} -j DNAT --to-dest {internal-address}

    where:

    • internal-network is the IP address that represents your network, i.e. 192.168.1.0
    • internal-address is the IP address that represents the host you want to expose, i.e. 192.168.1.2
    • public-address is the IP address of the interface that is facing your ISP
    • port-on-public-address is the port number that traffic would arrive at if your internal computer could see it; note that this rule does not change the port number as it forwards, it simply passes the packet along

    Note the space between the -s, the exclaimation mark, and {internal-network}, be sure to have a space on both sides.

  • To get dhcp to reliably assign a certain static IP to the computer you want, the usual thing to do is to look into how to tell your dhcp server (whichever one you're running) to statically map a mac address to an IP address. This will make it always hand out the same IP (that you specify) to that mac address.

    ISC dhcp needs a config stanza like

    host mycomputer {
      hardware ethernet 00:12:34:56:78:9A;
      fixed-address 192.168.1.10;
    }
    

    dnsmasq needs a line like:

    dhcp-host=00:12:34:56:78:9A,192.168.1.10
    

    whose details are specified in the manpage.

    where:

    • mycomputer is your computer's hostname
    • 00:12:34:56:78:9A is your computer's mac address
    • 192.168.1.10 is the IP you want to be always assigned to that mac address

    Once that's done, you now have a 'static' IP to do your port forwarding to. To do this you want, as @Avery Payne says, to do:

    iptables -t nat -I PREROUTING -s ! {internal-network} -d {public-address} -p tcp --dport {port-on-public-address} -j DNAT --to-dest {internal-address}
    

    where:

    • internal-network is the IP address that represents your network, i.e. 192.168.1.0
    • internal-address is the IP address that represents the host you want to expose, i.e. 192.168.1.10
    • public-address is the IP address of the interface that is facing your ISP
    • port-on-public-address is the port number that traffic would arrive at if your internal computer could see it; note that this rule does not change the port number as it forwards, it simply passes the packet along

    Note the space between the -s, the exclamation mark, and {internal-network}, be sure to have a space on both sides.

    Henrik Paul : I added software/version information to the question
    Avery Payne : The feature is present in all versions of IPTables. The ISC DHCP service should also support the features you need as well. As far as software revisions go, you're fine.
    From pjz

How to partition a Windows drive without formatting?

Hi,

I have a 500GB HD, partitioned into a few gigantic Windows NTFS partitions. The partitions are loaded with files, but I still have enough space and I want to install and try out linux.

Is there a way to 'slice a piece' off one of the partitions without formatting it?

thanks, Yuval =8-)

  • Partition management software such as Partition Magic will allow you to do this. However, make sure you have a full backup of everything important before you do this, it usually works fine, but when your altering disk partition data it pays to be careful.

    From Sam Cogan
  • If you can empty one of the partitions, you can delete it (My Computer => Manage => Disk Management) and then you can Linux-format it.

    Rytis : You can also resize the partitions using Disk Management, and then use Linux installer to create a partition in the now-free space.
    From Dani
  • I suggest using Wubi which allows you to install Ubuntu to NTFS without having to make a new partition.

    Brent : Clarification: Wubi allows you to essentially install linux (Ubuntu) from within windows. Just pop the installer CD in the drive and click the icon - just like any other install. Then later, if you like, you can remove it from Add/Remove programs
    From Joseph
  • I would recommend Partition Magic however as previously stated ensure you back-up your files. I would also recommend running a defrag program to tidy up the data pieces on HD. This will make the 'slicing' procedure less prone to failure and loss of data.

    As another users has already pointed out ideally i would tidy up the hard drive partitions before this. I just tend to have 2 partitions for windows: C: Drive for windows & programs D: Drive for personal data.

    I have seen some people create seperate partitions for page files and programs but this always seemed excessive to me.

    Finally, why create a partition at all? Why not install VMWare for free and run it as a virtual machine?

    From Toby Mills
  • Ubuntu supports resizing an existing Windows partition during installation, that's probably going to be your best bet. Just defrag first so that all the data gets moved to the beginning of the disk and you'll be OK :)

    If you're willing to shell out a few bucks, then Partition Magic will give you more flexibility in resizing partitions (including auto-defrag, well at least last time I used it)

    Also of note if you're just wanting to "try it out", Ubuntu offers a Live CD that you can boot off directly. You can also install to a USB device if you're looking for a temporary/test solution.

    Yuval : Thanks! This even answered my next question.. =8-D
    From sascha
  • Yes, this is possible. The fundamental algorithm for reducing a partition is that first you move the file system content towards the beginning of the partition (not necessarily the same as defragmenting, but very similar (and it could be identical)) so that the file system towards the end of the partition is unused. After that you reduce the size of the file system to somewhere between the original size and the accumulated file sizes.

    Then as a final step you change the partition entry to match the reduced file system size. The extremely vital point in this operation is that the new partition entry that replaces the old one must start at the exact same location. If this goes wrong recovering is not trivial and possibly not possible at all.

    For increasing a partition things are done in the opposite order, first the partition is changed to a larger size and then the file system is changed to match the new size.

    Many tools provide all this as a single operation and then do all the necessary steps under the hood. But they will all follow the above procedure (and will include their own code for doing the file system operation).

    GNU parted supports resizing in one operation like that although not for all files systems, and NTFS is one of them. There exists a tool ntfsresize that does support the file system resizing and then you must use a partition tool like parted or fdisk to do the final partition change like described above (make sure to use “sector” unit so that you are 100% sure that the changed partition entry starts at the very same place).

    Gparted is a graphical frontend for parted that also includes support for ntfsresize and will thus support resizing NTFS partitions in one operation.

    Tips:

    • defrag on your NTFS file system first to make less work to be done in the reduction operation.
    • reboot every time right after you have changed the partition table (you really want to be safe rather than sorry).


    As always when doing this kind of partition operation, backup is a good idea. Backup is always a good idea in any case, but especially here since destroying the partition table is a fast way to lose all your data.

    From hlovdal
  • Most live linux CDs have a "Partition Manager" or gparted that can do this for you. Just boot from the CD, and look for it in the menu. It's easy, and it's free.

    As mentioned in other posts - you should defrag your windows partition from within windows before doing this.

    You should also make sure you have a valid backup first. Although this tool seems to go overboard in being "safe", if you were to lose power or something in the middle of a critical step, you could lose access to everything.

    From Brent
  • Use SysrescCD which comes with gparted and huge amount of other hd utils. You also can install Gentoo linux using it (you can install gentoo using almost any live cd with 2.6 kernel).

    SysrescCD also includes:

    • GNU Parted creates, resizes, moves, copies partitions, and filesystems (and more).
    • GParted GUI implementation using the GNU Parted library.
    • Partimage saves / restores partitions to an image file on another partition or to another system.
    • FSArchiver flexible tool to save/restore a filesystem to a compressed archive.
    • Ntfs3g: enables read/write access to MS Windows NTFS partitions.
    • sfdisk saves / restores partition table (and more).
    • mhdd great tool to remap bad blocks, erase drive diagnose it.
    • Test-disk tool to check and undelete partition, supports reiserfs, ntfs, fat32, ext2/3 and many others
    • Memtest+ to test the memory of your computer (first thing to test when you have a crash or unexpected problems)
    • Network tools (Samba, NFS, ping, nslookup, ...) to backup your data across the netw

    Also you can buy Acronis Disk Director Suite and repartition your harddrive using it (it's also great tool but it's not free).

  • I've used gparted several times with good results. It works like partition magic, booting from a CD image and loading a minimalistic linux, allowing me to make changes to partitions safely. I ran into some issues sometimes but with old computers working not so well. Latest versions worked always very well. I like this product because is Open Source and I try always to use open source software instead first.

  • Stop! - Before I Answer Your Question

    Please give serious consideration to installing virtualization software. Microsoft's Virtual PC and Sun's VirtualBox offer free virtualization solutions which provide quick and safe ways to "install and try out" systems/installations without hacking up your system into little pieces.

    But to answer your question:

    You should take a look at EASEUS (http://www.partition-tool.com/).

    It allows you to resize partitions without reformatting. The home edition is freeware and it often compared to Partition Magic as a free alternative.

    Enjoy,

    Robert C. Cartaino

    Click Ok : +1 to EASEUS. I was near to suggest it.
  • I have to mention that windows 7 supports shrinking volumes on fly.

    Oskar Duveborn : Also Server 2008 both old version and new Win7-matched R2, which leads me to think that Vista SP1 should support shrink as well (expand has been supported ages ago).
  • Who can get me a free partition manager? Few days ago, I came up with partition problems. I would like to enlarge my system disk C. I didn’t know what to do. What I want was just a free and reliable partition software. Fortunately, my friends recommended me free partition manager software. It was really easy to use and I got everything through in less than 10 minutes. So I would like to share this partition manager with all of you. The name of this partition manager is called Partition Wizard. It provides different editions. If you have the same problems like mine, you can go to its website for more information. www.partitionwizard.com. Probably, you will find some stuff useful to you.

How much is IP V6 addressing being used?

Just how much IP V6 addressing is really in typical use out there?

I see that Linux/UNIX seems to be ready for this. But I don't see the readiness as much as the Windows side. Especially not for desktop user systems.

In my wanderings I have not seen IPV6 widely implemented or used.

Personally, I'm not quite thrilled with the addresses syntax as it is longer, and reminds me of MAC addresses with all the :'s.

Secondary question: Are we all ready to use IPV6 in our daily lives?

Thanks.

  • Pertaining to question #1: Not much, really. Microsoft drives IPv6 adoption at the moment (for shame it has to be them, but there you go.)

    Pertaining to question #2: No, we're not.

    Alnitak : what on earth makes you think that MS are "driving IPv6 adoption"?! For sure, there's support in the O/S, but at all of the IETF etc meetings I go to it's certainly not MS banging the IPv6 drum.
    Mihai Limbăşan : The obvious reason - Microsoft's dominant market position. OS support means jack diddly squat if the OS only represents 1% or 5% or 10% of deployments. By properly integrating IPv6 support in Vista and slowly pushing it on the server side via WHS and Server 2008 they are actually creating an use case which will eventually force ISPs to support IPv6 too. I'm personally annoyed that it's Microsoft who is providing the turning point, but that's life.
    Alnitak : I'm sorry, but IMNSHO that's complete crap. The most significant driving force behind IPv6 is the realisation that we really _are_ going to run out of IPv4 addresses soon. NANOG, IETF, RIPE, ICANN meetings - all of them have IPv6 high on the agenda, and that's what'll get IPv6 deployed in the core, not pressure from end users.
    Mihai Limbăşan : I'm sorry, but *that* is complete crap. In theory, you are right, we are all a big, happy, rational, forward-thinking family. In practice, no reponsible sysadmin will for the time being bother to spend company resources on IPv6 because of the chicken-and-egg problem - if you are able to justify the expense of being IPv6 ready to your accounting department knowing full well that your ISP does not support IPv6 and will not do so in the next couple of years at *least*, then you are nothing short of a magician. Or, to rephrase it, you must be on a really, really big budget. The rest of us, not.
    Mihai Limbăşan : The reason being, you see, that an IT manager does not give a flying /sbin/fsck about IEFT, NANOG, RIPE, and any other task force acronym you might care about. An IT manager thinks about either the bottom line, her/his yearly bonus, or both. And currently IPv6 adoption will cost you money with no tangible benefit over the next couple of years, not to speak about this Christmas. That's an easy decision - "we'll cross that bridge when we get there", which in real world terms translates to "not unless the server room is on fire."
    Mihai Limbăşan : And, without end user pressure, given that NAT is still a very viable option deployed by most if not all users, and given the current economic situation which does not lend to investment, I sincerely doubt most carriers view IPv6 as more than a just-in-case experiment - exactly what it has been ever since 2460.
    Oskar Duveborn : You need ipv6 on the server end for the major feature in Windows Server 2008 R2 and Windows 7 client to work (Direct Access) - so yes, they're "driving" it...
  • From Microsoft's IPv6 page:

    Support for Internet Protocol version 6 (IPv6), a new suite of standard protocols for the Network layer of the Internet, is built into the latest versions of Microsoft Windows, which include Windows Vista, Windows Server 2008, Windows Server 2003, Windows XP with Service Pack 2, Windows XP with Service Pack 1, Windows XP Embedded SP1, and Windows CE .NET.

    That doesn't sound too bad to me. Admittedly it doesn't say how well it's supported, but that's a different matter.

    As for actual use: not a lot, in my experience.

    From Jon Skeet
  • Google has implemented IPv6 on there search services and is available already to those with IPv6 Connections.

    From Sam Cogan
  • You can find a shed load of information about IPv6, including penetration statistics, at http://icons.apnic.net/display/IPv6/Home

    From Alnitak
  • OS support is probably not the concern. Vista, XP, Solaris 10 and Linux all support IPv6, and the root DNS servers have all been updated to support AAAA records.

    There are three things that are more likely to act as barriers to adoption.

    • Network support: Upgrading infrastructure to support IPv6 is a massive undertaking. It probably won't be complete for years. Until then, there will be a need to tunnel; initially, IPv6 tunneled over IPv4; eventually the reverse as the IPv6 connected network becomes larger than the IPv4.

    • Application support: In a perfect world, most consumer facing applications shouldn't care about Layer 3; that's what DNS is for. Unfortunately, there are plenty of applications out there written with IP addresses hardcoded into them, that use IP addresses in their data structures, etc. Re-writing or replacing these tools will also take a very long time.

    • NAT: One of the main design goals of IPv6 was to overcome the depletion of IPv4 space. Unfortunately, before IPv6 could be finalised and implemented, NAT combined with RFC 1918 address space provided a way for companies and individuals to connect large numbers of devices to the public internet without the need for registered address space. Like it or loathe it, NAT has grown from a stop-gap solution to a 'feature' of IPv4, with people even relying upon it for security. More discussion can be found in this question.

    Alnitak : see also http://serverfault.com/questions/1161/do-you-think-nat-is-largely-responsible-for-the-delay-in-ipv6-adoption/1187#1187
    Jay Michaud : +1 for network support. I have searched in vain periodically over the past year to find a consumer- or small business-grade (and -priced!) firewall-router that supports IPv6. Also, my area's telephone company does not provide any IPv6 DSL capability under any service plan as far as I can tell.
    LapTop006 : Although the vast majority of "good" carriers have IPv6 deployed through their core and out to their high-end customers, deploying v6 through PPPoE and other DSL methods is ugly as the "PD" (Prefix Delegation) support is still in draft stages.
  • Most newer network hardware contains support for IPv6, as do most modern operating systems and a number of other applications (browsers, ftp clients, etc.) as well. But many routers in use (including, I believe, most wireless routers) do not. There would need to be an awful lot of hardware replacement before IPv6 really takes hold.

    If they've done it right, using IPv6 in our daily lives should be transparent (to users, anyway, not so much for developers of network appliances or software).

  • The hardware support for IPv6 just isn't there. Too many consumer hardware (think home routers, PDAs, network phones etc.) do not have IPv6 support build into them, and the average Joe is not going to see a reason to throw out their hardware and buy new ones unless it is forced on them (if IPv4 stopped working one day). Neither are small ISPs ready to do the transition.

    Using a public IPv6 tunnel is slow, and not enough applications benefit from the use IPv6 to justify the extra effort.

    Martijn Heemels : I have found the speed of a tunnel to be quite acceptable, as long as the tunnel endpoint is reasonably close (latency wise).
    From mythokia
  • It's out there, it just takes a smidge more effort since many upstream providers aren't pushing it out. For organization level, setting up a SIXXS tunnel to a routing device (BSD box works well) is fairly simple. For an individual Windows user, setting up a Hexago tunnel is a no-brainer. IPv6 is becoming quite accessible now and I usually find that I get better performance from the IPv6 versions of sites, despite having the extra hops through a tunnel.

  • I think that you'll see a big upswing in IPv6 utilization when Windows 7 ships. The Direct Access feature solves alot of mobility problems in the enterprise.

  • route-server.he.net says: 527801 IPv4 RIB entries, but 3653 IPv6 RIB entries. If I'm parsing quagga's output right, they're seeing 1894 IPv6 prefixes advertised versus ~ 283k IPv4 prefixes, so quite a difference. (No idea how many AS numbers on each this equates to -- the number of IPv6 prefixes an AS has will likely be somewhat smaller than the number of IPv4 ones.)

    Also, a new data point: Verizon: LTE devices must support IPv6. Granted, VZW was all over BREW, and that never went anywhere, but BREW had no reason for anyone but the carrier to support it.

    LapTop006 : Even when fully deployed IPv6 should remain well below v4 route numbers as almost every AS (bar the largest carriers) will be advertising only a single prefix (once filters hit).
  • According to stats of the AMS-IX, the Amsterdam Internet Exchange (one of the bigger global internet exchanges), the current volume of IPv6 traffic they're processing is around 1 Gbit/s average (graph), on a average total traffic (IPv4 + IPv6) of 436 Gbit/s (graph).

    So, traffic levels are still at about 0.23% of IPv4. In the past year IPv6 traffic through AMS-IX has increased about 1000%, but there's still a long way to go.

    My medium-sized webdev company has deployed IPv6 locally and remotely. Locally through a SixXs provided tunnel and subnet, and remotely through native IPv6 provided by our hosting provider. In my experience, a lot of companies are working on it, and will help you if you ask them.

    It's quite easy, once you know how IPv6 works, to deploy it. The big problem is the chicken and egg dilemma, and convincing management to let you deploy it. I'm glad my company allowed me to spend time on it. I was able to convince them that as a webdev company we need to be 'enablers' and be ready for upcoming technologies. Therefore, to push IPv6 now allows us to work out the kinks before our customers start asking.

  • I have seen very little implementation of IPv6 outside the Mac OS X nodes on my home LAN, and even then, my router doesn't support IPv6, so it amounts to nothing.

    Are we ready? Sure. But I don't think it's going to be an easy transition. And you're quite right in saying that the unwieldy addressing scheme will more or less mandate host name resolution, even on a small network (Netbios, Bonjour, etc).

    Router manufacturers adopted "draft 802.11n" because it was faster. Faster means something to the consumer. Try to tell them that your new, more expensive router supports IPv6 on the other hand...

    Incidentally, Mac OS X has supported IPv6 since 2002 with 10.2 Jaguar (cite http://www.join.uni-muenster.de/Implementationen/Betriebsysteme.php?lang=en ).

    From msanford
  • It is still in the early adoption phase certainly, but there is starting to be a lot of movement because the wall at the end of ipv4 becoming more visible. For our part (a small regional ISP), it's rather like moving from a studio apartment to a large estate. While we're still in the early stages ourselves, it's already clear it's going to make some aspects of network management easier with extra the breathing room.

    From
  • Back in 1996, the Internet grew 1500% (that's right, one thousand five hundred percent) and the newspapers were full of talk about the Information Highway being here and now. Today, the data that we have about IPv6 Internet traffic indicates that it is far bigger than the whole Internet was back in 1997, after that 1500% growth spurt. Some people sneer at a measly Gigabit of traffic but they are forgetting that the IPv6 Internet is still in a baby stage. For a baby, that Gig is darn good.

    Lots of network operators now have IPv6 trials in place with actual IPv6 customers, mostly corporates who want to be prepared for IPv4 exhaustion in 2011. So that traffic is a lot of testing various different use cases in preparation for switching over when the time comes. You can expect a veritable firehose of traffic to appear once the switchover begins in earnest.

  • So, there may not be much v6 on the public internet... but there's a LOT of it out there that isn't. For example, every 3G phone call is VoIP over IPv6. Fairly soon there will be a suite of standards out there for automating the electricity grid, and those will all be based on IPv6 only... so if you want to be able to talk to your electricity meter, you will need v6.

    As for firewall/routers, well, the latest version of Shorewall has a good v6 firewall implementation, so a suitably sized linux box will work fine for that application. If you're tunneling, it could even be virtualised.

What benefits are there to running a 64-bit Operating System?

I would like to hear community opinions on reasons to switch, to utilise, or when one should consider a x64 platform. Plus are there any additional benefits of running 64-bit Windows 7? over 64-bit Pre-Win7 OS's?

  • 32 bit Windows is limited to max 4 GB of RAM

    Chris Jester-Young : If you use Windows Server Enterprise Edition, its PAE support can use more than 4 GB of RAM.
    John Fouhy : Often limited to 3.5GB or so in practice.
    Richard : @Chris: PAE requires special coding, and this coding is not easy. Manually paged memory: just say no!
    Luca Tettamanti : @Richard: at OS level PAE is totally transparent: the OS will manage the 36bit physical AS, user mode application are still constrained in their 32bit AS. You might be referring to AWE (Address Windowing Extensions) which is a win32 API that enables application to manage their own AS in order to "circumvent" the 32bit limit; of course the app at any time can see only 4GB so it has to map/unmap pieces of data as needed using AWE (IOW it's an additional virtual memory layer)
    From iik
  • The benefit is that each process can then address over 4GB of memory per process. Technically the OS can have more than 4GB of RAM with 32-bit (but limited to 4GB per process) but in practice no modern OS actually implements that so a second benefit is that the OS can have more than 4GB of RAM.

    Also, on 32 bit OSs, the upper part of the 4GB address space is used by device drivers and other things (like GPU RAM mapping), reducing the actual memory to about 3-3.5GB. That goes away with 64 bit OSs.

    Certain applications, particularly photo and video related, will use more than 4GB per process. Photoshop on large images, video editing, 3D modelling, etc can all benefit from more than 4GB per process.

    Luca Tettamanti : Hem, actually any modern OS supports PAE and can manage a 36bit physical AS; in the consumer editions of Windows PAE was disabled due to concerns of buggy drivers that could crash the machine (I think that it was turned off after XP SP2), the server versions all are PAE-capable. Linux and *BSD support PAE.
    From cletus
  • When it comes to Windows XP running 64 bit allows the use of 4gb of RAM or more. In 32 bit XP there is a total of 4gb RAM shared between the motherboard and the graphics card.

    Therefore if you have a 512mb graphics card the maximum memory available to Windows is 3.5gb.

  • The main advantage is for the memory space: much more than 4Go.

    That means I can allocate 4Go to a virtual machine (one process, with for instance an Ubuntu inside), while having more than enough for my current Win64 session.

    From VonC
  • Probably the most evident advantage over the 32bit version is the ability to use more than 4GB of RAM (well, actually more than 3.x since part of the AS is used for MMIO). x86_64 ISA also doubles the number of GPRs from 8 (and some of them are non that general...) to 16, likewise XMM registers are raised to 16. And of course when in LM the CPU can handle 64bit integers directly (which can be a big win for certain workloads).

  • On Windows 32-bit, each process is permitted to access only 2GB by default. This is much worse than being able to use 4GB. The system gets to use the remaining memory, but as noted the video card takes its share from that.

  • There are security benefits when running a 64 bit version of Windows. Basically Microsoft was able to restart with more of a clean slate and implement some extra safe guards. It is partially enabled by improved hardware support in the 64 bit CPU.


    Here is a quick list of differences:

    • Support for hardware based DEP.
    • PatchGuard to prevent drivers or rootkits from patching the kernel.
    • Signed drivers.
    • Code integrity checksums. Binaries are checked before loading.
    • Removal of the 16 bit subsystem (reducing attack surface).


    Jeff Jones has a two articles on the changes: part1, part2. Wikipedia has some information and there is this KB article (from Doubt).

    ripper234 : Do standard modern computers support this?
    Luke Quinane : @ripper234 I think all x64 CPUs have the hardware support. Here is some info on it: http://en.wikipedia.org/wiki/NX_bit#Hardware_background
  • 32-bit Windows has a 4gb address space. You cannot use more than 4gb of physical ram.

    Even if you have only 4gb of physical ram, Windows x64 will use that ram more efficiently. With Windows x86 by default only 2gb of the address space is set aside for applications, the other 2gb is reserved for the OS. You can change this split to 3gb apps/1gb OS, though not every app. is flagged to take advantage of this.

    Also, there are holes in memory address space which have been set aside for device IO (transferring data to hds, video cards, USB devices, etc.) You can't use the physical memory which shares these addresses. Depending on various configuration settings this can account for as much as half a gig of unusable RAM. So on 32-bit Windows with 4gb of physical ram you'll actually end up with maybe only 3.7gb of usable ram, and at most 3gb of that usable by applications. Whereas with 64-bit Windows all of that 4gb can be used by applications (or the kernel).

    From Wedge

How do I find the UUID of a partition

I'm running Ubuntu, and want to find out the UUID of a particular partition. I know I can use e2label /dev/sda1 to find out the partition label, but there doesn't seem to be a similar way to find the UUID.

  • The easiest way to do this for ext2/ext3/ext4 is:

    /sbin/tune2fs -l /dev/sda1
    
    Hamish Downer : This will work provided your filesystem is formatted as ext2, ext3 or ext4. Most filesystems are one of these but not all. It will also not work for swap partitions. See my answer for a universal way.
    From Eddie
  • Assuming you want the UUID for sda1, you could try something like this:

    for v in /dev/disk/by-uuid/* ; do echo "`readlink $v`: $v" | grep ../sda1 | cut -d\: -f2 | cut -d/ -f5 ; done
    

    Adjust sda1 accordingly. To get the UUIDs for all partitions, drop the greps and cuts, a la:

    for v in /dev/disk/by-uuid/* ; do echo "`readlink $v`: $v" ; done
    

    Sample output for sda1 on my desktop:

    [mihailim@home ~]$ for v in /dev/disk/by-uuid/* ; do echo "`readlink $v`: $v" | grep ../sdb3 | cut -d\: -f2 | cut -d/ -f5 ; done
    dc8c49f1-e2dc-46bc-ba02-013f26c85f70
    

    Edit: Please note that this solution, while more contrived than the udev->vol_id one, does not require root privileges, will work on any post-2005 or so kernel, and relies on tools present in any Linux distribution which are by default in the path for any user.

    Eddie : This will work on any computer running a recent enough devfs.
  • The recommended way to do this is to do

    sudo vol_id -u /dev/sda2
    

    For more on using UUIDs, see this article (from ubuntu help, but should work for any linux distro using UUIDs).

    As noted in comments to this question, vol_id may not be in your path. On ubuntu it is in /sbin so the above will work. For fedora it appears to need

    sudo /lib/udev/vol_id -u /dev/sda2
    

    If other distributions have vol_id in other places then post a comment and I'll add it to this answer.

    Eddie : This doesn't work on my Fedora 10 laptop.
    Mihai Limbăşan : This is a much better solution than mine. Eddie, vol_id is located in /lib/udev. mish, could you edit your answer to prefix the full path in front of vol_id? /lib/udev isn't in root's path by default on any distribution I'm aware of.
    Eddie : "/lib/udev/vol_id /dev/sda2" appears to work. Few people will have /lib/udev in their path.
    Brad Gilbert : On my Ubuntu computer there is a symbolic link from `/sbin/vol_id` to `/lib/udev/vol_id`
    Brad Gilbert : Even though this is exactly what I asked for, `blkid` would have been more useful, when I went to edit `/etc/fstab`.
  • You can use the following to get the UUID for a particular drive,

    sudo vol_id -u /dev/sda1
    

    or you can use this to list all UUIDs for the attached media,

    ls /dev/disk/by-uuid
    
    From Rich Adams
  • Another command that might be available and also works quite well for this is 'blkid'. It's part of the e2fsprogs package. Examples of it's usage:

    Look up data on /dev/sda1:

    topher@crucible:~$ sudo blkid /dev/sda1
    /dev/sda1: UUID="727cac18-044b-4504-87f1-a5aefa774bda" TYPE="ext3"
    

    Show UUID data for all partitions:

    topher@crucible:~$ sudo blkid
    /dev/sda1: UUID="727cac18-044b-4504-87f1-a5aefa774bda" TYPE="ext3"
    /dev/sdb: UUID="467c4aa9-963d-4467-8cd0-d58caaacaff4" TYPE="ext3"
    

    Show UUID data for all partitions in easier to read format:

    topher@crucible:~$ sudo blkid -L
    device     fs_type label    mount point    UUID
    -------------------------------------------------------------------------------
    /dev/sda1 ext3             /              727cac18-044b-4504-87f1-a5aefa774bda
    /dev/sdc  ext3             /home          467c4aa9-963d-4467-8cd0-d58caaacaff4
    

    Show just the UUID for /dev/sda1 and nothing else:

    topher@crucible:~$ sudo blkid -s UUID -o value /dev/sda1
    727cac18-044b-4504-87f1-a5aefa774bda
    
    Brad Gilbert : On my Ubuntu computer, I don't need to use sudo.
    Brad Gilbert : Just typing `blkid`, got me exactly what I wanted, but not quite what I asked for. ( I'm accepting it anyway, because I am sure I will use it often )

Thursday, January 27, 2011

Fix a tomcat6 error message "/bin/bash already running" when starting tomcat?

I have a Ubuntu 10.04 machine that has tomcat6 on it. When I start tomcat6 with /etc/init.d/tomcat6 start I get

* Starting Tomcat servlet engine tomcat6
/bin/bash already running.

and the server fails to start. Unfortunately, there is nothing in /var/log/tomcat/catalina.out to help debug the issue. With some cleverly placed echo statements it seems to be the line from /etc/init.d/tomcat6:

start-stop-daemon --start -u "$TOMCAT6_USER" -g "$TOMCAT6_GROUP" \
                -c "$TOMCAT6_USER" -d "$CATALINA_TMPDIR" \
                -x /bin/bash -- -c "$AUTHBIND_COMMAND $TOMCAT_SH"

The only thing I've changed in this script is TOMCAT6_USER=root. In servers.xml, the only thing I've changed is <Connector port="80" protocol="HTTP/1.1" from port 8080. I have tried reinstalling the package by first removing everything sudo apt-get --purge remove tomacat6 and then sudo apt-get install tomcat6 but this has not solved the issue. I have also restarted the server multiple times in hopes of some magic. Everything was working until I restarted my server. Any ideas?

  • Hi,

    Looking at the man page for start-stop-daemon, it looks for processes which match the name, uid, and/or gid of the command it's being asked to start. From the error message, I'd guess it may be doing this based on the /bin/bash command - so it's finding that there's already a root process running the /bin/bash command, and refusing to start a "duplicate" one.

    You could work around this by hacking the init script around. But running Tomcat as root is Bad, so better to look at other ways to send port 80 to Tomcat, even while Tomcat runs as a non-root user. The most common approach is to run Apache httpd in front, another (if you don't want to fiddle with connectors) is to use iptables to map port 80.

    See the serverfault question for details on how to do these.

    From Kief
  • Sometimes you gotta do what you gotta do.

    Here's a patch that makes running tomcat as root work:

    --- init.d.old/tomcat6  2010-09-01 15:31:01.996208252 -0700
    +++ init.d/tomcat6  2010-09-01 15:30:10.315146226 -0700
    @@ -1,4 +1,4 @@
    -#!/bin/sh
    +#!/bin/sh -x
     #
     # /etc/init.d/tomcat6 -- startup script for the Tomcat 6 servlet engine
     #
    @@ -141,6 +141,12 @@
            cd \"$CATALINA_BASE\"; \
            \"$CATALINA_SH\" $@"
    
    +   cat >/etc/init.d/tomcat_exec.sh <<-EOT
    +   #!/bin/bash
    +   $TOMCAT_SH
    +   EOT
    +   chmod +x /etc/init.d/tomcat_exec.sh 
    +
        if [ "$AUTHBIND" = "yes" -a "$1" = "start" ]; then
            TOMCAT_SH="'$TOMCAT_SH'"
        fi
    @@ -151,7 +157,7 @@
        chown $TOMCAT6_USER "$CATALINA_PID" "$CATALINA_BASE"/logs/catalina.out
        start-stop-daemon --start -u "$TOMCAT6_USER" -g "$TOMCAT6_GROUP" \
            -c "$TOMCAT6_USER" -d "$CATALINA_TMPDIR" \
    -       -x /bin/bash -- -c "$AUTHBIND_COMMAND $TOMCAT_SH"
    +       -x /etc/init.d/tomcat_exec.sh 
        status="$?"
        set +a -e
        return $status
    
    From
  • There's an Ubuntu bug for this issue, with a proposed patch.

    It's not necessarily anything to do with running as root - if your tomcat6 user has a /bin/bash process (say, you're using it to run some commands to support your Tomcat application), then you will hit it as well.

    From crb