Monday, January 24, 2011

Does Exchange have ability to run hidden mailboxes?

Hello,

Title of my question may sound a little bit odd but I was thinking if Exchange 2010 or 2007 or any program that would work in conjunction with Exchange has ability to create this structure:

  1. Users having their normal mailboxes connected and using them as everyone would in Outlook 2003/2007/2010.
  2. Users having additional mailboxes (from old Exchange 2003) attached but hidden on demand of Administrator. For example administrator could easy disable them just like they never been attached making them invisible to users and everyone else. Would be good if such mailboxes could be easily removed out of system (lets say on external drive) by simple step not manual job for 100 mailboxes.
  3. Users without ability to copy/move their mails to outside storage (like a local .pst file)?

Do you guys have any suggestions on this? I was thinking maybe using public folders but this seems like overkill and not really suited for this. And please don't ask me why I need this type of security (it's not something I requested).

Edit:

Full context. We have exchange 2003 now which is used over 2 years. It has limit of 2gb per mailbox now. My management is afraid that some people may have corresponded between themselves (internal mail) about stuff they are not allowed to share between departments. Since I won't go over 100 mailboxes and check whether such correspondence had place and delete those mails my management want me to find a way to delete (first archive on dvd) all emails before 31st march 2010 (basically leaving only last 3 months) in each mailbox. Kinda clean start.

After doing that I would be told to hand over archived mailboxes to users so they can use it when necessary but so the mails aren't on server. This really kills my idea of having nice Exchange server with lots of space and so users ability to work with history (I use my history emails all the time) gives them some additional pluses.

Idea of management is that when I hand over archived emails most people will use it only occasionally or never and it will be harder to track but I know this solution will blow up in my face some day.

So I would prefer some way to archive those emails and connect them as a second mailbox of some kind per each user and on demand i would be able to switch it on and off.

