You are not logged in.

#1 2012-10-15 10:07:27

craigdabbs
Member
Registered: 2011-07-01
Posts: 11

FSArchiver not supporting EXT4 partition?

Hi i have just recently been getting errors on my systems using fsarchiver. 

It claims the filesystem is not supported

[======DISK======] [=============NAME==============] [====SIZE====] [MAJ] [MIN]
[sda             ] [SAMSUNG HD204UI                ] [     1.82 TB] [  8] [  0]
[sdb             ] [ELSKY MSATA 16GB               ] [    14.91 GB] [  8] [ 16]

[=====DEVICE=====] [==FILESYS==] [======LABEL======] [====SIZE====] [MAJ] [MIN] 
[sda1            ] [LVM2_member] [<unknown>        ] [     1.82 TB] [  8] [  1] 
[sdb1            ] [ext4       ] [OS               ] [    14.91 GB] [  8] [ 17] 
[dm-0            ] [ext4       ] [hd1              ] [     1.82 TB] [254] [  0]
fsarchiver savefs -v -A -j2 -o -z6 ~/backup.fsa /dev/sdb1

Im trying to backup /dev/sdb1 and it shows this error

oper_save.c#947,filesystem_mount_partition(): filesystem of partition [/dev/sdb1] is not supported by fsarchiver

I am running arch linux, all up to date and have recently updated to systemd and grub2.  Kernel is 3.5.6-1.
I have some other machines with slightly older kernels and on the on initv system and seems to work fine
Is anyone else having these issues?
I would appreciate any insight into a solution.  Thankyou

Last edited by craigdabbs (2012-10-15 10:11:02)

Offline

#2 2012-10-15 14:47:29

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: FSArchiver not supporting EXT4 partition?

Confirmed here. Also savefs didn't work with my ext2 /boot partition. savedir still seems to work, though. Might be time for a bug report?

Scott

Offline

#3 2012-10-15 15:00:22

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: FSArchiver not supporting EXT4 partition?

It's an orphan http://www.archlinux.org/packages/extra … sarchiver/ but it has been updated to the latest version.
I have found no relevant bug reports neither on our bugtracker nor on http://www.fsarchiver.org/forums/viewforum.php?f=17

Offline

#4 2012-10-15 16:10:29

craigdabbs
Member
Registered: 2011-07-01
Posts: 11

Re: FSArchiver not supporting EXT4 partition?

thanks for checking guys, i just been loading the arch live image and using it that way for now.  Hopefully new version will fix it smile

Offline

#5 2012-10-15 20:12:35

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: FSArchiver not supporting EXT4 partition?

fsarchiver depends on e2fsprogs and they've been just updated to 1.42.6 in [testing].

Offline

#6 2012-10-28 20:25:47

slickvguy
Member
Registered: 2012-10-28
Posts: 18

Re: FSArchiver not supporting EXT4 partition?

karol wrote:

fsarchiver depends on e2fsprogs and they've been just updated to 1.42.6 in [testing].

Wouldn't e2fsprogs only matter in a restore operation?

FWIW, I updated my system yesterday, including accepting systemd, and now I'm getting the same error from fsarchiver.
The error is while ti's trying to mount the source partition. filesystem_mount_partition().
I suspect it has something to do with systemd. I will try booting without it and see if that makes a difference.

UPDATE: Yes, when I booted without init=/bin/systemd, fsarchiver worked as usual.

Last edited by slickvguy (2012-10-28 20:30:31)

Offline

#7 2012-10-30 05:14:52

slickvguy
Member
Registered: 2012-10-28
Posts: 18

Re: FSArchiver not supporting EXT4 partition?

I've been doing a little bit of digging. I'm a bit rusty on the skills, but here's what I've discovered so far...

