Determine filesystem type - EXT2, FAT32, NTFS, or other

Is it possible to determine file system type (EXT2, EXT3, FAT32, NTFS or other types) of the host media hard drive/USB key in Java?
Best Regards,
Karthigan.

[email protected] wrote:
I wrote a back up application. It works great if I am backing up data from NTFS to NTFS or FAT32 or FAT32 - basically across same filesystem types. If I run the same backup application from NTFS to FAT32 media, files that need not be copied over get copied over unnecessarily - because the timestamp accuracy/format of NTFS is different from FAT32. It just is not very appealing if files get copied over for no reason due to timestamp variation across filesystems. I was hoping to see if there was a way around it. The trick in this case might be to create a file on the target volume, set its last-changed date to a certain value, then read back its last-changed date and see whether you get back what you consider to be a date lacking in accuracy. Then instead of comparing an accurate date to an inaccurate date, and doing unnecessary work, you could apply some kind of algorithm to the accurate date to apply the inaccuracy before comparing the two dates. Or something like that.

Similar Messages

  • [SOLVED] mount: unknown filesystem type 'ext2'

    I probably have the most complicated first-time arch setup that you'll ever hear a n00b post.  XD
    I just finished setting up an encrypted arch box with a usb boot drive (it contains the key-file), but when I go to boot, the system reports the following:
    mount: unknown filesystem type 'ext2'
    Of all the things to break!  Ext2???!
    This is for the default boot mode, when boot into the fallback initramfs mode, the arch box boots up fine (although it takes 2 whole minutes).  I think that the issue is that I'm missing a module in my mkinitcpio.conf file.
    /etc/fstab file:
    UUID=1245ASDF / btrfs discard,autodefrag,compress=lzo,rw,relatime,ssd,space_cache 0 0
    UUID=2245ASDF /boot ext2 rw,noatime 0 2
    UUID=3245ASDF none swap defaults 0 0
    /etc/mkinitcpio.conf file:
    HOOKS="base btrfs udev autodetect modconf block encrypt lvm2 filesystems keyboard fsck"
    /etc/default/grub file:
    GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda:enc cryptkey=/dev/sdb2:ext2:/keyfile crypto=sha512:twofish-xts-plain64:512:0:"
    Last edited by a-jamesregan (2015-04-13 19:15:48)

    Wow, there was literally a note about the exact issue I was having on the wiki...
    https://wiki.archlinux.org/index.php/Mkinitcpio#MODULES
    Note: If using reiser4, it must be added to the modules list. Additionally, if you will be needing any file system during the boot process that is not live when you run mkinitcpio — for example, if your LUKS encryption key file is on an ext2 file system but no ext2 file systems are mounted when you run mkinitcpio — that file system module must also be added to the MODULES list. See Dm-crypt/System configuration#cryptkey for more details.
    PS: How do I mark an issue as solved?
    Last edited by a-jamesregan (2015-04-13 10:28:20)

  • Filesystem type

    Hello all! I want to see the filesystem type of a partition for example (ntfs) in java. Is this possible in java?
    Cheers!

    Calin wrote:
    Hello all! I want to see the filesystem type of a partition for example (ntfs) in java. Where / how do you want to see this?
    Is this possible in java? http://en.wikipedia.org/wiki/Turing_complete

  • First boot fails - Filesystem type unknown, partition type 0x7

    Just done a straight forward install of Arch onto it's own disk drive, however there are two other drives present in the system.
    Grub menu comes up ok but then Arch errors with:
    root (hd2,0)
    Filesystem type unknown, partition type 0x7
    Error 17: Cannot mount selected partition
    Any suggestions?
    Thanks,

    hokasch wrote:
    What you still did not really tell us - how are you booting up? I.e. where is your first grub stage installed? How did you manage things with the debian install? Your problem is the root(x,x) line, not the kernel line. This line specifies the boot partition (grub's root/ where to find the kernel).
    Coming from the windows world where for years we have just relied on changing the boot order of drives in the BIOS to choose which MBR to boot from I simply assumed it was just as easy in the Linux world, this is obviously not the case.
    If you want to continue that way, just install grub to the MBR of each disk with a linux install and configure grub to use that drive as the first drive (e.g. set the root line to hd(0,0) if /boot is the first partition). IIRC, changing the boot order in the Bios will pull the selected drive to the beginning. That would fit your inital error (but you did not say how you booted into grub then...). You can double-check that behaviour by using the find commands in the grub shell (see my earlier post).
    Going with grub2/grub's root by uuid only really makes sense if you put grub2 on the MBR of a drive which is always installed and selected as primary in Bios (obviously, all other grub2 files must be on that drive too).
    Just done another completely clean install and noticed that even though I select 'Partition access method - uuid' it doesn't seem to actually work that way, at least checking menu.lst showed no signs of any uuids.  What is the point of having an install option if it is then ignored.
    This refers to your fstab, not the bootloader config.
    Sorry hokasch, it got a bit difficult to answer your earlier post as by the time I read it Debian had been trashed and I think I had redone the Arch install a few times by then as well.
    If I have understand you correctly what you are saying is that if I were to install arch on a drive which at install time is the only drive in the machine then root(x,x) would refer to hd0 in my case root (hd0,1) as I have an NTFS partition at the beginning of the drive.  Alternatively I could just edit grub's menu.lst afterwards.  That way as long as the drive is first in the BIOS boot order it will boot ok.  My mistake seems to have been trying to install the first grub stage to somewhere other than the MBR, I may have missunderstood the capabilities of partition identification by uuid.
    Ok lets go back to a single drive environment
    hd0,0 = NTFS boot partition
    hd0,1 = Arch /Boot - this contains grub & vmlinuz-linux
    hd0,2 = Arch swap
    hd0,3 = Arch /
    If I want to boot Windows I set hd0,0 as active/bootable, if I want to boot arch I set hd0,1 as active/bootable.  Actually not sure how to change the active partition to a linux one but come back to that later.  For the moment hd0,1 is the bootable partition.  This is the only drive in the system.  I have a by-uuid entry in menu.lst which allows me to boot if the other entries fail.  menu.lst looks like this:
    # (0) Arch Linux
    title Arch Linux
    root (hd0,1)
    kernel /vmlinuz-linux root=/dev/sda4 ro
    initrd /initramfs-linux.img
    Now I see part of the confusion, as you advised, the root (hdx,x) line actually refers to the 'grub root' / 'linux boot' not the 'linux root'.  And the other confusion is that the kernel line root= does not refer to the location of /vmlinuz-linux but to the actual linux root.  Now I think I understand that bit.
    Now to add another disk to the system.  Change drive order in BIOS so that arch disk is top of the boot order.
    Fails to boot: Unable to find root device /dev/sda4!
    Boot to knoppix to see the disk & partition layout:
    hd0,0 = NTFS
    hd0,1 = NTFS
    hd0,2 = NTFS
    hd0,3 = NTFS
    hd0,4 = NTFS
    hd0,4 = NTFS
    hd0,4 = NTFS
    hd1,0 = NTFS boot partition
    hd1,1 = Arch /Boot - this contains grub & vmlinuz-linux
    hd1,2 = Arch swap
    hd1,3 = Arch /
    So clearly /dev/sda4 is now an NTFS partition.
    If appears that grub & linux do not see disk drives in the same order as the BIOS boot order causing /dev/sda4 to point towards the wrong partition.
    Off at a bit of a tangent here but while I think of it is there a way of regenerating the menu.lst to search for instances of windows on NTFS partitions now that I have access to ntfs-3g.
    Thanks,
    Last edited by NickC_UK (2012-02-21 14:25:04)

  • Unknown filesystem type crypto_LUKS

    Hi, I have spare space on my HD so I decided to experiment with encryption following this wiki:
    https://wiki.archlinux.org/index.php/dm-crypt_with_LUKS
    In summary:
    created boot (sda6) and root (sda7) partitions
    formatted boot as ext2 and root with passphrase and then with ext4
    installed the base system
    generated a new initramfs as explained in the wiki:
    MODULES="dm_mod ext4"
    HOOKS="base udev autodetect modconf block keymap encrypt filesystems keyboard fsck"
    added cryptdevice=<device>:<dmname> to kernel boot options:
    linux /vmlinuz-linux cryptdevice=/dev/sda7:cryptroot root=UUID=d3505fe1-4a29-4841-8e80-e953442d8d30 ro quiet
    restarted pc
    On boot it asks for passphrase, but after that it stops with an error regarding crypto_LUKS; here the complete message:
    A password is required to access the cryptroot volume:
    Enter passphrase for /dev/sda7
    fsck: fsck.crypto_LUKS: not founf
    fsck: error 2 while executing fsck.crypto_LUKS for /dev/sda7
    ERROR: fsck failed on '/dev/sda7'
    ********************* WARNING ***********************
    * The root device is not configured to be mounted *
    * read-write! It may be fsck'd again later. *
    mount: unknown filesystem type 'crypto_LUKS'
    You are now being dropped into an emergency shell.
    sh: can't access tty: job control turned off
    [rootfs /]#
    Here it is my fstab: http://pastebin.archlinux.fr/474004
    and lsblk output: http://pastebin.archlinux.fr/474005
    Any idea about the problem?
    Thanks for your time.

    There are two discrepencies between your kernel parameters and fstab:
    1) The kernel parameter UUID for real root differs from the UUID given for /dev/mapper/cryptroot in your fstab; if cryptroot is your real root partition, the UUIDs should be the same.
    2) Your fstab instructs the system to mount the root partition as read-write, while the kernel parameters specify read-only. (the kernel parameter should be read-write, which is what the warning in the output above is about).
    Change those and see if it helps.

  • How can I determine the type of video out connector I need?

    Howdy,
    I have a white macbook purchased Jun/2008. I want to connect to a TV but don't know what adapter I need. How can I determine the type of video out jack my macbook has?
    System Profiler says the model identifier is "MacBook 4,1". Under Graphics/Displays the only thing it says about the "Display Connector" is that no display is connected. Too bad it doesn't tell me what type of connector it is. If I knew the name of the connector I'd probably be home free. But it seems like every macbook model has a different video connector (since the state of the art has advanced over the years) and I haven't been able to keep up with the names.
    Now, I have a 6" long adapter that will convert this connector to VGA. And searching the Apple store for VGA adapters, the existence of mine says my connector is might be one of "Mini DisplayPort", "Apple Mini DVI", "Apple DVI", or "Apple Micro-DVI". But then there is also the connector at
    http://store.apple.com/us/product/M8639G/A?mco=MTY3ODQ5OTY
    and that looks like the one I have. But unlike the other adapters, this one is just called a "VGA Display Adapter". Does the connector have a name? How can I find adapters that have that same connector?
    I know I could use the adapter I have, plus a VGA to VGA cable, to hook up to a TV. But the quality of the VGA signal is poor in the digital world. My goal is to hook up to the TV via HDMI. Is this even possible? By which I mean, will my macbook generate the signals necessary to be able to be converted to HDMI?
    Thanks for any help,
    Zebulon T

    Thanks, Ded,
    You're right, the cable that I have won't work. I't from my previous, 2004 iBook. This is pretty embarrassing... I looked at the cable but didn't bother to try plugging it in.
    Looking at the close-up picture of the Mini-DVI to VGA adapter, that does look like the right connector. So I have Mini-DVI, and the other apter you pointed to can convert this to DVI. I'll take a look to see what makes the most sense, connector wise, downstream from that.
    Thanks very much.
    Zeb T

  • Determine the type of the caught exception

    Hi!
    Here is my problem :
    I'm using a web service and the method I call throws different types of Exception (RemoteException, ServiceException, etc...)
    And, the reaction to the caught exception depends on its type, that's why I need to determine what type of exception i've caught. I know that with C# I use the boolean function is :
    if (exception is TypeOfException1)
        // associated reaction
    else if(exception is TypeOfException2)
       // associated reaction
    }Is there any method or any other way in Java to do that?
    Thanks a lot,
    Gan�che.

    >
    Here is my problem :
    I'm using a web service and the method I call throws different types of Exception (RemoteException, ServiceException, etc...)
    And, the reaction to the caught exception depends on its type, that's why I need to determine what type of exception i've caught. >
    try {
      // stuff that may cause exceptions..
    } catch(RemoteException re) {
      // deal with this re
    } catch(ServiceException se) {
      // deal with this se
    } catch (Throwable didNotExpectThis) {
      // exceptional!
      didNotExpectThis.printStackTrace();
    }

  • Determine data type

    Hi all,
    I've got procedure for inserting data into value1 column of table1.
    My need is to determine data type entered by user.
    If data type is not number then user should receive error.
    How do I perform it?

    The easiest and most reliable way would be to declare the formal parameter as a number like:
    SQL> create procedure p (p_num in number) as
      2  begin
      3     null;
      4  end;
      5  /
    Procedure created.
    SQL> exec p('a');
    BEGIN p('a'); END;
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 1If you cannot do that, or want to be more "user friendly", then the only alternative is to test it and raise an error like:
    SQL> create procedure p (p_str in varchar2) is
      2     l_num number;
      3  begin
      4     l_num := to_number(p_str);
      5  exception
      6     when value_error then
      7        raise_application_error(-20001, 'I know I said it was a string, but I really want a number');
      8  end;
      9  /
    Procedure created.
    SQL> exec p('a');
    BEGIN p('a'); END;
    ERROR at line 1:
    ORA-20001: I know I said it was a string, but I really want a number
    ORA-06512: at "OPS$ORACLE.P", line 7
    ORA-06512: at line 1John

  • How to determine employee type (management vs nonmanagement) in WebDynpro

    Hi,
    I am running SP14.
    In my WebDynpro application, I need to hide/show a link based on if the employee is management or nonmanagement.
    What is the easiest way to determine the type of employee in a WebDynpro?  Is the management/non-management attribute already exposed and available to the WebDynpro?  Or do I need to invoke a BAPI/RFC to retrieve that information from SAP (eg Employee Group or Personnel Area)?
    Thanks for any help you can provide.
    Kevin

    You only need to call this RFC once and share the results with other views via context binding!
    In my applications I follow the Floorplan manager architecture and have one web dynpro component for all the frontend logic e.g. FcAddress
    In the component controller of FcAddress I setup model nodes for the RFC e.g.
    Address_Input (mapped to input RFC model class with all the import parameters of the RFC)
    Address_Output (mapped to either the output RFC model class with all the export parameters of the RFC or it includes another model node for Address_Records which is mapped to the export table parameter.)
    Address_Messages (mapped to the return parameter of the RFC (BAPIRET2).
    All other views with their component controllers are mapped to those model nodes to allow access to the RFC data.
    You can pass the userid to the RFC and then the RFC will get the related employee number via IT105/ST10. You just need to have the userid defined as an import parameter in the RFC.

  • Can't boot after system update: unknown filesystem type

    After running a system update, including updating the kernel, I can't boot to the new kernel.
    On booting, grub loads the kernel image, runs/loads udev, but then fails to mount the root partition with error:
    mount: unknown filesystem type 'ext4'
    I have tried reinstalling the 'linux' package via packman several times, also trying the --recursive argument to make sure all my dependencies were there, and after days of googling and tweaking my system, I'm at a loss.
    Thank goodness I happened to keep a spare kernel laying around in /boot.
    Thanks in advance.
    Last edited by jackrabbit (2012-03-22 23:25:28)

    The OP can read their partition initially though, it's only after udev that they can't.
    Also, try adding "rootfstype=ext4" to your grub kernel line. Is your /boot on a separate partition or part of your / partition?

  • How to determine IE type(32 bit or 64 bit) in a task sequence while updating Java

    How to determine IE type(32 bit or 64 bit) in a task sequence
    Hi,
    Currently i have to update new version of Java after removing all the previous existing version of Java by using TS in SCCM 2007.
    we have both 32 bit and 64 bit browser in the environment. I am stucked in determining whether the browser is of 32 bit or 64 bit.
    How to determine IE type(32 bit or 64 bit) in a task sequence so that respective java can be installed for that IE browser.
    will highly appreciate quick response.
    Thanks in advance.
    Daya

    But you also need to install JRE x86 on x64 systems, since most people actually use the 32bit browsers on x64 systems.
    The detection logic is actually pretty simple -- just check the right registry hive to find the installation location of the BIN\JAVA.DLL. Both pathnames are stored in HKLM\Software\JavaSoft\Java Runtime Environment\1.7 in the registry value "JavaHome",
    but the x86 path is stored in the 32-bit hive and the x64 path is stored in the 64-bit hive.
    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

  • How do I determine what type of Solaris installation I have ?

    I'm runnig "SunOS PSP 5.8 Generic_108528-13 sun4u sparc SUNW,Sun-Fire-480R" but I would like to determine the type of Solaris installation I have....do I have a a "development" installation ? Do I have all the SUNW developer packages ? Also what are the "types of installations" that are possible ?
    I'm thinkig about download the mysql binary (from Sunfreeware.com) and I went to the dpendencies site (http://wwws.sun.com/software/solaris/freeware/s8u7dependencies.html) to check what dependencies exist and I saw the following line (among other non "related" info.):
    mysql-3.23.43 gcmn-1.0 ncurses-5.2
    What exactly does this mean ?

    Hi
    You can check the type of solaris install from the below file
    /var/sadm/system/admin/CLUSTER
    Regards

  • How to determine itab type at run time

    I need to write a subroutine that organizes data in internal tables for presentation by a smartform. There are a few similarly structured internal tables all with the same field name ("recipe_type") by which the data is sorted. My problem is that how I can determine the type of the itab inside my subroutine at run time? Is it ever possible in ABAP?
    The subroutine code is attached below. Thanks for any help.
    FORM beautify_itab    TABLES itab_in TYPE table
                                     USING v_type TYPE any
                                     CHANGING itab_out TYPE table.
    Data declaration
      DATA: v_data_row LIKE LINE OF itab_in,                " THIS WON'T COMPILE!
                 v_blank_row LIKE LINE OF itab_in.              " blank row
    Organize the display of the table data
      LOOP AT itab_in INTO v_data_row.
        IF v_type <> itab_in-recipe_type.                     " 'recipe_type' is the sort key for the incoming itabs
          v_type = itab_in-recipe_type.
          IF sy-tabix > 1.
            APPEND v_blank_row TO itab_out.
          ENDIF.
          APPEND v_data_row TO itab_out.
        ELSE.
          CLEAR v_data_row-recipe_type.
          APPEND v_data_row TO itab_out.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "beautify_itab

    The following code does what I want, but only if the input itab structure is declared first in the program. It won't work if the itab is declared as itab_in TYPE TABLE OF sflight. This is because the function 'GET_COMPONENTS_LIST'  only can load the structure of a field declared explicitly in the program.  Does anybody know of any method to load the structure of an itab based off a dtab? 
    Thanks you guys for answers. Points have been rewarded.
    *& Report  Z_GET_ITAB_TYPE_AT_RUN_TIME
    REPORT  z_get_itab_type_at_run_time.
    DATA: BEGIN OF itab_in OCCURS 0,
             seatsocc_b LIKE sflight-seatsocc,
             fldate LIKE sflight-fldate,
          END OF itab_in,
          itab_out TYPE TABLE OF string,
          wa_itab_out TYPE string.
    SELECT seatsocc_b fldate
    INTO TABLE itab_in
    FROM sflight
    WHERE carrid = 'AA' AND
          connid = '0017'
    ORDER BY seatsocc_b.
    PERFORM beautify_itab
                TABLES
                   itab_in
                USING
                   sy-repid
                   'itab_in'
                   'SEATSOCC_B'
                CHANGING
                   itab_out.
    LOOP AT itab_out INTO wa_itab_out.
      WRITE: / wa_itab_out.
    ENDLOOP.
    *&      Form  beautify_itab
          text
         -->ITAB_IN    text
         -->V_KET_FIELD   text
         -->ITAB_OUT   text
    FORM beautify_itab TABLES itab_in TYPE table
                       USING  v_prog_name LIKE sy-repid
                              v_itab_in_name TYPE any
                              v_key_field_name TYPE rstrucinfo-compname
                       CHANGING  itab_out TYPE table.
      DATA: itab_fields TYPE TABLE OF rstrucinfo,
            v_field_name LIKE rstrucinfo-compname,
            v_old_key TYPE string,
            v_field_value TYPE string,
            v_data_line TYPE string,
            v_tabix LIKE sy-tabix,
            c_blank_row TYPE string VALUE ''.
      FIELD-SYMBOLS: <fs_field>,
                     <fs_data_line>,
                     <fs_field_list> TYPE  rstrucinfo.
    gets all of the components of a structure
      CALL FUNCTION 'GET_COMPONENT_LIST'
        EXPORTING
          program    = v_prog_name
          fieldname  = v_itab_in_name
        TABLES
          components = itab_fields.
      LOOP AT itab_in ASSIGNING <fs_data_line>.
        v_tabix = sy-tabix.
        LOOP AT itab_fields ASSIGNING <fs_field_list>.
          v_field_name =  <fs_field_list>-compname.
          ASSIGN COMPONENT v_field_name OF STRUCTURE
                        <fs_data_line> TO <fs_field>.
          v_field_value = <fs_field>.
          IF v_key_field_name = v_field_name.
            IF v_old_key <> v_field_value.
              v_old_key = v_field_value.
              IF v_tabix > 1.
                APPEND c_blank_row TO itab_out.
              ENDIF.
            ELSE.
              CLEAR v_field_value.
            ENDIF.
          ENDIF.
          CONCATENATE v_data_line v_field_value INTO v_data_line
                      SEPARATED BY space.
        ENDLOOP.
        APPEND v_data_line TO itab_out.
        CLEAR v_data_line.
      ENDLOOP.
    ENDFORM.                    "beautify_itab

  • How to determine the type of an existing iView

    Hi,
    While creating an iView using wizard there is a big list of type of iViews. But after creation of iView, how do I determine the type of iView. Which attribute or property of iView holds this information?
    -Lave Kulshreshtha

    You can copy and paste the existing Iview changing the name and ID if u want to replicate the same.
    Also, when you create a new iView from a template, you get a list of them e.g SAP BSP iView etc.
    Now what you see in the code link is much similar to what you see as a list of templates when u create iViews. So its pretty simple.
    I hope this helped you.

  • Installing Solaris 7 - System hangs while determining bus Types

    Hi,
    I am trying to install Solaris 7 on my Compaq Presario. My system hangs immediately after the first screen. It hangs on the screen where it says "Bus Enumeration Determining Bus Type and gathering hardware configuration data. Not sure why it is doing that. Any help would be appreciated
    Regards,
    Ashish.

    My system is not branded It is custom bulit.
    What more information you want write me.
    Thanks for all help
    Amit

Maybe you are looking for

  • About  java.lang.NullPointerException in struts code

    Hi friends... I am working on the java struts in my healthcare project.I have used the following IDEs & environments 1) Eclipse 2) Tomcat 5.5 3) Servlet 2.4 I have created all the necessary jsp files & action ,form classes but i can't get my code com

  • Oracle Export and import

    Hi, I just want to do the export and import. Source DB - Oracle 10g on Solaris 64 bit OS. (Export) Destination DB - Oracle 9i on Windows OS (import). Kindly confrm that these export and import is possible in oracle. Thank you,

  • Backup date format

    Hi everyone, I did some searching of the forums but didn't find this anywhere. I did a backup of my iphone4 and then used a sqlite browswer to view the data in the messages file.  The problem is that the date comes out as a 10 digit number.  I did so

  • CS5-Bridge -- Not Enough Storage is available to complete this operation

    Since installing CS5 (Windows XP sp3, w/ 3gb ram) and trying to use Bridge I get this command after about 10 minutes of use...especially if I try to drag a thumbnail image from the film strip at the bottom of the screen to another folder location.  P

  • Does upgrading from lightroom 4 to 5 generate a monthly fee?

    does upgrading from lightroom 4 to 5 generate a monthly fee?