I want to upgrade to Exchange 2010 from SBS 2003 with Exchange 2003 and it's something that would convince my management to actually go for it. It doesn't have to be internal Exchange 2010 feature but maybe some kind of addon or so. I saw GFI Mail archiver but not sure if it has that ability.

  • Do they actually have to be physically removed? Could them not appearing in the address book be acceptable? There is a setting to "Hide from Exchange address lists". It is under the "Exchanged Advanced" tab in the user properties. It can be toggled at the admins discretion. Takes a little while to sync with everyone's Outlooks.

    Seems like you are doing this for security reasons so I don't know if its acceptable. But if users cannot find the mailboxes they wont know they exist. Security by obscurity....

    MadBoy : What I am looking for is option to hide it from the user that will be using it daily. For example he sees his old emails for 99 days and then one day I can just switch it off and switch it on after 50 days. It shouldn't generate errors for users in outlook saying something is missing etc. Just simply gone so that user can't use his old emails again. Kinda like archive on demand feature.
    From Campo
  • If it's a one-time cut-off at the 3-months or older mark, you can achieve this by using exmerge to take all mail older than 3 months and dump it out to a PST for each user. You could then back these PSTs up, and either make them available to users on a network share (where you can add and remove the ability for a user to open the PST as you wish), or give the user a copy to load locally onto their machine (faster and less network space requirements, but you'll have no control over when the user can and can't access the PST.

    If you're looking to keep a constant 3-month retention period on users mail files, you could look at a solution like MailMarshal, or externally something like Postini or Messagelabs mail archiving features. You can couple that with an email policy that'll clear files older than 3 months out of everyone's mailbox.

    With all of the above options you can set read-only so that users can interact with the archive but not delete/alter old emails.

    MadBoy : Does it have ability to take away access with simple turn it off or so solution?
    Chris Thorpe : For postini, you can enable/disable user archive access on a per-user setting from the control panel. For the PSTs, you can grant and deny access with share or NTFS permissions as you would with any other file on the network.
    Chris Thorpe : BTW you could run some scripts against your mail stores to pull out the information that management requested about people in each department mailing each other. All you need from management is a candidate list of To: and From: users, and you can search the mailboxes for mails that meet that criteria. I've done this previously when management wanted a list of all mails Dave Smith sent to Jane Doe between 2nd May and 9th March, etc.
    MadBoy : As for NTFS solution problem is people would get errors in their Outlook which is not what I want (don't want to confuse users etc). I was reading about GFI Mail Archive and it looks okey, but i'll be checking other solutions as well.
    MadBoy : My management doesn't care if they did it (to punish them or something). They just want it gone. Problem is there could be a lot of conversation between departments that isn't problematic and only few issues can be. So all in all I or someone else would have to go thru emails and delete the problematic ones or archive them with some software and in case of 'control' be able to disable and unmount it like it never happened.

Plesk hosting on MediaTemple DV

Hi there,

We have a MediaTemple dedicated virtual running Plesk. The problem we're having is that changing the permissions of files on the server to be writable by server owner (apache) is conflicting with the ability to upload and overwrite files via the FTP user.

Here's an example, I upload a file from user "serverftp" and they own the new file in the httpdocs folder. I then change the permission of an image upload folder to the apache user to that I can upload images via a PHP script. Uploading or changing that folder with the serverftp user is then locked out.

Speaking to tech support didn't get very far because there are some strange group permissions going on and it would involve me adding every single domain FTP user to the pcantl group or something similar.

I'm wondering how I can easily change things so that I don't have this problem anymore.

installing rpm packages on ubuntu

In ubuntu i have downloaded flash rpm,how to install it.i am new to ubuntu and i have tried the following

    alien -k flash-plugin-10.0.45.2-release.i386.rpm
    alien -i flash-plugin-10.0.45.2-release.i386.rpm
    rpm -i flash-plugin-10.0.45.2-release.i386.rpm //this works in rhel versions

The above doesn't seem to work..

Thanks..

  • Installing a .rpm on Ubuntu is a last resort and should not be used when .deb packages are available.

  • It's available in the repositories and you should use the Synaptic or aptitude package manager to install it rather than downloading and installing it manually.

    For Jaunty, Karmic and Lucid:

    sudo apt-get install flashplugin-installer
    

    For Dapper, Hardy and Intrepid:

    sudo apt-get install flashplugin-nonfree
    
  • The Flash plugin is also in the Canonical partner repository, the package is called adobe-flashplugin. Using this you'll automatically get security updates for Flash if they are available

  • RPM files are for RedHat Package Manager, and generally not meant for Ubuntu...

    actually the better/preferred way would be to use Repository using #apt-get install

    since you have already downloaded RPM and wanna use the same, there are two ways you could follow

    [] using 'alien' converting *.rpm RedHat package to a *.deb Debian Package like *this you alrady performed *This will convert your RPM to a DEB {in your case should be flash-plugin-10.0.45.2-release.i386.deb} and then you can install deb with:

    #sudo dpkg -i flash-plugin-10.0.45.2-release.i386.deb

    [] other way is converting RPM to CPIO, extracting contents of CPIO and installing from the source

    #rpm2cpio flash-plugin-10.0.45.2-release.i386.rpm | cpio -dimv

    From AbhishekKr

Exchange 2010 setup /prepareAD fails to run

I've tried installing Exchange 2010 on Windows Server 2008 R2 (only domain controller and all-in-one system).

I did setup.exe /prepareAD, setup /prepareSchema and it worked fine the first time I did it.

Unfortunately due to problem with Hub Transport installation related to (at least from what I've read) IPv6 being disabled (some say disabling it helped them while some enabling helped them). I did it the proper way by using registry entry to disable IPv6 but it still errored out. So i managed to uninstall everything (renamed some old entries in registry of failed Hub Transport roles and tried to reinstal Exchange after rebooting server.

Unfortunetly running setup /prepareAD now gives an error:

D:>setup /PrepareAd

Welcome to Microsoft Exchange Server 2010 Unattended Setup

By continuing the installation process, you agree to the license terms of Microsoft Exchange Server 2010. If you don't accept these license terms, please cancel the installation. To review these license terms, please go to http://go.microsoft.com/fwlink/?LinkId=150127&clcid=0x409/

Press any key to cancel setup................ No key presses were detected. Setup will continue. Preparing Exchange Setup

Copying Setup Files              ......................... COMPLETED

No server roles will be installed

Performing Microsoft Exchange Server Prerequisite Check

Organization Checks              ......................... COMPLETED

Setup is going to prepare the organization for Exchange 2010 by using 'Setup /P repareAD'. No Exchange 2007 server roles have been detected in this topology. Af ter this operation, you will not be able to install any Exchange 2007 server rol es.

Configuring Microsoft Exchange Server Organization Preparation ......................... FAILED The following error was generated when "$error.Clear(); buildToBuildUpgrade -ExsetDataAtom -AtomName OrgLevelCt -DomainController $RoleDomainController" was run: "An error occurred with error code '2147504140' and message 'The data type can't be converted to or from a native Active Directory data type.'.".

The Exchange Server setup operation did not complete. Visit http://support.micro soft.com and enter the Error ID to find more information.

Exchange Server setup encountered an error.

Unfortunetly if i rerun the setup it complains that it needs setup /prepareAD to be run first.

Basically all that works now is setup /PrepareSchema and setup /PrepareDomain complains that prepareAD wasn't done.

For full information I'm also attaching error I had before I've uninstalled everything and tried again:

Hub Transport Role Failed

Error: The following error was generated when "$error.Clear(); install-ExsetdataAtom -AtomName SharedMachineSettings -DomainController $RoleDomainController" was run: "An error occurred with error code '2147950640' and message 'There is no such object on the server.'.".

An error occurred with error code '2147950640' and message 'There is no such object on the server.'.

  • I've managed to fix this by manually removing every trace of Exchange on this server (not all steps were found at my server but i post them anyway). And kids don't do this at home. This is not supported and may harm your system. I was desperate:

    1. Run setup /m:uninstall
    2. Stop and disable all the Exchange 2010 services
    3. Use Registry Editor (Start->Run->Regedit) to remove these Exchange related registry keys:
      * HKLM\SOFTWARE\Microsoft\Exchange
      * HKLM\SYSTEM\CurrentControlSet\Services\MSExchange* (all the keys starting with “MSExchange”)
      * HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Exchange
    4. Remove the entire Web Server role (don’t forget to reinstall afterwards as it’s a prerequisite for E2K10!)
    5. Remove the Exchange 2010 server from Active Directory. I ended up deleting the entire “Microsoft Exchange” branch from ADSIEdit (Configuration Container > Services > Microsoft Exchange) as my Org only counts one server.
    6. Use Windows Explorer to delete:
      * C:\Program Files\Microsoft\Exchange Server
      * C:\ExchangeSetupLogs
    7. Use Windows Installer CleanUp Utility to remove all the exchange related info from the installer database.
    8. Remove the security groups created by Exchange setup from AD
    9. Use CC Cleaner to remove registry entries for Exchange

    I also found this link which gives a bit bigger overview: http://msexchangehelp.wordpress.com/2010/02/10/manually-uninstall-last-exchange-2010-server-from-organization/

    Anyways it solved the problem that installation went thru but again I am at square one with corrupted installation since Hub Transport failed to install AGAIN. So redoing this steps again... and trying installation again with IPV6 disabled.

    From MadBoy

Running simple cron on MAMP

How can I get http://localhost:8888/site_name/index.php to run every 30 min until I manually stop it (edit the cron file)? This is on a Mac running MAMP.

I know how to set one up using the wizard in a cpanel but have never done this on MAMP before.

nginx error log was huge, so I deleted and created a new one, now nginx won't start

I deleted the /var/log/nginx/error.log file, and then created a new one using:

sudo nano error.log

Doinga ls -la shows that the error.log and access.log have the same permissions.

When I try and start nginx I get the error:

alert: could not open error log file: open() "/var/log/nginx/error.log" failed permission denited.

Update WHen trying to start nginx, I am also seeing:

emerg: /var/run/nginx.pid failed 13: permission denied.

  • Delete the error.log file and nginx will create it itself.

    Blankman : i deleted it, then when I try and start nginx is gives me the same permission denied error on the file /var/log/nginx/error.log
    From Martin F
  • First try deleting the file, if that doesn't work check that the nobody user has the right permissions:
    http://derekneely.com/2009/06/nginx-failed-13-permission-denied-while-reading-upstream/

    From emmanuel
  • have a look in the nginx config, check who the server is running as - at a guess the user will be nginx

    so :

    chown nginx: /var/run/nginx.pid chown -R nginx: /var/log/nginx

    Should do the trick.

    Blankman : but why was it working before?
    c10k Consulting : I suspect because you tried to run it as root, and then tried starting it with its init script.
    Blankman : well I always start it like that, hmm....
    Blankman : nginx.conf says: "user www-data"
  • This doesn't solve your problem, but in the future, if you do

    cat /dev/null > /file/you/want/to/wipe-out

    you will copy over the contents of the file with nothing, and keep all permissions in tact.

    Not nginx-speicific, but Additionally, make sure you are running the application as the user it is supposed to run as. If you ever ran it as root, all the permissions are going to be owned by root, so other users won't be able to run it.

    Blankman : great tip thanks.
    From Alex
  • The usual way to rotate the logs with NginX is to rename the file, and then /etc/init.d/nginx reload. The server starts a new file, and you can do what you wish with the old.

    You may also find it useful to edit the configuration to not log as much....

Why can't I get rid of default index.html even if I disable the default virtual host in Apache2?

I have created a virtual host settings file and I disabled the default settings by using a2dissite default (this is a pretty standard Ubuntu 10.04 installation). But no matter what I try my Apache2 server simply keeps on displaying the default index.html page instead of the index.php page that I set up in the virtual host file. Can someone help me what I'm missing. Details follow:

No default settings:

ls -l /etc/apache2/sites-enabled/
total 0
lrwxrwxrwx 1 root root 51 May  5 13:32 webmin.1273066327.conf -> /etc/apache2/sites-available/webmin.1273066327.conf
lrwxrwxrwx 1 root root 34 May 30 11:03 www.accontax.be -> ../sites-available/www.accontax.be

Contents of the relevant virtual host:

cat /etc/apache2/sites-enabled/www.accontax.be

<VirtualHost *>
    ServerName  www.accontax.be
    ServerAlias accontax.be

    DirectoryIndex index.php
    DocumentRoot /var/www/drupal/

    <Directory /var/www/drupal/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>
</VirtualHost>

Contents of httpd.conf:

cat /etc/apache2/httpd.conf

Listen 80
NameVirtualHost *

I also have those relevant lines in my apache2.conf:

# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/

When I visit http://www.accontax.be I expect apache2 server go to the /var/www/drupal subdirectory and start serving index.php but it simply keeps on serving index.html from /var/www directory. I have reloaded the configuration, restarted the server, deleted my browser cache. Nothing changed.

Probably I'm missing a simple yet crucial step but I just could not find it.

PS: When I ssh to the server and try to browse the localhost it works as I expect!

  • i assume that your hostname is proper (li141-187.members.linode.com)

    in /etc/apache2/httpd.conf change the line below,

    NameVirtualHost * to NameVirtualHost 109.74.194.187:80

    & there can be a duplicate NameVirtualHost in your /etc/apache2/sites-enabled/webmin.1273066327.conf file in line 1. check if exists. if yes delete that line.

    & edit the VirtualHost definition in /etc/apache2/sites-enabled/000-default file as follows.

    <VirtualHost 109.74.194.187:80>
       ServerName 109.74.194.187
       .......
    

    & edit the lines in /etc/apache2/sites-enabled/www.accontax.be as follows.

    <VirtualHost 109.74.194.187:80>
       ServerName accontax.be
       ServerAlias www.accontax.be
       .......
    

    then apache2ctl restart.

    & and also check you bind's zone file for accontax.be, it should be like configuration below.

    $ttl 38400
    @   IN  SOA accontax.be li141-187.members.linode.com. (
                SOA_SERIAL_NUMBER
                10800
                3600
                604800
                38400 )
    accontax.be.    IN  NS  ns1.linode.com.
    accontax.be.    IN  NS  ns2.linode.com.
    accontax.be.    IN  A   109.74.194.187
    www.accontax.be.    IN  A   109.74.194.187
    ftp.accontax.be.    IN  A   109.74.194.187
    webmail.accontax.be.    IN  A   109.74.194.187
    mail.accontax.be.   IN  A   109.74.194.187
    accontax.be.    IN  MX  5 mail.accontax.be.
    accontax.be.    IN  TXT "v=spf1 a mx a:accontax.be ip4:109.74.194.187 ?all"
    

    there should be your own serial number for domain, intodns.com says so. change SOA_SERIAL_NUMBER with your own above.

    & this link will give you more information about DNS configuration. http://www.intodns.com/accontax.be

    it seems your are using webmin. it's much better to do all these changes in webmin for you. Check everything under "Servers" menu, in apache menu, check your module config is ok before changing anything. & also change startup command for apache in webmin to apache2ctl. do not allow webmin to use /etc/init.d/apache2 script.

    From yasin inat

cannot add a user to sysadmin role in SQL Server

Hello everyone,

I am using SQL Server 2008 Management Studio. The current logon account belongs to machine local administrator group. I am using Windows Integrated Security mode in SQL Server 2008.

My issue is, after log into SQL Server Management Studio, I select my login name under Security/Logins, then select Server Roles Tab, then select the last item -- sysadmin to make myself belong to this group/role, but it says I do not have enough permission. Any ideas what is wrong? I think local administrator should be able to do anything. :-)

thanks in advance, George

  • The login of the session where you try to set permissions must have permissions.

    So, the login you are using is a local admin? This means the local admin group does not have enough rights.

    The GUI will run this too sp_addsrvrolemember. Although this says

    Requires membership in the role to which the new member is being added.

    So, the local admin group is not a member of sysadmin.

    Edit:

    To solve: Use a login that has rights. you can find one using sp_helpsrvrolemember

    George2 : What is your advice to solve my problem?
    George2 : Not sure if any walk-arounds or solutions without reinstalling all SQL Server 2008 again! :-(
    George2 : "Use a login that has rights" -- how can I get a list of logins which has enough permission?
    George2 : Thanks, I find the only member listed from EXEC sp_helpsrvrolemember 'sysadmin' is called sa, is it a Windows User? I cannot find such a user from Windows Users list. Any ideas?
    gbn : It's a reserved SQL login, not a Windows user. On my test SQL 2008 install, the account that installed SQL Server is listed.
    George2 : Thanks gbn, do you mean sa is not a Windows user. But why it is listed? I think if I am using Windows Integrated Authentication mode, then all listed users should be Windows users or groups. Any comments?
    From gbn
  • By default SQL adds the group BUILTIN\Administrators to the sysadmin role, meaning that any local NT administrator is automatically a SQL sysadmin. On Vista, because of the UAC, you must run in 'as Administrator' mode to benefit from this privilege.

    • If you are on Vista, run the client tool (SSMS) 'as administrator' and then try to add yourself as a sysadmin.
    • If the BUILTIN\Administrators group was removed from sysadmin role accidentally, then you must login with another sysadmin login. If ther eis no other sysadmin login, you must login with SQL authentication as sa and use the sa password that was set during setup. Once logged in as a member of sysadmin, ad BUILTIN\Admisnitrators back to sysadmin role. If SQL logins are disabled then congratulation, you just lock yourself out of the SQL installation.
    • If the BUILTIN\Administrators group was removed intentionally from the sysadmin role (as per KB932881) then you are trying to hack into system you don't have permission to.
    George2 : Hi Remus, I am confused that during installation process, I do not setup any passowrd for sa, is there a default password?
    George2 : Another confusion is, from running store procedure sp_helpsrvrolemember to find all sysadmin role users, only sa is listed, no other users from local machine adminsitrator group, any ideas why?
    Remus Rusanu : There is no default password for sa. sa's password is set during setup, if mixed authentication is enabled. You are going to have to ask administrator of your database to grant you access if you need.
    michielvoo : "If SQL logins are disabled then congratulation, you just lock yourself out of the SQL installation." In that case, see Jordi's answer below to start SQL Server in Single User Mode.
  • By default SQL Server 2008 no longer adds the BUILTIN\Administrators as members of the sysadmin fixed server role. When you go through the installer it asks what account or accounts should have sysadmin rights. There's a button which basically says "make me a sysadmin" which will add the account of the user doing the install as a sysadmin.

    If they didn't add any other users as sysadmins then only that user is currently a sysamdin. You'll need to have that person log into the SQL Server and grant the DBAs sysadmin rights.

    From mrdenny
  • I mulled over the same issue after a new installation until I registered the server, on SQL Server 2008, then everything went as it should

  • "SQL Server 2008 no longer adds the BUILTIN\Administrators as members of the sysadmin fixed server role"

    That's true, BUT in that case you can recover from that situation starting the SQL Server Service in Single User Mode (emergency mode), and any local admin will be able to logon.

    http://msdn.microsoft.com/en-us/library/ms188236.aspx

    Regards.

  • In an otherwise good article--"Troubleshooting: Connecting to SQL Server When System Administrators Are Locked Out" [http://msdn.microsoft.com/en-us/library/dd207004.aspx], the author tells us that all we have to do to regain control of our Sql Server is to:

    "Start the instance of SQL Server in single-user mode by using either the -m or -f options. Any member of the computer's local Administrators group can then connect to the instance of SQL Server as a member of the sysadmin fixed server role."

    Unfortunately, what it means to start in single-user mode is not an intuitive matter. Also, at least in my experience, membership in my computer's local Administrator's group did not grant sysadmin status to my "user" account.

    This story had begun when to address a problem of membership in my domain by a non-DC server (a consequence of changing ISP), I rebuilt the DC into Windows Server 2008 R2 from 2008. This solved a couple minor problems but did not address the question of membership by the errant server. It took a fix suggested in ServerFault to accomplish that (in my case, it was a matter of resetting winsock and tcpip).

    Sql Server 2008 resides on that second server, now a member of the domain. Here's the problem. As someone points out on ServerFault, it is common to push the "let the current user become as sysadmin," when installing Server 2008. Common also to not consider anyone else. Because that single user identity was a domain member of a domain that no longer existed, no one had permission to administer Sql Server.

    I logged on as the local server administrator that had been around when Sql Server was installed, but although this allowed me access to the Management Studio, I quickly discovered that BUILTIN\Administrators had only the "public" server role.

    After much research and experimentation, I happened upon an article giving the specifics of single-user logon [http://technet.microsoft.com/en-us/library/ms180965.aspx]:

    C:>cd \Program Files\Microsoft SQL Server\MSSQL10_50.1\MSSQL\Binn
    C:...>sqlservr.exe -m

    To prepare to take this step, you must shut down Sql Server (which runs by default in most cases). Use Sql Configuration Manager to stop "Sql Server."

    Then, in a command prompt, navigate to that program file location (or equivalent on your machine), and issue the "sqlservr.exe -m" command. If you see a stream of activity logged in your command prompt, you're being successful. If it fails to start, then you probably have Sql Server running already. Shut it down.

    Allow the single-user instance to attach its databases. When log activity has ceased, open Management Studio. You will be automatically in single-user mode, and therefore whatever account you represent will be a sysadmin. Use that power to adjust Security logins and server roles.

    In my case, I had to recreate the domain accounts in the new domain, then delete their namesakes in Sql Server, and reconstruct them (due to the SID/GUID situation), reassigning permissions to particular databases as necessary.

    ldsandon : There's also another way to set parameters: open service, manager, select the service and then properties from the right-click menu. In the general tab there is a "Start parameters" edit. Type the needed parameters there. Then **start the service using the start button in that page**, the parameters set there are not permanent and valid only when the service is started from the Properties dialog.

repair partition table

Hallo.

I've just overwritten my partition table of my system's hard disk. i made a cfdisk on the wrong device (/dev/sda instead of /dev/sdd), deleted all partitions, made one new primary spanning over the whole device, set its type to 07 (NTFS) and hit write.

So here i am with my system running. Until i reboot, i hope/guess nothing will change - meaning: all my data is accessible (I'm currently making a dd-backup of the whole device and plan to make a .tar.gz-backup of the most important data later). I also backed up /proc/partitions, /proc/diskstats (even though i guess this is more about throughput and stuff like this ...) and /sys/block/sda/sda?/{start,size}.

Some further things i know:

  • 4 primary partitions
  • 1st partition: ~100Mb, ext3, /boot
  • 2nd partition: ~100Mb, "Win7 Boot Partition", ntfs(?)
  • 3rd partition: ~20...30GB, Win7, ntfs
  • 4th partition: ~20...30GB, luks-encrypted device
  • The luks- de crypted device is a LVM-PV
  • The /, /home & swap-partitions are all LVs on the (VG on the) above noted PV

So my questions:

  • What is the simplest way to just write the kernels partition table to the disk?
  • What is the simplest way to take the above mentioned (and perhaps other I don't know of ...) data and generate the partition table?
  • Are there any problems to take care of regarding to luks and/or lvm?
  • Is there any data I should backup before rebooting (meanig stuff from kernel [ /sys/..., /proc/...] and so on, which could help me regenerate the partition table)?

Thanks a lot!

P.S.: debian sid, Kernel 2.6.34-1-amd64 from debian-experimental, 80GB Intel SSD

  • If the partition table is damaged, I'd suggest using a boot disk of RIP (rescue is possible Linux) to run testdisk. Heck, you might be able to run testdisk from your running system to have it scan and recover partitions, but I'd not try that because I don't know what it would do to a running system with open files.

    If you want to try a backup of essential data (you don't already have it?) now would be a good time to do so...

    m.sr : I have backups of (most of) the data of my system, and my system is up and running and all data is accessible (as far as i can see). I just don't want to make a fresh installation of my whole system(s), because: - The data is here, only the partition table is gone - I don't want to setup this "complicate" (luks, lvm, ...) system again ;) - This is an interesting task ;) - even if setting up debian again would be fast, setting up win7 again is pain (because of "unusual stuff" like drivers for accessing luks-partitions, ext2-Partitions in luks, ...)
    m.sr : Just testing testdisk on the still-running-system. Looks promising - Thanks a lot for that hint. I'm just not really knowing which data this program will restore / rewrite and how .... but I will RTFM ...
    Bart Silverstrim : Testdisk is a diamond in the rough, interface-wise. It can restore your partition, or it can scan for and recover individual files (a function in the advanced tools, I believe, working from memory...). It's not really a generally recovery tool as much as it'll scan for and repair partitions, just as you described having problems :-) It'll extrapolate and repair partitions for me when we're trying to duplicate disks and have trouble with clones with NTFS drives.
  • Not too tricky. Hopefully.

    First of all, note the size and order of all your partitions on /dev/sda:

    challenger:/home/michael # grep . /sys/block/sda/sda*/{start,size}
    /sys/block/sda/sda1/start:63
    /sys/block/sda/sda2/start:228690000
    /sys/block/sda/sda3/start:257040
    /sys/block/sda/sda1/size:256977
    /sys/block/sda/sda2/size:83885760
    /sys/block/sda/sda3/size:228432960
    

    Run fdisk on /dev/sda and change the units to sectors:

    Command (m for help): u
    Changing display/entry units to sectors
    

    Then start making partitions. Use the appropriate numbers start and size for each partition.
    Avoid an off-by-one error - subtract one from size before typing it into fdisk.

    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    p
    Partition number (1-4): 1
    First sector (63-312581807, default 63): 
    Using default value 63
    Last sector, +sectors or +size{K,M,G} (63-312581807, default 312581807): +256976
    
    Command (m for help): p
    
    Disk /dev/sda: 160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Disk identifier: 0x02b002af
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1              63      257039      128488+  83  Linux
    

    Don't forget to set your partition IDs and toggle the boot flag on the right partition

    Now re-install your MBR and you should be ready to go.


    Naturally you can do all this using your favorite partition editor... parted works just fine as well.

    If you've lost the information regarding start/end of partitions - parted has 'rescue' options to search the disk for lost partitions. But you shouldn't need those.

    m.sr : Just waiting until my dd-backup is finished. I will try your fdisk-restore-advice - which looks promising and is one of the first i kind of thought of. But some questions are missing: 1.) I guess things like lvm/luks will work without further attention, won't they? 2.) Is there a reason why i should rewrite the MBR - i didn't change it if fdisk doesn't change it.
    MikeyB : 1) LVM should work with further attention - you can run pvscan after you fix the partition table to verify. 2) Actually, right, no need to redo the MBR if you haven't clobbered it or moved files in /boot.
    m.sr : just for your information: I did it exactly as your outlined it in your answer. Everything worked as expected, system with repaired partition table up and running. No Problems with lvm, luks or win7. MBR was untouched the whole time so didn't need to be regenerated (which would have been an easy grub-install). Thanks a lot!
    From MikeyB