This is where it's crapping out: oper_save.c#947

    res=generic_get_mntinfo(devinfo->devpath, &readwrite, curmntdir, sizeof(curmntdir), optbuf, sizeof(optbuf), fsbuf, sizeof(fsbuf));
    if (res==0) // partition is already mounted
    {
        devinfo->mountedbyfsa=false;
        //snprintf(partmnt, PATH_MAX, "%s", curmntdir); // return the mount point to main savefs function
        msgprintf(MSG_DEBUG1, "generic_get_mntinfo(%s): mnt=[%s], opt=[%s], fs=[%s], rw=[%d]\n", devinfo->devpath, curmntdir, optbuf, fsbuf, readwrite);
        if (readwrite==1 && g_options.allowsaverw==0)
        {
            errprintf("partition [%s] is mounted read/write. please mount it read-only \n"
                "and then try again. you can do \"mount -o remount,ro %s\". you can \n"
                "also run fsarchiver with option '-A' if you know what you are doing.\n", 
                devinfo->devpath, devinfo->devpath);
            return -1;
        }
        if (generic_get_fstype(fsbuf, &devinfo->fstype)!=0)
        {   
            if (strcmp(fsbuf, "fuseblk")==0)
                errprintf("partition [%s] is using a fuse based filesystem (probably ntfs-3g). Unmount it and try again\n", devinfo->devpath);
            else
                errprintf("filesystem of partition [%s] is not supported by fsarchiver: filesystem=[%s]\n", devinfo->devpath, fsbuf);
            return -1;
        }

Specifically:  if (generic_get_fstype(fsbuf, &devinfo->fstype)!=0).

The called function doesn't find a match for the filesystem name.

Here's the code of that function from filesys.c:

// return the index of a filesystem in the filesystem table
58 int generic_get_fstype(char *fsname, int *fstype)
59 {
60  int i;
61 
62  for (i=0; filesys[i].name; i++)
63  {
64  if (strcmp(filesys[i].name, fsname)==0)
65  { *fstype=i;
66  return 0;
67  }
68  }
69  *fstype=-1;
70  return -1;

So I guess the filesystem is either being reported incorrectly or in a format that fsarchiver can't make sense of? Something to do with the way the filesystem is mounted when using systemd versus the way fsarchiver looks for the mounted devices.

filesys.c's generic_get_mntinfo

int generic_get_mntinfo(char *devname, int *readwrite, char *mntbuf, int maxmntbuf, char *optbuf, int maxoptbuf, char *fsbuf, int maxfsbuf)
{
    char col_fs[FSA_MAX_FSNAMELEN];
    int devisroot=false;
    struct stat64 devstat;
    struct stat64 rootstat;
    char delims[]=" \t\n";
    struct utsname suname;
    char col_dev[128];
    char col_mnt[128];
    char col_opt[128];
    char line[1024];
    char temp[2048];
    char *saveptr;
    char *result;
    int res;
    FILE *f;
    int i;

    // init
    res=uname(&suname);
    *readwrite=-1; // unknown
    memset(mntbuf, 0, sizeof(mntbuf));
    memset(optbuf, 0, sizeof(optbuf));

    // 1. workaround for systems not having the "/dev/root" node entry.

    // There are systems showing "/dev/root" in "/proc/mounts" instead
    // of the actual root partition such as "/dev/sda1".
    // The consequence is that fsarchiver won't be able to realize
    // that the device it is archiving (such as "/dev/sda1") is the
    // same as "/dev/root" and that it is actually mounted. This
    // function would then say that the "/dev/sda1" device is not mounted
    // and fsarchiver would try to mount it and mount() fails with EBUSY
    if (stat64(devname, &devstat)==0 && stat64("/", &rootstat)==0 && (devstat.st_rdev==rootstat.st_dev))
    {
        devisroot=true;
        msgprintf(MSG_VERB1, "device [%s] is the root device\n", devname);
    }

    // 2. check device in "/proc/mounts" (typical case)
    if ((f=fopen("/proc/mounts","rb"))==NULL)
    {   sysprintf("Cannot open /proc/mounts\n");
        return 1;
    }

    while(!feof(f))
    {
        if (stream_readline(f, line, 1024)>1)
        {
            result=strtok_r(line, delims, &saveptr);
            col_dev[0]=col_mnt[0]=col_fs[0]=col_opt[0]=0;
            for(i=0; result != NULL && i<=3; i++)
            {
                switch (i) // only the second word is a mount-point
                {
                    case 0:
                        snprintf(col_dev, sizeof(col_dev), "%s", result);
                        break;
                    case 1:
                        snprintf(col_mnt, sizeof(col_mnt), "%s", result);
                        break;
                    case 2:
                        snprintf(col_fs, sizeof(col_fs), "%s", result);
                        break;
                    case 3:
                        snprintf(col_opt, sizeof(col_opt), "%s", result);
                        break;
                }
                result = strtok_r(NULL, delims, &saveptr);
            }

            if ((devisroot==true) && (strcmp(col_mnt, "/")==0) && (strcmp(col_fs, "rootfs")!=0))
                snprintf(col_dev, sizeof(col_dev), "%s", devname);

            msgprintf(MSG_DEBUG1, "mount entry: col_dev=[%s] col_mnt=[%s] col_fs=[%s] col_opt=[%s]\n", col_dev, col_mnt, col_fs, col_opt);

            if (devcmp(col_dev, devname)==0)
            {
                if (generic_get_spacestats(col_dev, col_mnt, temp, sizeof(temp))==0)
                {
                    msgprintf(MSG_DEBUG1, "found mount entry for device=[%s]: mnt=[%s] fs=[%s] opt=[%s]\n", devname, col_mnt, col_fs, col_opt);
                    *readwrite=generic_get_fsrwstatus(col_opt);
                    snprintf(mntbuf, maxmntbuf, "%s", col_mnt);
                    snprintf(optbuf, maxoptbuf, "%s", col_opt);
                    snprintf(fsbuf, maxfsbuf, "%s", col_fs);
                    fclose(f);
                    return 0;
                }
            }
        }
    }
   
    fclose(f);
    return -1;
}

Last edited by slickvguy (2012-10-30 05:54:56)

Offline

#8 2012-10-30 06:45:52

slickvguy
Member
Registered: 2012-10-28
Posts: 18

Re: FSArchiver not supporting EXT4 partition?

Here's the problem:

With systemd:

filesys.c#171,generic_get_mntinfo(): device=[/dev/sda3] has major=[8] and minor=[3]
filesys.c#203,generic_get_mntinfo(): mountinfo entry: major=[0] minor=[3] filesys=[5] col_opt=[proc] col_mnt=[/proc]
filesys.c#203,generic_get_mntinfo(): mountinfo entry: major=[0] minor=[13] filesys=[6] col_opt=[sysfs] col_mnt=[/sys]
filesys.c#203,generic_get_mntinfo(): mountinfo entry: major=[0] minor=[5] filesys=[2] col_opt=[devtmpfs] col_mnt=[/dev]
filesys.c#203,generic_get_mntinfo(): mountinfo entry: major=[0] minor=[14] filesys=[10] col_opt=[tmpfs] col_mnt=[/run]
filesys.c#203,generic_get_mntinfo(): mountinfo entry: major=[8] minor=[3] filesys=[1] col_opt=[ext4] col_mnt=[/]
filesys.c#209,generic_get_mntinfo(): found mountinfo entry for device=[/dev/sda3]: mnt=[/] fs=[1] opt=[ext4]
oper_save.c#933,filesystem_mount_partition(): generic_get_mntinfo(/dev/sda3): mnt=[/], opt=[ext4], fs=[1], rw=[0]
oper_save.c#947,filesystem_mount_partition(): filesystem of partition [/dev/sda3] is not supported by fsarchiver: filesystem=[1]
oper_save.c#1211,oper_save(): archive_filesystem(/dev/sda3) failed

Without systemd:

filesys.c#171,generic_get_mntinfo(): device=[/dev/sda3] has major=[8] and minor=[3]
filesys.c#203,generic_get_mntinfo(): mountinfo entry: major=[0] minor=[3] filesys=[proc] col_opt=[rw] col_mnt=[/proc]
filesys.c#203,generic_get_mntinfo(): mountinfo entry: major=[0] minor=[13] filesys=[sysfs] col_opt=[rw] col_mnt=[/sys]
filesys.c#203,generic_get_mntinfo(): mountinfo entry: major=[0] minor=[5] filesys=[devtmpfs] col_opt=[rw,size=931040k,nr_inodes=219791,mode=755] col_mnt=[/dev]
filesys.c#203,generic_get_mntinfo(): mountinfo entry: major=[0] minor=[14] filesys=[tmpfs] col_opt=[rw,mode=755] col_mnt=[/run]
filesys.c#203,generic_get_mntinfo(): mountinfo entry: major=[8] minor=[3] filesys=[ext4] col_opt=[rw,discard,data=ordered] col_mnt=[/]
filesys.c#209,generic_get_mntinfo(): found mountinfo entry for device=[/dev/sda3]: mnt=[/] fs=[ext4] opt=[rw,discard,data=ordered]
oper_save.c#933,filesystem_mount_partition(): generic_get_mntinfo(/dev/sda3): mnt=[/], opt=[rw,discard,data=ordered], fs=[ext4], rw=[1]

As you can see, when I boot with systemd, fsarchiver isn't parsing the /proc/mount/self/mountinfo properly. The fields are in the wrong places. Thus, filesystem=1 instead of ext4. lol.

Upon further investigation....

/proc/self/mountinfo (systemd)
18 1 8:3 / / rw,noatime shared:1 - ext4 /dev/sda3 rw,discard,data=ordered

/proc/self/mountinfo (sysvinit)
18 1 8:3 / / rw,noatime - ext4 /dev/sda3 rw,discard,data=ordered

systemd uses the optional shared field ("shared:1") and this is what throws off the fsarchiver parsing.

From what I understand, systemd now mounts as shared by default.

You can use a command like mount --make-private / to force the mount to become private and thus get rid of the shared field, though I don't know if there would be any negative consequences.

Last edited by slickvguy (2012-10-30 08:38:33)

Offline

#9 2012-12-10 02:52:14

agaskins
Member
Registered: 2012-04-17
Posts: 5

Re: FSArchiver not supporting EXT4 partition?

slickvguy wrote:

Here's the problem:
From what I understand, systemd now mounts as shared by default.

You can use a command like mount --make-private / to force the mount to become private and thus get rid of the shared field, though I don't know if there would be any negative consequences.

Confirmed. Running 'sudo mount --make-private /' works! Thanks slickvguy!

Offline

Board footer

Powered by FluxBB